/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.129
 *
 * Copyright 2011-2022 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */

var Cesium=(()=>{var u1e=Object.create;var nN=Object.defineProperty;var m1e=Object.getOwnPropertyDescriptor;var f1e=Object.getOwnPropertyNames;var h1e=Object.getPrototypeOf,p1e=Object.prototype.hasOwnProperty;var iN=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var ad=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),b1e=(e,t)=>{for(var n in t)nN(e,n,{get:t[n],enumerable:!0})},Tq=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of f1e(t))!p1e.call(e,o)&&o!==n&&nN(e,o,{get:()=>t[o],enumerable:!(i=m1e(t,o))||i.enumerable});return e};var _=(e,t,n)=>(n=e!=null?u1e(h1e(e)):{},Tq(t||!e||!e.__esModule?nN(n,"default",{value:e,enumerable:!0}):n,e)),y1e=e=>Tq(nN({},"__esModule",{value:!0}),e);var T=ad(()=>{globalThis.CESIUM_WORKERS=atob(" ")});var oN=ad((oLt,Sq)=>{var rLt=_(T()),xp=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)};xp.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}};xp.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};xp.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};xp.prototype.random_int31=function(){return this.random_int()>>>1};xp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};xp.prototype.random=function(){return this.random_int()*(1/4294967296)};xp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};xp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Sq.exports=xp});var zq=ad((YS,HS)=>{var lGt=_(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof YS=="object"&&YS&&!YS.nodeType&&YS,n=typeof HS=="object"&&HS&&!HS.nodeType&&HS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,l=26,d=38,u=700,f=72,p=128,y="-",h=/^xn--/,g=/[^\x20-\x7E]/,x=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,Z=Math.floor,R=String.fromCharCode,E;function I(O){throw new RangeError(S[O])}function v(O,H){for(var U=O.length,K=[];U--;)K[U]=H(O[U]);return K}function P(O,H){var U=O.split("@"),K="";U.length>1&&(K=U[0]+"@",O=U[1]),O=O.replace(x,".");var Q=O.split("."),ie=v(Q,H).join(".");return K+ie}function F(O){for(var H=[],U=0,K=O.length,Q,ie;U<K;)Q=O.charCodeAt(U++),Q>=55296&&Q<=56319&&U<K?(ie=O.charCodeAt(U++),(ie&64512)==56320?H.push(((Q&1023)<<10)+(ie&1023)+65536):(H.push(Q),U--)):H.push(Q);return H}function N(O){return v(O,function(H){var U="";return H>65535&&(H-=65536,U+=R(H>>>10&1023|55296),H=56320|H&1023),U+=R(H),U}).join("")}function b(O){return O-48<10?O-22:O-65<26?O-65:O-97<26?O-97:s}function G(O,H){return O+22+75*(O<26)-((H!=0)<<5)}function X(O,H,U){var K=0;for(O=U?Z(O/u):O>>1,O+=Z(O/H);O>V*l>>1;K+=s)O=Z(O/V);return Z(K+(V+1)*O/(O+d))}function W(O){var H=[],U=O.length,K,Q=0,ie=p,j=f,$,ne,be,Ce,me,_e,Ve,Ie,Ze;for($=O.lastIndexOf(y),$<0&&($=0),ne=0;ne<$;++ne)O.charCodeAt(ne)>=128&&I("not-basic"),H.push(O.charCodeAt(ne));for(be=$>0?$+1:0;be<U;){for(Ce=Q,me=1,_e=s;be>=U&&I("invalid-input"),Ve=b(O.charCodeAt(be++)),(Ve>=s||Ve>Z((r-Q)/me))&&I("overflow"),Q+=Ve*me,Ie=_e<=j?a:_e>=j+l?l:_e-j,!(Ve<Ie);_e+=s)Ze=s-Ie,me>Z(r/Ze)&&I("overflow"),me*=Ze;K=H.length+1,j=X(Q-Ce,K,Ce==0),Z(Q/K)>r-ie&&I("overflow"),ie+=Z(Q/K),Q%=K,H.splice(Q++,0,ie)}return N(H)}function A(O){var H,U,K,Q,ie,j,$,ne,be,Ce,me,_e=[],Ve,Ie,Ze,De;for(O=F(O),Ve=O.length,H=p,U=0,ie=f,j=0;j<Ve;++j)me=O[j],me<128&&_e.push(R(me));for(K=Q=_e.length,Q&&_e.push(y);K<Ve;){for($=r,j=0;j<Ve;++j)me=O[j],me>=H&&me<$&&($=me);for(Ie=K+1,$-H>Z((r-U)/Ie)&&I("overflow"),U+=($-H)*Ie,H=$,j=0;j<Ve;++j)if(me=O[j],me<H&&++U>r&&I("overflow"),me==H){for(ne=U,be=s;Ce=be<=ie?a:be>=ie+l?l:be-ie,!(ne<Ce);be+=s)De=ne-Ce,Ze=s-Ce,_e.push(R(G(Ce+De%Ze,0))),ne=Z(De/Ze);_e.push(R(G(ne,0))),ie=X(U,Ie,K==Q),U=0,++K}++U,++H}return _e.join("")}function k(O){return P(O,function(H){return h.test(H)?W(H.slice(4).toLowerCase()):H})}function B(O){return P(O,function(H){return g.test(H)?"xn--"+A(H):H})}if(o={version:"1.3.2",ucs2:{decode:F,encode:N},decode:W,encode:A,toASCII:B,toUnicode:k},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(HS.exports==t)n.exports=o;else for(E in o)o.hasOwnProperty(E)&&(t[E]=o[E]);else e.punycode=o})(YS)});var Jq=ad((Kq,ZN)=>{var dGt=_(T());/*!
 * 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 ZN=="object"&&ZN.exports?ZN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Kq,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,l=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&&(l=7);var d;for(d=0;d<a&&s[d]!=="";d++);if(d<l)for(s.splice(d,1,"0000");s.length<l;)s.splice(d,0,"0000");for(var u,f=0;f<l;f++){u=s[f].split("");for(var p=0;p<3&&(u[0]==="0"&&u.length>1);p++)u.splice(0,1);s[f]=u.join("")}var y=-1,h=0,g=0,x=-1,S=!1;for(f=0;f<l;f++)S?s[f]==="0"?g+=1:(S=!1,g>h&&(y=x,h=g)):s[f]==="0"&&(S=!0,x=f,g=1);g>h&&(y=x,h=g),h>1&&s.splice(y,h,""),a=s.length;var V="";for(s[0]===""&&(V=":"),f=0;f<a&&(V+=s[f],f!==a-1);f++)V+=":";return s[a-1]===""&&(V+=":"),V}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var jq=ad((Qq,RN)=>{var uGt=_(T());/*!
 * 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 RN=="object"&&RN.exports?RN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Qq,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 cd=ad((qq,GN)=>{var mGt=_(T());/*!
 * 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 GN=="object"&&GN.exports?GN.exports=t(zq(),Jq(),jq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(qq,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(G,X){var W=arguments.length>=1,A=arguments.length>=2;if(!(this instanceof r))return W?A?new r(G,X):new r(G):new r;if(G===void 0){if(W)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?G=location.href+"":G=""}if(G===null&&W)throw new TypeError("null is not a valid argument for URI");return this.href(G),X!==void 0?this.absoluteTo(X):this}function s(G){return/^[0-9]+$/.test(G)}r.version="1.19.11";var a=r.prototype,l=Object.prototype.hasOwnProperty;function d(G){return G.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(G){return G===void 0?"Undefined":String(Object.prototype.toString.call(G)).slice(8,-1)}function f(G){return u(G)==="Array"}function p(G,X){var W={},A,k;if(u(X)==="RegExp")W=null;else if(f(X))for(A=0,k=X.length;A<k;A++)W[X[A]]=!0;else W[X]=!0;for(A=0,k=G.length;A<k;A++){var B=W&&W[G[A]]!==void 0||!W&&X.test(G[A]);B&&(G.splice(A,1),k--,A--)}return G}function y(G,X){var W,A;if(f(X)){for(W=0,A=X.length;W<A;W++)if(!y(G,X[W]))return!1;return!0}var k=u(X);for(W=0,A=G.length;W<A;W++)if(k==="RegExp"){if(typeof G[W]=="string"&&G[W].match(X))return!0}else if(G[W]===X)return!0;return!1}function h(G,X){if(!f(G)||!f(X)||G.length!==X.length)return!1;G.sort(),X.sort();for(var W=0,A=G.length;W<A;W++)if(G[W]!==X[W])return!1;return!0}function g(G){var X=/^\/+|\/+$/g;return G.replace(X,"")}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(G){if(!(!G||!G.nodeName)){var X=G.nodeName.toLowerCase();if(!(X==="input"&&G.type!=="image"))return r.domAttributes[X]}};function x(G){return escape(G)}function S(G){return encodeURIComponent(G).replace(/[!'()*]/g,x).replace(/\*/g,"%2A")}r.encode=S,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=S,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(G,X){var W=r.encode(G+"");return X===void 0&&(X=r.escapeQuerySpace),X?W.replace(/%20/g,"+"):W},r.decodeQuery=function(G,X){G+="",X===void 0&&(X=r.escapeQuerySpace);try{return r.decode(X?G.replace(/\+/g,"%20"):G)}catch{return G}};var V={encode:"encode",decode:"decode"},Z,R=function(G,X){return function(W){try{return r[X](W+"").replace(r.characters[G][X].expression,function(A){return r.characters[G][X].map[A]})}catch{return W}}};for(Z in V)r[Z+"PathSegment"]=R("pathname",V[Z]),r[Z+"UrnPathSegment"]=R("urnpath",V[Z]);var E=function(G,X,W){return function(A){var k;W?k=function(U){return r[X](r[W](U))}:k=r[X];for(var B=(A+"").split(G),O=0,H=B.length;O<H;O++)B[O]=k(B[O]);return B.join(G)}};r.decodePath=E("/","decodePathSegment"),r.decodeUrnPath=E(":","decodeUrnPathSegment"),r.recodePath=E("/","encodePathSegment","decode"),r.recodeUrnPath=E(":","encodeUrnPathSegment","decode"),r.encodeReserved=R("reserved","encode"),r.parse=function(G,X){var W;return X||(X={preventInvalidHostname:r.preventInvalidHostname}),G=G.replace(r.leading_whitespace_expression,""),G=G.replace(r.ascii_tab_whitespace,""),W=G.indexOf("#"),W>-1&&(X.fragment=G.substring(W+1)||null,G=G.substring(0,W)),W=G.indexOf("?"),W>-1&&(X.query=G.substring(W+1)||null,G=G.substring(0,W)),G=G.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),G=G.replace(/^[/\\]{2,}/i,"//"),G.substring(0,2)==="//"?(X.protocol=null,G=G.substring(2),G=r.parseAuthority(G,X)):(W=G.indexOf(":"),W>-1&&(X.protocol=G.substring(0,W)||null,X.protocol&&!X.protocol.match(r.protocol_expression)?X.protocol=void 0:G.substring(W+1,W+3).replace(/\\/g,"/")==="//"?(G=G.substring(W+3),G=r.parseAuthority(G,X)):(G=G.substring(W+1),X.urn=!0))),X.path=G,X},r.parseHost=function(G,X){G||(G=""),G=G.replace(/\\/g,"/");var W=G.indexOf("/"),A,k;if(W===-1&&(W=G.length),G.charAt(0)==="[")A=G.indexOf("]"),X.hostname=G.substring(1,A)||null,X.port=G.substring(A+2,W)||null,X.port==="/"&&(X.port=null);else{var B=G.indexOf(":"),O=G.indexOf("/"),H=G.indexOf(":",B+1);H!==-1&&(O===-1||H<O)?(X.hostname=G.substring(0,W)||null,X.port=null):(k=G.substring(0,W).split(":"),X.hostname=k[0]||null,X.port=k[1]||null)}return X.hostname&&G.substring(W).charAt(0)!=="/"&&(W++,G="/"+G),X.preventInvalidHostname&&r.ensureValidHostname(X.hostname,X.protocol),X.port&&r.ensureValidPort(X.port),G.substring(W)||"/"},r.parseAuthority=function(G,X){return G=r.parseUserinfo(G,X),r.parseHost(G,X)},r.parseUserinfo=function(G,X){var W=G,A=G.indexOf("\\");A!==-1&&(G=G.replace(/\\/g,"/"));var k=G.indexOf("/"),B=G.lastIndexOf("@",k>-1?k:G.length-1),O;return B>-1&&(k===-1||B<k)?(O=G.substring(0,B).split(":"),X.username=O[0]?r.decode(O[0]):null,O.shift(),X.password=O[0]?r.decode(O.join(":")):null,G=W.substring(B+1)):(X.username=null,X.password=null),G},r.parseQuery=function(G,X){if(!G)return{};if(G=G.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!G)return{};for(var W={},A=G.split("&"),k=A.length,B,O,H,U=0;U<k;U++)B=A[U].split("="),O=r.decodeQuery(B.shift(),X),H=B.length?r.decodeQuery(B.join("="),X):null,O!=="__proto__"&&(l.call(W,O)?((typeof W[O]=="string"||W[O]===null)&&(W[O]=[W[O]]),W[O].push(H)):W[O]=H);return W},r.build=function(G){var X="",W=!1;return G.protocol&&(X+=G.protocol+":"),!G.urn&&(X||G.hostname)&&(X+="//",W=!0),X+=r.buildAuthority(G)||"",typeof G.path=="string"&&(G.path.charAt(0)!=="/"&&W&&(X+="/"),X+=G.path),typeof G.query=="string"&&G.query&&(X+="?"+G.query),typeof G.fragment=="string"&&G.fragment&&(X+="#"+G.fragment),X},r.buildHost=function(G){var X="";if(G.hostname)r.ip6_expression.test(G.hostname)?X+="["+G.hostname+"]":X+=G.hostname;else return"";return G.port&&(X+=":"+G.port),X},r.buildAuthority=function(G){return r.buildUserinfo(G)+r.buildHost(G)},r.buildUserinfo=function(G){var X="";return G.username&&(X+=r.encode(G.username)),G.password&&(X+=":"+r.encode(G.password)),X&&(X+="@"),X},r.buildQuery=function(G,X,W){var A="",k,B,O,H;for(B in G)if(B!=="__proto__"&&l.call(G,B))if(f(G[B]))for(k={},O=0,H=G[B].length;O<H;O++)G[B][O]!==void 0&&k[G[B][O]+""]===void 0&&(A+="&"+r.buildQueryParameter(B,G[B][O],W),X!==!0&&(k[G[B][O]+""]=!0));else G[B]!==void 0&&(A+="&"+r.buildQueryParameter(B,G[B],W));return A.substring(1)},r.buildQueryParameter=function(G,X,W){return r.encodeQuery(G,W)+(X!==null?"="+r.encodeQuery(X,W):"")},r.addQuery=function(G,X,W){if(typeof X=="object")for(var A in X)l.call(X,A)&&r.addQuery(G,A,X[A]);else if(typeof X=="string"){if(G[X]===void 0){G[X]=W;return}else typeof G[X]=="string"&&(G[X]=[G[X]]);f(W)||(W=[W]),G[X]=(G[X]||[]).concat(W)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(G,X,W){if(typeof X=="object")for(var A in X)l.call(X,A)&&r.setQuery(G,A,X[A]);else if(typeof X=="string")G[X]=W===void 0?null:W;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(G,X,W){var A,k,B;if(f(X))for(A=0,k=X.length;A<k;A++)G[X[A]]=void 0;else if(u(X)==="RegExp")for(B in G)X.test(B)&&(G[B]=void 0);else if(typeof X=="object")for(B in X)l.call(X,B)&&r.removeQuery(G,B,X[B]);else if(typeof X=="string")W!==void 0?u(W)==="RegExp"?!f(G[X])&&W.test(G[X])?G[X]=void 0:G[X]=p(G[X],W):G[X]===String(W)&&(!f(W)||W.length===1)?G[X]=void 0:f(G[X])&&(G[X]=p(G[X],W)):G[X]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(G,X,W,A){switch(u(X)){case"String":break;case"RegExp":for(var k in G)if(l.call(G,k)&&X.test(k)&&(W===void 0||r.hasQuery(G,k,W)))return!0;return!1;case"Object":for(var B in X)if(l.call(X,B)&&!r.hasQuery(G,B,X[B]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(W)){case"Undefined":return X in G;case"Boolean":var O=!!(f(G[X])?G[X].length:G[X]);return W===O;case"Function":return!!W(G[X],X,G);case"Array":if(!f(G[X]))return!1;var H=A?y:h;return H(G[X],W);case"RegExp":return f(G[X])?A?y(G[X],W):!1:!!(G[X]&&G[X].match(W));case"Number":W=String(W);case"String":return f(G[X])?A?y(G[X],W):!1:G[X]===W;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var G=[],X=[],W=0,A=0;A<arguments.length;A++){var k=new r(arguments[A]);G.push(k);for(var B=k.segment(),O=0;O<B.length;O++)typeof B[O]=="string"&&X.push(B[O]),B[O]&&W++}if(!X.length||!W)return new r("");var H=new r("").segment(X);return(G[0].path()===""||G[0].path().slice(0,1)==="/")&&H.path("/"+H.path()),H.normalize()},r.commonPath=function(G,X){var W=Math.min(G.length,X.length),A;for(A=0;A<W;A++)if(G.charAt(A)!==X.charAt(A)){A--;break}return A<1?G.charAt(0)===X.charAt(0)&&G.charAt(0)==="/"?"/":"":((G.charAt(A)!=="/"||X.charAt(A)!=="/")&&(A=G.substring(0,A).lastIndexOf("/")),G.substring(0,A+1))},r.withinString=function(G,X,W){W||(W={});var A=W.start||r.findUri.start,k=W.end||r.findUri.end,B=W.trim||r.findUri.trim,O=W.parens||r.findUri.parens,H=/[a-z0-9-]=["']?$/i;for(A.lastIndex=0;;){var U=A.exec(G);if(!U)break;var K=U.index;if(W.ignoreHtml){var Q=G.slice(Math.max(K-3,0),K);if(Q&&H.test(Q))continue}for(var ie=K+G.slice(K).search(k),j=G.slice(K,ie),$=-1;;){var ne=O.exec(j);if(!ne)break;var be=ne.index+ne[0].length;$=Math.max($,be)}if($>-1?j=j.slice(0,$)+j.slice($).replace(B,""):j=j.replace(B,""),!(j.length<=U[0].length)&&!(W.ignore&&W.ignore.test(j))){ie=K+j.length;var Ce=X(j,K,ie,G);if(Ce===void 0){A.lastIndex=ie;continue}Ce=String(Ce),G=G.slice(0,K)+Ce+G.slice(ie),A.lastIndex=K+Ce.length}}return A.lastIndex=0,G},r.ensureValidHostname=function(G,X){var W=!!G,A=!!X,k=!1;if(A&&(k=y(r.hostProtocols,X)),k&&!W)throw new TypeError("Hostname cannot be empty, if protocol is "+X);if(G&&G.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(G).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(G){if(G){var X=Number(G);if(!(s(X)&&X>0&&X<65536))throw new TypeError('Port "'+G+'" is not a valid port')}},r.noConflict=function(G){if(G){var X={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(X.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(X.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(X.SecondLevelDomains=i.SecondLevelDomains.noConflict()),X}else i.URI===this&&(i.URI=o);return this},a.build=function(G){return G===!0?this._deferred_build=!0:(G===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 I(G){return function(X,W){return X===void 0?this._parts[G]||"":(this._parts[G]=X||null,this.build(!W),this)}}function v(G,X){return function(W,A){return W===void 0?this._parts[G]||"":(W!==null&&(W=W+"",W.charAt(0)===X&&(W=W.substring(1))),this._parts[G]=W,this.build(!A),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=v("query","?"),a.fragment=v("fragment","#"),a.search=function(G,X){var W=this.query(G,X);return typeof W=="string"&&W.length?"?"+W:W},a.hash=function(G,X){var W=this.fragment(G,X);return typeof W=="string"&&W.length?"#"+W:W},a.pathname=function(G,X){if(G===void 0||G===!0){var W=this._parts.path||(this._parts.hostname?"/":"");return G?(this._parts.urn?r.decodeUrnPath:r.decodePath)(W):W}else return this._parts.urn?this._parts.path=G?r.recodeUrnPath(G):"":this._parts.path=G?r.recodePath(G):"/",this.build(!X),this},a.path=a.pathname,a.href=function(G,X){var W;if(G===void 0)return this.toString();this._string="",this._parts=r._parts();var A=G instanceof r,k=typeof G=="object"&&(G.hostname||G.path||G.pathname);if(G.nodeName){var B=r.getDomAttribute(G);G=G[B]||"",k=!1}if(!A&&k&&G.pathname!==void 0&&(G=G.toString()),typeof G=="string"||G instanceof String)this._parts=r.parse(String(G),this._parts);else if(A||k){var O=A?G._parts:G;for(W in O)W!=="query"&&l.call(this._parts,W)&&(this._parts[W]=O[W]);O.query&&this.query(O.query,!1)}else throw new TypeError("invalid input");return this.build(!X),this},a.is=function(G){var X=!1,W=!1,A=!1,k=!1,B=!1,O=!1,H=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,W=r.ip4_expression.test(this._parts.hostname),A=r.ip6_expression.test(this._parts.hostname),X=W||A,k=!X,B=k&&n&&n.has(this._parts.hostname),O=k&&r.idn_expression.test(this._parts.hostname),H=k&&r.punycode_expression.test(this._parts.hostname)),G.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return k;case"sld":return B;case"ip":return X;case"ip4":case"ipv4":case"inet4":return W;case"ip6":case"ipv6":case"inet6":return A;case"idn":return O;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return H}return null};var P=a.protocol,F=a.port,N=a.hostname;a.protocol=function(G,X){if(G&&(G=G.replace(/:(\/\/)?$/,""),!G.match(r.protocol_expression)))throw new TypeError('Protocol "'+G+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,G,X)},a.scheme=a.protocol,a.port=function(G,X){return this._parts.urn?G===void 0?"":this:(G!==void 0&&(G===0&&(G=null),G&&(G+="",G.charAt(0)===":"&&(G=G.substring(1)),r.ensureValidPort(G))),F.call(this,G,X))},a.hostname=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G!==void 0){var W={preventInvalidHostname:this._parts.preventInvalidHostname},A=r.parseHost(G,W);if(A!=="/")throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-]');G=W.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(G,this._parts.protocol)}return N.call(this,G,X)},a.origin=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0){var W=this.protocol(),A=this.authority();return A?(W?W+"://":"")+this.authority():""}else{var k=r(G);return this.protocol(k.protocol()).authority(k.authority()).build(!X),this}},a.host=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var W=r.parseHost(G,this._parts);if(W!=="/")throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-]');return this.build(!X),this},a.authority=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var W=r.parseAuthority(G,this._parts);if(W!=="/")throw new TypeError('Hostname "'+G+'" contains characters other than [A-Z0-9.-]');return this.build(!X),this},a.userinfo=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0){var W=r.buildUserinfo(this._parts);return W&&W.substring(0,W.length-1)}else return G[G.length-1]!=="@"&&(G+="@"),r.parseUserinfo(G,this._parts),this.build(!X),this},a.resource=function(G,X){var W;return G===void 0?this.path()+this.search()+this.hash():(W=r.parse(G),this._parts.path=W.path,this._parts.query=W.query,this._parts.fragment=W.fragment,this.build(!X),this)},a.subdomain=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0){if(!this._parts.hostname||this.is("IP"))return"";var W=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,W)||""}else{var A=this._parts.hostname.length-this.domain().length,k=this._parts.hostname.substring(0,A),B=new RegExp("^"+d(k));if(G&&G.charAt(G.length-1)!=="."&&(G+="."),G.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return G&&r.ensureValidHostname(G,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(B,G),this.build(!X),this}},a.domain=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(typeof G=="boolean"&&(X=G,G=void 0),G===void 0){if(!this._parts.hostname||this.is("IP"))return"";var W=this._parts.hostname.match(/\./g);if(W&&W.length<2)return this._parts.hostname;var A=this._parts.hostname.length-this.tld(X).length-1;return A=this._parts.hostname.lastIndexOf(".",A-1)+1,this._parts.hostname.substring(A)||""}else{if(!G)throw new TypeError("cannot set domain empty");if(G.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(G,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=G;else{var k=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(k,G)}return this.build(!X),this}},a.tld=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(typeof G=="boolean"&&(X=G,G=void 0),G===void 0){if(!this._parts.hostname||this.is("IP"))return"";var W=this._parts.hostname.lastIndexOf("."),A=this._parts.hostname.substring(W+1);return X!==!0&&n&&n.list[A.toLowerCase()]&&n.get(this._parts.hostname)||A}else{var k;if(G)if(G.match(/[^a-zA-Z0-9-]/))if(n&&n.is(G))k=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,G);else throw new TypeError('TLD "'+G+'" 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");k=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,G)}else throw new TypeError("cannot set TLD empty");return this.build(!X),this}},a.directory=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0||G===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var W=this._parts.path.length-this.filename().length-1,A=this._parts.path.substring(0,W)||(this._parts.hostname?"/":"");return G?r.decodePath(A):A}else{var k=this._parts.path.length-this.filename().length,B=this._parts.path.substring(0,k),O=new RegExp("^"+d(B));return this.is("relative")||(G||(G="/"),G.charAt(0)!=="/"&&(G="/"+G)),G&&G.charAt(G.length-1)!=="/"&&(G+="/"),G=r.recodePath(G),this._parts.path=this._parts.path.replace(O,G),this.build(!X),this}},a.filename=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(typeof G!="string"){if(!this._parts.path||this._parts.path==="/")return"";var W=this._parts.path.lastIndexOf("/"),A=this._parts.path.substring(W+1);return G?r.decodePathSegment(A):A}else{var k=!1;G.charAt(0)==="/"&&(G=G.substring(1)),G.match(/\.?\//)&&(k=!0);var B=new RegExp(d(this.filename())+"$");return G=r.recodePath(G),this._parts.path=this._parts.path.replace(B,G),k?this.normalizePath(X):this.build(!X),this}},a.suffix=function(G,X){if(this._parts.urn)return G===void 0?"":this;if(G===void 0||G===!0){if(!this._parts.path||this._parts.path==="/")return"";var W=this.filename(),A=W.lastIndexOf("."),k,B;return A===-1?"":(k=W.substring(A+1),B=/^[a-z0-9%]+$/i.test(k)?k:"",G?r.decodePathSegment(B):B)}else{G.charAt(0)==="."&&(G=G.substring(1));var O=this.suffix(),H;if(O)G?H=new RegExp(d(O)+"$"):H=new RegExp(d("."+O)+"$");else{if(!G)return this;this._parts.path+="."+r.recodePath(G)}return H&&(G=r.recodePath(G),this._parts.path=this._parts.path.replace(H,G)),this.build(!X),this}},a.segment=function(G,X,W){var A=this._parts.urn?":":"/",k=this.path(),B=k.substring(0,1)==="/",O=k.split(A);if(G!==void 0&&typeof G!="number"&&(W=X,X=G,G=void 0),G!==void 0&&typeof G!="number")throw new Error('Bad segment "'+G+'", must be 0-based integer');if(B&&O.shift(),G<0&&(G=Math.max(O.length+G,0)),X===void 0)return G===void 0?O:O[G];if(G===null||O[G]===void 0)if(f(X)){O=[];for(var H=0,U=X.length;H<U;H++)!X[H].length&&(!O.length||!O[O.length-1].length)||(O.length&&!O[O.length-1].length&&O.pop(),O.push(g(X[H])))}else(X||typeof X=="string")&&(X=g(X),O[O.length-1]===""?O[O.length-1]=X:O.push(X));else X?O[G]=g(X):O.splice(G,1);return B&&O.unshift(""),this.path(O.join(A),W)},a.segmentCoded=function(G,X,W){var A,k,B;if(typeof G!="number"&&(W=X,X=G,G=void 0),X===void 0){if(A=this.segment(G,X,W),!f(A))A=A!==void 0?r.decode(A):void 0;else for(k=0,B=A.length;k<B;k++)A[k]=r.decode(A[k]);return A}if(!f(X))X=typeof X=="string"||X instanceof String?r.encode(X):X;else for(k=0,B=X.length;k<B;k++)X[k]=r.encode(X[k]);return this.segment(G,X,W)};var b=a.query;return a.query=function(G,X){if(G===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof G=="function"){var W=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),A=G.call(this,W);return this._parts.query=r.buildQuery(A||W,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!X),this}else return G!==void 0&&typeof G!="string"?(this._parts.query=r.buildQuery(G,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!X),this):b.call(this,G,X)},a.setQuery=function(G,X,W){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof G=="string"||G instanceof String)A[G]=X!==void 0?X:null;else if(typeof G=="object")for(var k in G)l.call(G,k)&&(A[k]=G[k]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(A,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof G!="string"&&(W=X),this.build(!W),this},a.addQuery=function(G,X,W){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(A,G,X===void 0?null:X),this._parts.query=r.buildQuery(A,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof G!="string"&&(W=X),this.build(!W),this},a.removeQuery=function(G,X,W){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(A,G,X),this._parts.query=r.buildQuery(A,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof G!="string"&&(W=X),this.build(!W),this},a.hasQuery=function(G,X,W){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(A,G,X,W)},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(G){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!G)),this},a.normalizeHostname=function(G){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(!G)),this},a.normalizePort=function(G){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!G)),this},a.normalizePath=function(G){var X=this._parts.path;if(!X)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!G),this;if(this._parts.path==="/")return this;X=r.recodePath(X);var W,A="",k,B;for(X.charAt(0)!=="/"&&(W=!0,X="/"+X),(X.slice(-3)==="/.."||X.slice(-2)==="/.")&&(X+="/"),X=X.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),W&&(A=X.substring(1).match(/^(\.\.\/)+/)||"",A&&(A=A[0]));k=X.search(/\/\.\.(\/|$)/),k!==-1;){if(k===0){X=X.substring(3);continue}B=X.substring(0,k).lastIndexOf("/"),B===-1&&(B=k),X=X.substring(0,B)+X.substring(k+3)}return W&&this.is("relative")&&(X=A+X.substring(1)),this._parts.path=X,this.build(!G),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(G){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(!G)),this},a.normalizeFragment=function(G){return this._parts.fragment||(this._parts.fragment=null,this.build(!G)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var G=r.encode,X=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=G,r.decode=X}return this},a.unicode=function(){var G=r.encode,X=r.decode;r.encode=S,r.decode=unescape;try{this.normalize()}finally{r.encode=G,r.decode=X}return this},a.readable=function(){var G=this.clone();G.username("").password("").normalize();var X="";if(G._parts.protocol&&(X+=G._parts.protocol+"://"),G._parts.hostname&&(G.is("punycode")&&e?(X+=e.toUnicode(G._parts.hostname),G._parts.port&&(X+=":"+G._parts.port)):X+=G.host()),G._parts.hostname&&G._parts.path&&G._parts.path.charAt(0)!=="/"&&(X+="/"),X+=G.path(!0),G._parts.query){for(var W="",A=0,k=G._parts.query.split("&"),B=k.length;A<B;A++){var O=(k[A]||"").split("=");W+="&"+r.decodeQuery(O[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),O[1]!==void 0&&(W+="="+r.decodeQuery(O[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}X+="?"+W.substring(1)}return X+=r.decodeQuery(G.hash(),!0),X},a.absoluteTo=function(G){var X=this.clone(),W=["protocol","username","password","hostname","port"],A,k,B;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(G instanceof r||(G=new r(G)),X._parts.protocol||(X._parts.protocol=G._parts.protocol,this._parts.hostname))return X;for(k=0;B=W[k];k++)X._parts[B]=G._parts[B];return X._parts.path?(X._parts.path.substring(-2)===".."&&(X._parts.path+="/"),X.path().charAt(0)!=="/"&&(A=G.directory(),A=A||(G.path().indexOf("/")===0?"/":""),X._parts.path=(A?A+"/":"")+X._parts.path,X.normalizePath())):(X._parts.path=G._parts.path,X._parts.query||(X._parts.query=G._parts.query)),X.build(),X},a.relativeTo=function(G){var X=this.clone().normalize(),W,A,k,B,O;if(X._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(G=new r(G).normalize(),W=X._parts,A=G._parts,B=X.path(),O=G.path(),B.charAt(0)!=="/")throw new Error("URI is already relative");if(O.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(W.protocol===A.protocol&&(W.protocol=null),W.username!==A.username||W.password!==A.password||W.protocol!==null||W.username!==null||W.password!==null)return X.build();if(W.hostname===A.hostname&&W.port===A.port)W.hostname=null,W.port=null;else return X.build();if(B===O)return W.path="",X.build();if(k=r.commonPath(B,O),!k)return X.build();var H=A.path.substring(k.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return W.path=H+W.path.substring(k.length)||"./",X.build()},a.equals=function(G){var X=this.clone(),W=new r(G),A={},k={},B={},O,H,U;if(X.normalize(),W.normalize(),X.toString()===W.toString())return!0;if(O=X.query(),H=W.query(),X.query(""),W.query(""),X.toString()!==W.toString()||O.length!==H.length)return!1;A=r.parseQuery(O,this._parts.escapeQuerySpace),k=r.parseQuery(H,this._parts.escapeQuerySpace);for(U in A)if(l.call(A,U)){if(f(A[U])){if(!h(A[U],k[U]))return!1}else if(A[U]!==k[U])return!1;B[U]=!0}for(U in k)if(l.call(k,U)&&!B[U])return!1;return!0},a.preventInvalidHostname=function(G){return this._parts.preventInvalidHostname=!!G,this},a.duplicateQueryParameters=function(G){return this._parts.duplicateQueryParameters=!!G,this},a.escapeQuerySpace=function(G){return this._parts.escapeQuerySpace=!!G,this},r})});var fle=ad((zkn,mle)=>{"use strict";var Kkn=_(T());mle.exports=mKe;var Dw=1e20;function mKe(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,l,d,u,f,p,y,h,g;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,l=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,f=p.getContext("2d"),r=p.width,s=p.height,y=f.getImageData(0,0,r,s),l=y.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,f=e,r=p.width,s=p.height,y=f.getImageData(0,0,r,s),l=y.data,u=4):window.ImageData&&e instanceof window.ImageData&&(y=e,r=e.width,s=e.height,l=y.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(d=l,l=Array(r*s),h=0,g=Math.floor(d.length/u);h<g;h++)l[h]=d[h*u+o]/255;else if(u!==1)throw Error("Raw data can have only 1 value per pixel");var x=Array(r*s),S=Array(r*s),V=Array(a),Z=Array(a),R=Array(a+1),E=Array(a);for(h=0,g=r*s;h<g;h++){var I=l[h];x[h]=I===1?0:I===0?Dw:Math.pow(Math.max(0,.5-I),2),S[h]=I===1?Dw:I===0?0:Math.pow(Math.max(0,I-.5),2)}dle(x,r,s,V,Z,E,R),dle(S,r,s,V,Z,E,R);var v=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(h=0,g=r*s;h<g;h++)v[h]=Math.min(Math.max(1-((x[h]-S[h])/i+n),0),1);return v}function dle(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var l=0;l<n;l++)i[l]=e[l*t+a];for(ule(i,o,r,s,n),l=0;l<n;l++)e[l*t+a]=o[l]}for(l=0;l<n;l++){for(a=0;a<t;a++)i[a]=e[l*t+a];for(ule(i,o,r,s,t),a=0;a<t;a++)e[l*t+a]=Math.sqrt(o[a])}}function ule(e,t,n,i,o){n[0]=0,i[0]=-Dw,i[1]=+Dw;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]=+Dw}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 gle=ad((hUn,bk)=>{var pUn=_(T());function CKe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,l=8,d=9,u=10,f=11,p=12,y=13,h=14,g=15,x=16,S=17,V=0,Z=1,R=2,E=3,I=4;function v(b,G){return 55296<=b.charCodeAt(G)&&b.charCodeAt(G)<=56319&&56320<=b.charCodeAt(G+1)&&b.charCodeAt(G+1)<=57343}function P(b,G){G===void 0&&(G=0);var X=b.charCodeAt(G);if(55296<=X&&X<=56319&&G<b.length-1){var W=X,A=b.charCodeAt(G+1);return 56320<=A&&A<=57343?(W-55296)*1024+(A-56320)+65536:W}if(56320<=X&&X<=57343&&G>=1){var W=b.charCodeAt(G-1),A=X;return 55296<=W&&W<=56319?(W-55296)*1024+(A-56320)+65536:A}return X}function F(b,G,X){var W=[b].concat(G).concat([X]),A=W[W.length-2],k=X,B=W.lastIndexOf(h);if(B>1&&W.slice(1,B).every(function(U){return U==i})&&[i,y,S].indexOf(b)==-1)return R;var O=W.lastIndexOf(o);if(O>0&&W.slice(1,O).every(function(U){return U==o})&&[p,o].indexOf(A)==-1)return W.filter(function(U){return U==o}).length%2==1?E:I;if(A==e&&k==t)return V;if(A==n||A==e||A==t)return k==h&&G.every(function(U){return U==i})?R:Z;if(k==n||k==e||k==t)return Z;if(A==s&&(k==s||k==a||k==d||k==u))return V;if((A==d||A==a)&&(k==a||k==l))return V;if((A==u||A==l)&&k==l)return V;if(k==i||k==g)return V;if(k==r)return V;if(A==p)return V;var H=W.indexOf(i)!=-1?W.lastIndexOf(i)-1:W.length-2;return[y,S].indexOf(W[H])!=-1&&W.slice(H+1,-1).every(function(U){return U==i})&&k==h||A==g&&[x,S].indexOf(k)!=-1?V:G.indexOf(o)!=-1?R:A==o&&k==o?V:Z}this.nextBreak=function(b,G){if(G===void 0&&(G=0),G<0)return 0;if(G>=b.length-1)return b.length;for(var X=N(P(b,G)),W=[],A=G+1;A<b.length;A++)if(!v(b,A-1)){var k=N(P(b,A));if(F(X,W,k))return A;W.push(k)}return b.length},this.splitGraphemes=function(b){for(var G=[],X=0,W;(W=this.nextBreak(b,X))<b.length;)G.push(b.slice(X,W)),X=W;return X<b.length&&G.push(b.slice(X)),G},this.iterateGraphemes=function(b){var G=0,X={next:function(){var W,A;return(A=this.nextBreak(b,G))<b.length?(W=b.slice(G,A),G=A,{value:W,done:!1}):G<b.length?(W=b.slice(G),G=b.length,{value:W,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(X[Symbol.iterator]=function(){return X}),X},this.countGraphemes=function(b){for(var G=0,X=0,W;(W=this.nextBreak(b,X))<b.length;)X=W,G++;return X<b.length&&G++,G};function N(b){return 1536<=b&&b<=1541||b==1757||b==1807||b==2274||b==3406||b==69821||70082<=b&&b<=70083||b==72250||72326<=b&&b<=72329||b==73030?p:b==13?e:b==10?t:0<=b&&b<=9||11<=b&&b<=12||14<=b&&b<=31||127<=b&&b<=159||b==173||b==1564||b==6158||b==8203||8206<=b&&b<=8207||b==8232||b==8233||8234<=b&&b<=8238||8288<=b&&b<=8292||b==8293||8294<=b&&b<=8303||55296<=b&&b<=57343||b==65279||65520<=b&&b<=65528||65529<=b&&b<=65531||113824<=b&&b<=113827||119155<=b&&b<=119162||b==917504||b==917505||917506<=b&&b<=917535||917632<=b&&b<=917759||918e3<=b&&b<=921599?n:768<=b&&b<=879||1155<=b&&b<=1159||1160<=b&&b<=1161||1425<=b&&b<=1469||b==1471||1473<=b&&b<=1474||1476<=b&&b<=1477||b==1479||1552<=b&&b<=1562||1611<=b&&b<=1631||b==1648||1750<=b&&b<=1756||1759<=b&&b<=1764||1767<=b&&b<=1768||1770<=b&&b<=1773||b==1809||1840<=b&&b<=1866||1958<=b&&b<=1968||2027<=b&&b<=2035||2070<=b&&b<=2073||2075<=b&&b<=2083||2085<=b&&b<=2087||2089<=b&&b<=2093||2137<=b&&b<=2139||2260<=b&&b<=2273||2275<=b&&b<=2306||b==2362||b==2364||2369<=b&&b<=2376||b==2381||2385<=b&&b<=2391||2402<=b&&b<=2403||b==2433||b==2492||b==2494||2497<=b&&b<=2500||b==2509||b==2519||2530<=b&&b<=2531||2561<=b&&b<=2562||b==2620||2625<=b&&b<=2626||2631<=b&&b<=2632||2635<=b&&b<=2637||b==2641||2672<=b&&b<=2673||b==2677||2689<=b&&b<=2690||b==2748||2753<=b&&b<=2757||2759<=b&&b<=2760||b==2765||2786<=b&&b<=2787||2810<=b&&b<=2815||b==2817||b==2876||b==2878||b==2879||2881<=b&&b<=2884||b==2893||b==2902||b==2903||2914<=b&&b<=2915||b==2946||b==3006||b==3008||b==3021||b==3031||b==3072||3134<=b&&b<=3136||3142<=b&&b<=3144||3146<=b&&b<=3149||3157<=b&&b<=3158||3170<=b&&b<=3171||b==3201||b==3260||b==3263||b==3266||b==3270||3276<=b&&b<=3277||3285<=b&&b<=3286||3298<=b&&b<=3299||3328<=b&&b<=3329||3387<=b&&b<=3388||b==3390||3393<=b&&b<=3396||b==3405||b==3415||3426<=b&&b<=3427||b==3530||b==3535||3538<=b&&b<=3540||b==3542||b==3551||b==3633||3636<=b&&b<=3642||3655<=b&&b<=3662||b==3761||3764<=b&&b<=3769||3771<=b&&b<=3772||3784<=b&&b<=3789||3864<=b&&b<=3865||b==3893||b==3895||b==3897||3953<=b&&b<=3966||3968<=b&&b<=3972||3974<=b&&b<=3975||3981<=b&&b<=3991||3993<=b&&b<=4028||b==4038||4141<=b&&b<=4144||4146<=b&&b<=4151||4153<=b&&b<=4154||4157<=b&&b<=4158||4184<=b&&b<=4185||4190<=b&&b<=4192||4209<=b&&b<=4212||b==4226||4229<=b&&b<=4230||b==4237||b==4253||4957<=b&&b<=4959||5906<=b&&b<=5908||5938<=b&&b<=5940||5970<=b&&b<=5971||6002<=b&&b<=6003||6068<=b&&b<=6069||6071<=b&&b<=6077||b==6086||6089<=b&&b<=6099||b==6109||6155<=b&&b<=6157||6277<=b&&b<=6278||b==6313||6432<=b&&b<=6434||6439<=b&&b<=6440||b==6450||6457<=b&&b<=6459||6679<=b&&b<=6680||b==6683||b==6742||6744<=b&&b<=6750||b==6752||b==6754||6757<=b&&b<=6764||6771<=b&&b<=6780||b==6783||6832<=b&&b<=6845||b==6846||6912<=b&&b<=6915||b==6964||6966<=b&&b<=6970||b==6972||b==6978||7019<=b&&b<=7027||7040<=b&&b<=7041||7074<=b&&b<=7077||7080<=b&&b<=7081||7083<=b&&b<=7085||b==7142||7144<=b&&b<=7145||b==7149||7151<=b&&b<=7153||7212<=b&&b<=7219||7222<=b&&b<=7223||7376<=b&&b<=7378||7380<=b&&b<=7392||7394<=b&&b<=7400||b==7405||b==7412||7416<=b&&b<=7417||7616<=b&&b<=7673||7675<=b&&b<=7679||b==8204||8400<=b&&b<=8412||8413<=b&&b<=8416||b==8417||8418<=b&&b<=8420||8421<=b&&b<=8432||11503<=b&&b<=11505||b==11647||11744<=b&&b<=11775||12330<=b&&b<=12333||12334<=b&&b<=12335||12441<=b&&b<=12442||b==42607||42608<=b&&b<=42610||42612<=b&&b<=42621||42654<=b&&b<=42655||42736<=b&&b<=42737||b==43010||b==43014||b==43019||43045<=b&&b<=43046||43204<=b&&b<=43205||43232<=b&&b<=43249||43302<=b&&b<=43309||43335<=b&&b<=43345||43392<=b&&b<=43394||b==43443||43446<=b&&b<=43449||b==43452||b==43493||43561<=b&&b<=43566||43569<=b&&b<=43570||43573<=b&&b<=43574||b==43587||b==43596||b==43644||b==43696||43698<=b&&b<=43700||43703<=b&&b<=43704||43710<=b&&b<=43711||b==43713||43756<=b&&b<=43757||b==43766||b==44005||b==44008||b==44013||b==64286||65024<=b&&b<=65039||65056<=b&&b<=65071||65438<=b&&b<=65439||b==66045||b==66272||66422<=b&&b<=66426||68097<=b&&b<=68099||68101<=b&&b<=68102||68108<=b&&b<=68111||68152<=b&&b<=68154||b==68159||68325<=b&&b<=68326||b==69633||69688<=b&&b<=69702||69759<=b&&b<=69761||69811<=b&&b<=69814||69817<=b&&b<=69818||69888<=b&&b<=69890||69927<=b&&b<=69931||69933<=b&&b<=69940||b==70003||70016<=b&&b<=70017||70070<=b&&b<=70078||70090<=b&&b<=70092||70191<=b&&b<=70193||b==70196||70198<=b&&b<=70199||b==70206||b==70367||70371<=b&&b<=70378||70400<=b&&b<=70401||b==70460||b==70462||b==70464||b==70487||70502<=b&&b<=70508||70512<=b&&b<=70516||70712<=b&&b<=70719||70722<=b&&b<=70724||b==70726||b==70832||70835<=b&&b<=70840||b==70842||b==70845||70847<=b&&b<=70848||70850<=b&&b<=70851||b==71087||71090<=b&&b<=71093||71100<=b&&b<=71101||71103<=b&&b<=71104||71132<=b&&b<=71133||71219<=b&&b<=71226||b==71229||71231<=b&&b<=71232||b==71339||b==71341||71344<=b&&b<=71349||b==71351||71453<=b&&b<=71455||71458<=b&&b<=71461||71463<=b&&b<=71467||72193<=b&&b<=72198||72201<=b&&b<=72202||72243<=b&&b<=72248||72251<=b&&b<=72254||b==72263||72273<=b&&b<=72278||72281<=b&&b<=72283||72330<=b&&b<=72342||72344<=b&&b<=72345||72752<=b&&b<=72758||72760<=b&&b<=72765||b==72767||72850<=b&&b<=72871||72874<=b&&b<=72880||72882<=b&&b<=72883||72885<=b&&b<=72886||73009<=b&&b<=73014||b==73018||73020<=b&&b<=73021||73023<=b&&b<=73029||b==73031||92912<=b&&b<=92916||92976<=b&&b<=92982||94095<=b&&b<=94098||113821<=b&&b<=113822||b==119141||119143<=b&&b<=119145||119150<=b&&b<=119154||119163<=b&&b<=119170||119173<=b&&b<=119179||119210<=b&&b<=119213||119362<=b&&b<=119364||121344<=b&&b<=121398||121403<=b&&b<=121452||b==121461||b==121476||121499<=b&&b<=121503||121505<=b&&b<=121519||122880<=b&&b<=122886||122888<=b&&b<=122904||122907<=b&&b<=122913||122915<=b&&b<=122916||122918<=b&&b<=122922||125136<=b&&b<=125142||125252<=b&&b<=125258||917536<=b&&b<=917631||917760<=b&&b<=917999?i:127462<=b&&b<=127487?o:b==2307||b==2363||2366<=b&&b<=2368||2377<=b&&b<=2380||2382<=b&&b<=2383||2434<=b&&b<=2435||2495<=b&&b<=2496||2503<=b&&b<=2504||2507<=b&&b<=2508||b==2563||2622<=b&&b<=2624||b==2691||2750<=b&&b<=2752||b==2761||2763<=b&&b<=2764||2818<=b&&b<=2819||b==2880||2887<=b&&b<=2888||2891<=b&&b<=2892||b==3007||3009<=b&&b<=3010||3014<=b&&b<=3016||3018<=b&&b<=3020||3073<=b&&b<=3075||3137<=b&&b<=3140||3202<=b&&b<=3203||b==3262||3264<=b&&b<=3265||3267<=b&&b<=3268||3271<=b&&b<=3272||3274<=b&&b<=3275||3330<=b&&b<=3331||3391<=b&&b<=3392||3398<=b&&b<=3400||3402<=b&&b<=3404||3458<=b&&b<=3459||3536<=b&&b<=3537||3544<=b&&b<=3550||3570<=b&&b<=3571||b==3635||b==3763||3902<=b&&b<=3903||b==3967||b==4145||4155<=b&&b<=4156||4182<=b&&b<=4183||b==4228||b==6070||6078<=b&&b<=6085||6087<=b&&b<=6088||6435<=b&&b<=6438||6441<=b&&b<=6443||6448<=b&&b<=6449||6451<=b&&b<=6456||6681<=b&&b<=6682||b==6741||b==6743||6765<=b&&b<=6770||b==6916||b==6965||b==6971||6973<=b&&b<=6977||6979<=b&&b<=6980||b==7042||b==7073||7078<=b&&b<=7079||b==7082||b==7143||7146<=b&&b<=7148||b==7150||7154<=b&&b<=7155||7204<=b&&b<=7211||7220<=b&&b<=7221||b==7393||7410<=b&&b<=7411||b==7415||43043<=b&&b<=43044||b==43047||43136<=b&&b<=43137||43188<=b&&b<=43203||43346<=b&&b<=43347||b==43395||43444<=b&&b<=43445||43450<=b&&b<=43451||43453<=b&&b<=43456||43567<=b&&b<=43568||43571<=b&&b<=43572||b==43597||b==43755||43758<=b&&b<=43759||b==43765||44003<=b&&b<=44004||44006<=b&&b<=44007||44009<=b&&b<=44010||b==44012||b==69632||b==69634||b==69762||69808<=b&&b<=69810||69815<=b&&b<=69816||b==69932||b==70018||70067<=b&&b<=70069||70079<=b&&b<=70080||70188<=b&&b<=70190||70194<=b&&b<=70195||b==70197||70368<=b&&b<=70370||70402<=b&&b<=70403||b==70463||70465<=b&&b<=70468||70471<=b&&b<=70472||70475<=b&&b<=70477||70498<=b&&b<=70499||70709<=b&&b<=70711||70720<=b&&b<=70721||b==70725||70833<=b&&b<=70834||b==70841||70843<=b&&b<=70844||b==70846||b==70849||71088<=b&&b<=71089||71096<=b&&b<=71099||b==71102||71216<=b&&b<=71218||71227<=b&&b<=71228||b==71230||b==71340||71342<=b&&b<=71343||b==71350||71456<=b&&b<=71457||b==71462||72199<=b&&b<=72200||b==72249||72279<=b&&b<=72280||b==72343||b==72751||b==72766||b==72873||b==72881||b==72884||94033<=b&&b<=94078||b==119142||b==119149?r:4352<=b&&b<=4447||43360<=b&&b<=43388?s:4448<=b&&b<=4519||55216<=b&&b<=55238?a:4520<=b&&b<=4607||55243<=b&&b<=55291?l:b==44032||b==44060||b==44088||b==44116||b==44144||b==44172||b==44200||b==44228||b==44256||b==44284||b==44312||b==44340||b==44368||b==44396||b==44424||b==44452||b==44480||b==44508||b==44536||b==44564||b==44592||b==44620||b==44648||b==44676||b==44704||b==44732||b==44760||b==44788||b==44816||b==44844||b==44872||b==44900||b==44928||b==44956||b==44984||b==45012||b==45040||b==45068||b==45096||b==45124||b==45152||b==45180||b==45208||b==45236||b==45264||b==45292||b==45320||b==45348||b==45376||b==45404||b==45432||b==45460||b==45488||b==45516||b==45544||b==45572||b==45600||b==45628||b==45656||b==45684||b==45712||b==45740||b==45768||b==45796||b==45824||b==45852||b==45880||b==45908||b==45936||b==45964||b==45992||b==46020||b==46048||b==46076||b==46104||b==46132||b==46160||b==46188||b==46216||b==46244||b==46272||b==46300||b==46328||b==46356||b==46384||b==46412||b==46440||b==46468||b==46496||b==46524||b==46552||b==46580||b==46608||b==46636||b==46664||b==46692||b==46720||b==46748||b==46776||b==46804||b==46832||b==46860||b==46888||b==46916||b==46944||b==46972||b==47e3||b==47028||b==47056||b==47084||b==47112||b==47140||b==47168||b==47196||b==47224||b==47252||b==47280||b==47308||b==47336||b==47364||b==47392||b==47420||b==47448||b==47476||b==47504||b==47532||b==47560||b==47588||b==47616||b==47644||b==47672||b==47700||b==47728||b==47756||b==47784||b==47812||b==47840||b==47868||b==47896||b==47924||b==47952||b==47980||b==48008||b==48036||b==48064||b==48092||b==48120||b==48148||b==48176||b==48204||b==48232||b==48260||b==48288||b==48316||b==48344||b==48372||b==48400||b==48428||b==48456||b==48484||b==48512||b==48540||b==48568||b==48596||b==48624||b==48652||b==48680||b==48708||b==48736||b==48764||b==48792||b==48820||b==48848||b==48876||b==48904||b==48932||b==48960||b==48988||b==49016||b==49044||b==49072||b==49100||b==49128||b==49156||b==49184||b==49212||b==49240||b==49268||b==49296||b==49324||b==49352||b==49380||b==49408||b==49436||b==49464||b==49492||b==49520||b==49548||b==49576||b==49604||b==49632||b==49660||b==49688||b==49716||b==49744||b==49772||b==49800||b==49828||b==49856||b==49884||b==49912||b==49940||b==49968||b==49996||b==50024||b==50052||b==50080||b==50108||b==50136||b==50164||b==50192||b==50220||b==50248||b==50276||b==50304||b==50332||b==50360||b==50388||b==50416||b==50444||b==50472||b==50500||b==50528||b==50556||b==50584||b==50612||b==50640||b==50668||b==50696||b==50724||b==50752||b==50780||b==50808||b==50836||b==50864||b==50892||b==50920||b==50948||b==50976||b==51004||b==51032||b==51060||b==51088||b==51116||b==51144||b==51172||b==51200||b==51228||b==51256||b==51284||b==51312||b==51340||b==51368||b==51396||b==51424||b==51452||b==51480||b==51508||b==51536||b==51564||b==51592||b==51620||b==51648||b==51676||b==51704||b==51732||b==51760||b==51788||b==51816||b==51844||b==51872||b==51900||b==51928||b==51956||b==51984||b==52012||b==52040||b==52068||b==52096||b==52124||b==52152||b==52180||b==52208||b==52236||b==52264||b==52292||b==52320||b==52348||b==52376||b==52404||b==52432||b==52460||b==52488||b==52516||b==52544||b==52572||b==52600||b==52628||b==52656||b==52684||b==52712||b==52740||b==52768||b==52796||b==52824||b==52852||b==52880||b==52908||b==52936||b==52964||b==52992||b==53020||b==53048||b==53076||b==53104||b==53132||b==53160||b==53188||b==53216||b==53244||b==53272||b==53300||b==53328||b==53356||b==53384||b==53412||b==53440||b==53468||b==53496||b==53524||b==53552||b==53580||b==53608||b==53636||b==53664||b==53692||b==53720||b==53748||b==53776||b==53804||b==53832||b==53860||b==53888||b==53916||b==53944||b==53972||b==54e3||b==54028||b==54056||b==54084||b==54112||b==54140||b==54168||b==54196||b==54224||b==54252||b==54280||b==54308||b==54336||b==54364||b==54392||b==54420||b==54448||b==54476||b==54504||b==54532||b==54560||b==54588||b==54616||b==54644||b==54672||b==54700||b==54728||b==54756||b==54784||b==54812||b==54840||b==54868||b==54896||b==54924||b==54952||b==54980||b==55008||b==55036||b==55064||b==55092||b==55120||b==55148||b==55176?d:44033<=b&&b<=44059||44061<=b&&b<=44087||44089<=b&&b<=44115||44117<=b&&b<=44143||44145<=b&&b<=44171||44173<=b&&b<=44199||44201<=b&&b<=44227||44229<=b&&b<=44255||44257<=b&&b<=44283||44285<=b&&b<=44311||44313<=b&&b<=44339||44341<=b&&b<=44367||44369<=b&&b<=44395||44397<=b&&b<=44423||44425<=b&&b<=44451||44453<=b&&b<=44479||44481<=b&&b<=44507||44509<=b&&b<=44535||44537<=b&&b<=44563||44565<=b&&b<=44591||44593<=b&&b<=44619||44621<=b&&b<=44647||44649<=b&&b<=44675||44677<=b&&b<=44703||44705<=b&&b<=44731||44733<=b&&b<=44759||44761<=b&&b<=44787||44789<=b&&b<=44815||44817<=b&&b<=44843||44845<=b&&b<=44871||44873<=b&&b<=44899||44901<=b&&b<=44927||44929<=b&&b<=44955||44957<=b&&b<=44983||44985<=b&&b<=45011||45013<=b&&b<=45039||45041<=b&&b<=45067||45069<=b&&b<=45095||45097<=b&&b<=45123||45125<=b&&b<=45151||45153<=b&&b<=45179||45181<=b&&b<=45207||45209<=b&&b<=45235||45237<=b&&b<=45263||45265<=b&&b<=45291||45293<=b&&b<=45319||45321<=b&&b<=45347||45349<=b&&b<=45375||45377<=b&&b<=45403||45405<=b&&b<=45431||45433<=b&&b<=45459||45461<=b&&b<=45487||45489<=b&&b<=45515||45517<=b&&b<=45543||45545<=b&&b<=45571||45573<=b&&b<=45599||45601<=b&&b<=45627||45629<=b&&b<=45655||45657<=b&&b<=45683||45685<=b&&b<=45711||45713<=b&&b<=45739||45741<=b&&b<=45767||45769<=b&&b<=45795||45797<=b&&b<=45823||45825<=b&&b<=45851||45853<=b&&b<=45879||45881<=b&&b<=45907||45909<=b&&b<=45935||45937<=b&&b<=45963||45965<=b&&b<=45991||45993<=b&&b<=46019||46021<=b&&b<=46047||46049<=b&&b<=46075||46077<=b&&b<=46103||46105<=b&&b<=46131||46133<=b&&b<=46159||46161<=b&&b<=46187||46189<=b&&b<=46215||46217<=b&&b<=46243||46245<=b&&b<=46271||46273<=b&&b<=46299||46301<=b&&b<=46327||46329<=b&&b<=46355||46357<=b&&b<=46383||46385<=b&&b<=46411||46413<=b&&b<=46439||46441<=b&&b<=46467||46469<=b&&b<=46495||46497<=b&&b<=46523||46525<=b&&b<=46551||46553<=b&&b<=46579||46581<=b&&b<=46607||46609<=b&&b<=46635||46637<=b&&b<=46663||46665<=b&&b<=46691||46693<=b&&b<=46719||46721<=b&&b<=46747||46749<=b&&b<=46775||46777<=b&&b<=46803||46805<=b&&b<=46831||46833<=b&&b<=46859||46861<=b&&b<=46887||46889<=b&&b<=46915||46917<=b&&b<=46943||46945<=b&&b<=46971||46973<=b&&b<=46999||47001<=b&&b<=47027||47029<=b&&b<=47055||47057<=b&&b<=47083||47085<=b&&b<=47111||47113<=b&&b<=47139||47141<=b&&b<=47167||47169<=b&&b<=47195||47197<=b&&b<=47223||47225<=b&&b<=47251||47253<=b&&b<=47279||47281<=b&&b<=47307||47309<=b&&b<=47335||47337<=b&&b<=47363||47365<=b&&b<=47391||47393<=b&&b<=47419||47421<=b&&b<=47447||47449<=b&&b<=47475||47477<=b&&b<=47503||47505<=b&&b<=47531||47533<=b&&b<=47559||47561<=b&&b<=47587||47589<=b&&b<=47615||47617<=b&&b<=47643||47645<=b&&b<=47671||47673<=b&&b<=47699||47701<=b&&b<=47727||47729<=b&&b<=47755||47757<=b&&b<=47783||47785<=b&&b<=47811||47813<=b&&b<=47839||47841<=b&&b<=47867||47869<=b&&b<=47895||47897<=b&&b<=47923||47925<=b&&b<=47951||47953<=b&&b<=47979||47981<=b&&b<=48007||48009<=b&&b<=48035||48037<=b&&b<=48063||48065<=b&&b<=48091||48093<=b&&b<=48119||48121<=b&&b<=48147||48149<=b&&b<=48175||48177<=b&&b<=48203||48205<=b&&b<=48231||48233<=b&&b<=48259||48261<=b&&b<=48287||48289<=b&&b<=48315||48317<=b&&b<=48343||48345<=b&&b<=48371||48373<=b&&b<=48399||48401<=b&&b<=48427||48429<=b&&b<=48455||48457<=b&&b<=48483||48485<=b&&b<=48511||48513<=b&&b<=48539||48541<=b&&b<=48567||48569<=b&&b<=48595||48597<=b&&b<=48623||48625<=b&&b<=48651||48653<=b&&b<=48679||48681<=b&&b<=48707||48709<=b&&b<=48735||48737<=b&&b<=48763||48765<=b&&b<=48791||48793<=b&&b<=48819||48821<=b&&b<=48847||48849<=b&&b<=48875||48877<=b&&b<=48903||48905<=b&&b<=48931||48933<=b&&b<=48959||48961<=b&&b<=48987||48989<=b&&b<=49015||49017<=b&&b<=49043||49045<=b&&b<=49071||49073<=b&&b<=49099||49101<=b&&b<=49127||49129<=b&&b<=49155||49157<=b&&b<=49183||49185<=b&&b<=49211||49213<=b&&b<=49239||49241<=b&&b<=49267||49269<=b&&b<=49295||49297<=b&&b<=49323||49325<=b&&b<=49351||49353<=b&&b<=49379||49381<=b&&b<=49407||49409<=b&&b<=49435||49437<=b&&b<=49463||49465<=b&&b<=49491||49493<=b&&b<=49519||49521<=b&&b<=49547||49549<=b&&b<=49575||49577<=b&&b<=49603||49605<=b&&b<=49631||49633<=b&&b<=49659||49661<=b&&b<=49687||49689<=b&&b<=49715||49717<=b&&b<=49743||49745<=b&&b<=49771||49773<=b&&b<=49799||49801<=b&&b<=49827||49829<=b&&b<=49855||49857<=b&&b<=49883||49885<=b&&b<=49911||49913<=b&&b<=49939||49941<=b&&b<=49967||49969<=b&&b<=49995||49997<=b&&b<=50023||50025<=b&&b<=50051||50053<=b&&b<=50079||50081<=b&&b<=50107||50109<=b&&b<=50135||50137<=b&&b<=50163||50165<=b&&b<=50191||50193<=b&&b<=50219||50221<=b&&b<=50247||50249<=b&&b<=50275||50277<=b&&b<=50303||50305<=b&&b<=50331||50333<=b&&b<=50359||50361<=b&&b<=50387||50389<=b&&b<=50415||50417<=b&&b<=50443||50445<=b&&b<=50471||50473<=b&&b<=50499||50501<=b&&b<=50527||50529<=b&&b<=50555||50557<=b&&b<=50583||50585<=b&&b<=50611||50613<=b&&b<=50639||50641<=b&&b<=50667||50669<=b&&b<=50695||50697<=b&&b<=50723||50725<=b&&b<=50751||50753<=b&&b<=50779||50781<=b&&b<=50807||50809<=b&&b<=50835||50837<=b&&b<=50863||50865<=b&&b<=50891||50893<=b&&b<=50919||50921<=b&&b<=50947||50949<=b&&b<=50975||50977<=b&&b<=51003||51005<=b&&b<=51031||51033<=b&&b<=51059||51061<=b&&b<=51087||51089<=b&&b<=51115||51117<=b&&b<=51143||51145<=b&&b<=51171||51173<=b&&b<=51199||51201<=b&&b<=51227||51229<=b&&b<=51255||51257<=b&&b<=51283||51285<=b&&b<=51311||51313<=b&&b<=51339||51341<=b&&b<=51367||51369<=b&&b<=51395||51397<=b&&b<=51423||51425<=b&&b<=51451||51453<=b&&b<=51479||51481<=b&&b<=51507||51509<=b&&b<=51535||51537<=b&&b<=51563||51565<=b&&b<=51591||51593<=b&&b<=51619||51621<=b&&b<=51647||51649<=b&&b<=51675||51677<=b&&b<=51703||51705<=b&&b<=51731||51733<=b&&b<=51759||51761<=b&&b<=51787||51789<=b&&b<=51815||51817<=b&&b<=51843||51845<=b&&b<=51871||51873<=b&&b<=51899||51901<=b&&b<=51927||51929<=b&&b<=51955||51957<=b&&b<=51983||51985<=b&&b<=52011||52013<=b&&b<=52039||52041<=b&&b<=52067||52069<=b&&b<=52095||52097<=b&&b<=52123||52125<=b&&b<=52151||52153<=b&&b<=52179||52181<=b&&b<=52207||52209<=b&&b<=52235||52237<=b&&b<=52263||52265<=b&&b<=52291||52293<=b&&b<=52319||52321<=b&&b<=52347||52349<=b&&b<=52375||52377<=b&&b<=52403||52405<=b&&b<=52431||52433<=b&&b<=52459||52461<=b&&b<=52487||52489<=b&&b<=52515||52517<=b&&b<=52543||52545<=b&&b<=52571||52573<=b&&b<=52599||52601<=b&&b<=52627||52629<=b&&b<=52655||52657<=b&&b<=52683||52685<=b&&b<=52711||52713<=b&&b<=52739||52741<=b&&b<=52767||52769<=b&&b<=52795||52797<=b&&b<=52823||52825<=b&&b<=52851||52853<=b&&b<=52879||52881<=b&&b<=52907||52909<=b&&b<=52935||52937<=b&&b<=52963||52965<=b&&b<=52991||52993<=b&&b<=53019||53021<=b&&b<=53047||53049<=b&&b<=53075||53077<=b&&b<=53103||53105<=b&&b<=53131||53133<=b&&b<=53159||53161<=b&&b<=53187||53189<=b&&b<=53215||53217<=b&&b<=53243||53245<=b&&b<=53271||53273<=b&&b<=53299||53301<=b&&b<=53327||53329<=b&&b<=53355||53357<=b&&b<=53383||53385<=b&&b<=53411||53413<=b&&b<=53439||53441<=b&&b<=53467||53469<=b&&b<=53495||53497<=b&&b<=53523||53525<=b&&b<=53551||53553<=b&&b<=53579||53581<=b&&b<=53607||53609<=b&&b<=53635||53637<=b&&b<=53663||53665<=b&&b<=53691||53693<=b&&b<=53719||53721<=b&&b<=53747||53749<=b&&b<=53775||53777<=b&&b<=53803||53805<=b&&b<=53831||53833<=b&&b<=53859||53861<=b&&b<=53887||53889<=b&&b<=53915||53917<=b&&b<=53943||53945<=b&&b<=53971||53973<=b&&b<=53999||54001<=b&&b<=54027||54029<=b&&b<=54055||54057<=b&&b<=54083||54085<=b&&b<=54111||54113<=b&&b<=54139||54141<=b&&b<=54167||54169<=b&&b<=54195||54197<=b&&b<=54223||54225<=b&&b<=54251||54253<=b&&b<=54279||54281<=b&&b<=54307||54309<=b&&b<=54335||54337<=b&&b<=54363||54365<=b&&b<=54391||54393<=b&&b<=54419||54421<=b&&b<=54447||54449<=b&&b<=54475||54477<=b&&b<=54503||54505<=b&&b<=54531||54533<=b&&b<=54559||54561<=b&&b<=54587||54589<=b&&b<=54615||54617<=b&&b<=54643||54645<=b&&b<=54671||54673<=b&&b<=54699||54701<=b&&b<=54727||54729<=b&&b<=54755||54757<=b&&b<=54783||54785<=b&&b<=54811||54813<=b&&b<=54839||54841<=b&&b<=54867||54869<=b&&b<=54895||54897<=b&&b<=54923||54925<=b&&b<=54951||54953<=b&&b<=54979||54981<=b&&b<=55007||55009<=b&&b<=55035||55037<=b&&b<=55063||55065<=b&&b<=55091||55093<=b&&b<=55119||55121<=b&&b<=55147||55149<=b&&b<=55175||55177<=b&&b<=55203?u:b==9757||b==9977||9994<=b&&b<=9997||b==127877||127938<=b&&b<=127940||b==127943||127946<=b&&b<=127948||128066<=b&&b<=128067||128070<=b&&b<=128080||b==128110||128112<=b&&b<=128120||b==128124||128129<=b&&b<=128131||128133<=b&&b<=128135||b==128170||128372<=b&&b<=128373||b==128378||b==128400||128405<=b&&b<=128406||128581<=b&&b<=128583||128587<=b&&b<=128591||b==128675||128692<=b&&b<=128694||b==128704||b==128716||129304<=b&&b<=129308||129310<=b&&b<=129311||b==129318||129328<=b&&b<=129337||129341<=b&&b<=129342||129489<=b&&b<=129501?y:127995<=b&&b<=127999?h:b==8205?g:b==9792||b==9794||9877<=b&&b<=9878||b==9992||b==10084||b==127752||b==127806||b==127859||b==127891||b==127908||b==127912||b==127979||b==127981||b==128139||128187<=b&&b<=128188||b==128295||b==128300||b==128488||b==128640||b==128658?x:128102<=b&&b<=128105?S:f}return this}typeof bk<"u"&&bk.exports&&(bk.exports=CKe)});var she=ad((NJ,kJ)=>{var Jhi=_(T());(function(e,t){typeof NJ=="object"&&typeof kJ<"u"?kJ.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(NJ,function(){"use strict";function e(x,S,V,Z,R){(function E(I,v,P,F,N){for(;F>P;){if(F-P>600){var b=F-P+1,G=v-P+1,X=Math.log(b),W=.5*Math.exp(2*X/3),A=.5*Math.sqrt(X*W*(b-W)/b)*(G-b/2<0?-1:1),k=Math.max(P,Math.floor(v-G*W/b+A)),B=Math.min(F,Math.floor(v+(b-G)*W/b+A));E(I,v,k,B,N)}var O=I[v],H=P,U=F;for(t(I,P,v),N(I[F],O)>0&&t(I,P,F);H<U;){for(t(I,H,U),H++,U--;N(I[H],O)<0;)H++;for(;N(I[U],O)>0;)U--}N(I[P],O)===0?t(I,P,U):t(I,++U,F),U<=v&&(P=U+1),v<=U&&(F=U-1)}})(x,S,V||0,Z||x.length-1,R||n)}function t(x,S,V){var Z=x[S];x[S]=x[V],x[V]=Z}function n(x,S){return x<S?-1:x>S?1:0}var i=function(x){x===void 0&&(x=9),this._maxEntries=Math.max(4,x),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(x,S,V){if(!V)return S.indexOf(x);for(var Z=0;Z<S.length;Z++)if(V(x,S[Z]))return Z;return-1}function r(x,S){s(x,0,x.children.length,S,x)}function s(x,S,V,Z,R){R||(R=h(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var E=S;E<V;E++){var I=x.children[E];a(R,x.leaf?Z(I):I)}return R}function a(x,S){return x.minX=Math.min(x.minX,S.minX),x.minY=Math.min(x.minY,S.minY),x.maxX=Math.max(x.maxX,S.maxX),x.maxY=Math.max(x.maxY,S.maxY),x}function l(x,S){return x.minX-S.minX}function d(x,S){return x.minY-S.minY}function u(x){return(x.maxX-x.minX)*(x.maxY-x.minY)}function f(x){return x.maxX-x.minX+(x.maxY-x.minY)}function p(x,S){return x.minX<=S.minX&&x.minY<=S.minY&&S.maxX<=x.maxX&&S.maxY<=x.maxY}function y(x,S){return S.minX<=x.maxX&&S.minY<=x.maxY&&S.maxX>=x.minX&&S.maxY>=x.minY}function h(x){return{children:x,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(x,S,V,Z,R){for(var E=[S,V];E.length;)if(!((V=E.pop())-(S=E.pop())<=Z)){var I=S+Math.ceil((V-S)/Z/2)*Z;e(x,I,S,V,R),E.push(S,I,I,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(x){var S=this.data,V=[];if(!y(x,S))return V;for(var Z=this.toBBox,R=[];S;){for(var E=0;E<S.children.length;E++){var I=S.children[E],v=S.leaf?Z(I):I;y(x,v)&&(S.leaf?V.push(I):p(x,v)?this._all(I,V):R.push(I))}S=R.pop()}return V},i.prototype.collides=function(x){var S=this.data;if(!y(x,S))return!1;for(var V=[];S;){for(var Z=0;Z<S.children.length;Z++){var R=S.children[Z],E=S.leaf?this.toBBox(R):R;if(y(x,E)){if(S.leaf||p(x,E))return!0;V.push(R)}}S=V.pop()}return!1},i.prototype.load=function(x){if(!x||!x.length)return this;if(x.length<this._minEntries){for(var S=0;S<x.length;S++)this.insert(x[S]);return this}var V=this._build(x.slice(),0,x.length-1,0);if(this.data.children.length)if(this.data.height===V.height)this._splitRoot(this.data,V);else{if(this.data.height<V.height){var Z=this.data;this.data=V,V=Z}this._insert(V,this.data.height-V.height-1,!0)}else this.data=V;return this},i.prototype.insert=function(x){return x&&this._insert(x,this.data.height-1),this},i.prototype.clear=function(){return this.data=h([]),this},i.prototype.remove=function(x,S){if(!x)return this;for(var V,Z,R,E=this.data,I=this.toBBox(x),v=[],P=[];E||v.length;){if(E||(E=v.pop(),Z=v[v.length-1],V=P.pop(),R=!0),E.leaf){var F=o(x,E.children,S);if(F!==-1)return E.children.splice(F,1),v.push(E),this._condense(v),this}R||E.leaf||!p(E,I)?Z?(V++,E=Z.children[V],R=!1):E=null:(v.push(E),P.push(V),V=0,Z=E,E=E.children[0])}return this},i.prototype.toBBox=function(x){return x},i.prototype.compareMinX=function(x,S){return x.minX-S.minX},i.prototype.compareMinY=function(x,S){return x.minY-S.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(x){return this.data=x,this},i.prototype._all=function(x,S){for(var V=[];x;)x.leaf?S.push.apply(S,x.children):V.push.apply(V,x.children),x=V.pop();return S},i.prototype._build=function(x,S,V,Z){var R,E=V-S+1,I=this._maxEntries;if(E<=I)return r(R=h(x.slice(S,V+1)),this.toBBox),R;Z||(Z=Math.ceil(Math.log(E)/Math.log(I)),I=Math.ceil(E/Math.pow(I,Z-1))),(R=h([])).leaf=!1,R.height=Z;var v=Math.ceil(E/I),P=v*Math.ceil(Math.sqrt(I));g(x,S,V,P,this.compareMinX);for(var F=S;F<=V;F+=P){var N=Math.min(F+P-1,V);g(x,F,N,v,this.compareMinY);for(var b=F;b<=N;b+=v){var G=Math.min(b+v-1,N);R.children.push(this._build(x,b,G,Z-1))}}return r(R,this.toBBox),R},i.prototype._chooseSubtree=function(x,S,V,Z){for(;Z.push(S),!S.leaf&&Z.length-1!==V;){for(var R=1/0,E=1/0,I=void 0,v=0;v<S.children.length;v++){var P=S.children[v],F=u(P),N=(b=x,G=P,(Math.max(G.maxX,b.maxX)-Math.min(G.minX,b.minX))*(Math.max(G.maxY,b.maxY)-Math.min(G.minY,b.minY))-F);N<E?(E=N,R=F<R?F:R,I=P):N===E&&F<R&&(R=F,I=P)}S=I||S.children[0]}var b,G;return S},i.prototype._insert=function(x,S,V){var Z=V?x:this.toBBox(x),R=[],E=this._chooseSubtree(Z,this.data,S,R);for(E.children.push(x),a(E,Z);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(Z,R,S)},i.prototype._split=function(x,S){var V=x[S],Z=V.children.length,R=this._minEntries;this._chooseSplitAxis(V,R,Z);var E=this._chooseSplitIndex(V,R,Z),I=h(V.children.splice(E,V.children.length-E));I.height=V.height,I.leaf=V.leaf,r(V,this.toBBox),r(I,this.toBBox),S?x[S-1].children.push(I):this._splitRoot(V,I)},i.prototype._splitRoot=function(x,S){this.data=h([x,S]),this.data.height=x.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(x,S,V){for(var Z,R,E,I,v,P,F,N=1/0,b=1/0,G=S;G<=V-S;G++){var X=s(x,0,G,this.toBBox),W=s(x,G,V,this.toBBox),A=(R=X,E=W,I=void 0,v=void 0,P=void 0,F=void 0,I=Math.max(R.minX,E.minX),v=Math.max(R.minY,E.minY),P=Math.min(R.maxX,E.maxX),F=Math.min(R.maxY,E.maxY),Math.max(0,P-I)*Math.max(0,F-v)),k=u(X)+u(W);A<N?(N=A,Z=G,b=k<b?k:b):A===N&&k<b&&(b=k,Z=G)}return Z||V-S},i.prototype._chooseSplitAxis=function(x,S,V){var Z=x.leaf?this.compareMinX:l,R=x.leaf?this.compareMinY:d;this._allDistMargin(x,S,V,Z)<this._allDistMargin(x,S,V,R)&&x.children.sort(Z)},i.prototype._allDistMargin=function(x,S,V,Z){x.children.sort(Z);for(var R=this.toBBox,E=s(x,0,S,R),I=s(x,V-S,V,R),v=f(E)+f(I),P=S;P<V-S;P++){var F=x.children[P];a(E,x.leaf?R(F):F),v+=f(E)}for(var N=V-S-1;N>=S;N--){var b=x.children[N];a(I,x.leaf?R(b):b),v+=f(I)}return v},i.prototype._adjustParentBBoxes=function(x,S,V){for(var Z=V;Z>=0;Z--)a(S[Z],x)},i.prototype._condense=function(x){for(var S=x.length-1,V=void 0;S>=0;S--)x[S].children.length===0?S>0?(V=x[S-1].children).splice(V.indexOf(x[S]),1):this.clear():r(x[S],this.toBBox)},i})});var _7=ad((exports,module)=>{var _io=_(T());/*!
 * protobuf.js v7.4.0 (c) 2016, daniel wirtz
 * compiled thu, 22 aug 2024 20:30:39 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,l=2,d=!0;l<arguments.length;)s[a++]=arguments[l++];return new Promise(function(f,p){s[a]=function(h){if(d)if(d=!1,h)p(h);else{for(var g=new Array(arguments.length-1),x=0;x<g.length;)g[x++]=arguments[x];f.apply(null,g)}};try{o.apply(r||null,s)}catch(y){d&&(d=!1,p(y))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(d){var u=d.length;if(!u)return 0;for(var f=0;--u%4>1&&d.charAt(u)==="=";)++f;return Math.ceil(d.length*3)/4-f};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,f){for(var p=null,y=[],h=0,g=0,x;u<f;){var S=d[u++];switch(g){case 0:y[h++]=o[S>>2],x=(S&3)<<4,g=1;break;case 1:y[h++]=o[x|S>>4],x=(S&15)<<2,g=2;break;case 2:y[h++]=o[x|S>>6],y[h++]=o[S&63],g=0;break}h>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,y)),h=0)}return g&&(y[h++]=o[x],y[h++]=61,g===1&&(y[h++]=61)),p?(h&&p.push(String.fromCharCode.apply(String,y.slice(0,h))),p.join("")):String.fromCharCode.apply(String,y.slice(0,h))};var a="invalid encoding";i.decode=function(d,u,f){for(var p=f,y=0,h,g=0;g<d.length;){var x=d.charCodeAt(g++);if(x===61&&y>1)break;if((x=r[x])===undefined)throw Error(a);switch(y){case 0:h=x,y=1;break;case 1:u[f++]=h<<2|(x&48)>>4,h=x,y=2;break;case 2:u[f++]=(h&15)<<4|(x&60)>>2,h=x,y=3;break;case 3:u[f++]=(h&3)<<6|x,y=0;break}}if(y===1)throw Error(a);return f-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],l=0;l<a.length;)a[l].fn===s?a.splice(l,1):++l;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],l=1;l<arguments.length;)a.push(arguments[l++]);for(l=0;l<s.length;)s[l].fn.apply(s[l++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(l){return typeof Float32Array<"u"?function(){var d=new Float32Array([-0]),u=new Uint8Array(d.buffer),f=u[3]===128;function p(x,S,V){d[0]=x,S[V]=u[0],S[V+1]=u[1],S[V+2]=u[2],S[V+3]=u[3]}function y(x,S,V){d[0]=x,S[V]=u[3],S[V+1]=u[2],S[V+2]=u[1],S[V+3]=u[0]}l.writeFloatLE=f?p:y,l.writeFloatBE=f?y:p;function h(x,S){return u[0]=x[S],u[1]=x[S+1],u[2]=x[S+2],u[3]=x[S+3],d[0]}function g(x,S){return u[3]=x[S],u[2]=x[S+1],u[1]=x[S+2],u[0]=x[S+3],d[0]}l.readFloatLE=f?h:g,l.readFloatBE=f?g:h}():function(){function d(f,p,y,h){var g=p<0?1:0;if(g&&(p=-p),p===0)f(1/p>0?0:2147483648,y,h);else if(isNaN(p))f(2143289344,y,h);else if(p>34028234663852886e22)f((g<<31|2139095040)>>>0,y,h);else if(p<11754943508222875e-54)f((g<<31|Math.round(p/1401298464324817e-60))>>>0,y,h);else{var x=Math.floor(Math.log(p)/Math.LN2),S=Math.round(p*Math.pow(2,-x)*8388608)&8388607;f((g<<31|x+127<<23|S)>>>0,y,h)}}l.writeFloatLE=d.bind(null,o),l.writeFloatBE=d.bind(null,r);function u(f,p,y){var h=f(p,y),g=(h>>31)*2+1,x=h>>>23&255,S=h&8388607;return x===255?S?NaN:g*(1/0):x===0?g*1401298464324817e-60*S:g*Math.pow(2,x-150)*(S+8388608)}l.readFloatLE=u.bind(null,s),l.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),f=u[7]===128;function p(x,S,V){d[0]=x,S[V]=u[0],S[V+1]=u[1],S[V+2]=u[2],S[V+3]=u[3],S[V+4]=u[4],S[V+5]=u[5],S[V+6]=u[6],S[V+7]=u[7]}function y(x,S,V){d[0]=x,S[V]=u[7],S[V+1]=u[6],S[V+2]=u[5],S[V+3]=u[4],S[V+4]=u[3],S[V+5]=u[2],S[V+6]=u[1],S[V+7]=u[0]}l.writeDoubleLE=f?p:y,l.writeDoubleBE=f?y:p;function h(x,S){return u[0]=x[S],u[1]=x[S+1],u[2]=x[S+2],u[3]=x[S+3],u[4]=x[S+4],u[5]=x[S+5],u[6]=x[S+6],u[7]=x[S+7],d[0]}function g(x,S){return u[7]=x[S],u[6]=x[S+1],u[5]=x[S+2],u[4]=x[S+3],u[3]=x[S+4],u[2]=x[S+5],u[1]=x[S+6],u[0]=x[S+7],d[0]}l.readDoubleLE=f?h:g,l.readDoubleBE=f?g:h}():function(){function d(f,p,y,h,g,x){var S=h<0?1:0;if(S&&(h=-h),h===0)f(0,g,x+p),f(1/h>0?0:2147483648,g,x+y);else if(isNaN(h))f(0,g,x+p),f(2146959360,g,x+y);else if(h>17976931348623157e292)f(0,g,x+p),f((S<<31|2146435072)>>>0,g,x+y);else{var V;if(h<22250738585072014e-324)V=h/5e-324,f(V>>>0,g,x+p),f((S<<31|V/4294967296)>>>0,g,x+y);else{var Z=Math.floor(Math.log(h)/Math.LN2);Z===1024&&(Z=1023),V=h*Math.pow(2,-Z),f(V*4503599627370496>>>0,g,x+p),f((S<<31|Z+1023<<20|V*1048576&1048575)>>>0,g,x+y)}}}l.writeDoubleLE=d.bind(null,o,0,4),l.writeDoubleBE=d.bind(null,r,4,0);function u(f,p,y,h,g){var x=f(h,g+p),S=f(h,g+y),V=(S>>31)*2+1,Z=S>>>20&2047,R=4294967296*(S&1048575)+x;return Z===2047?R?NaN:V*(1/0):Z===0?V*5e-324*R:V*Math.pow(2,Z-1075)*(R+4503599627370496)}l.readDoubleLE=u.bind(null,s,0,4),l.readDoubleBE=u.bind(null,a,4,0)}(),l}function o(l,d,u){d[u]=l&255,d[u+1]=l>>>8&255,d[u+2]=l>>>16&255,d[u+3]=l>>>24}function r(l,d,u){d[u]=l>>>24,d[u+1]=l>>>16&255,d[u+2]=l>>>8&255,d[u+3]=l&255}function s(l,d){return(l[d]|l[d+1]<<8|l[d+2]<<16|l[d+3]<<24)>>>0}function a(l,d){return(l[d]<<24|l[d+1]<<16|l[d+2]<<8|l[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,l=a>>>1,d=null,u=a;return function(p){if(p<1||p>l)return o(p);u+p>a&&(d=o(a),u=0);var y=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),y}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,l=0;l<r.length;++l)a=r.charCodeAt(l),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(l+1)&64512)===56320?(++l,s+=4):s+=3;return s},i.read=function(r,s,a){var l=a-s;if(l<1)return"";for(var d=null,u=[],f=0,p;s<a;)p=r[s++],p<128?u[f++]=p:p>191&&p<224?u[f++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[f++]=55296+(p>>10),u[f++]=56320+(p&1023)):u[f++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,f>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),f=0);return d?(f&&d.push(String.fromCharCode.apply(String,u.slice(0,f))),d.join("")):String.fromCharCode.apply(String,u.slice(0,f))},i.write=function(r,s,a){for(var l=a,d,u,f=0;f<r.length;++f)d=r.charCodeAt(f),d<128?s[a++]=d:d<2048?(s[a++]=d>>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(f+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++f,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-l}},{}],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=l;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(h,g){return RangeError("index out of range: "+h.pos+" + "+(g||1)+" > "+h.len)}function l(h){this.buf=h,this.pos=0,this.len=h.length}var d=typeof Uint8Array<"u"?function(g){if(g instanceof Uint8Array||Array.isArray(g))return new l(g);throw Error("illegal buffer")}:function(g){if(Array.isArray(g))return new l(g);throw Error("illegal buffer")},u=function(){return i.Buffer?function(x){return(l.create=function(V){return i.Buffer.isBuffer(V)?new o(V):d(V)})(x)}:d};l.create=u(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=function(){var g=4294967295;return function(){if(g=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(g=(g|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(g=(g|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(g=(g|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(g=(g|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return g;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return g}}(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var g=this.uint32();return g>>>1^-(g&1)|0};function f(){var h=new r(0,0),g=0;if(this.len-this.pos>4){for(;g<4;++g)if(h.lo=(h.lo|(this.buf[this.pos]&127)<<g*7)>>>0,this.buf[this.pos++]<128)return h;if(h.lo=(h.lo|(this.buf[this.pos]&127)<<28)>>>0,h.hi=(h.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return h;g=0}else{for(;g<3;++g){if(this.pos>=this.len)throw a(this);if(h.lo=(h.lo|(this.buf[this.pos]&127)<<g*7)>>>0,this.buf[this.pos++]<128)return h}return h.lo=(h.lo|(this.buf[this.pos++]&127)<<g*7)>>>0,h}if(this.len-this.pos>4){for(;g<5;++g)if(h.hi=(h.hi|(this.buf[this.pos]&127)<<g*7+3)>>>0,this.buf[this.pos++]<128)return h}else for(;g<5;++g){if(this.pos>=this.len)throw a(this);if(h.hi=(h.hi|(this.buf[this.pos]&127)<<g*7+3)>>>0,this.buf[this.pos++]<128)return h}throw Error("invalid varint encoding")}l.prototype.bool=function(){return this.uint32()!==0};function p(h,g){return(h[g-4]|h[g-3]<<8|h[g-2]<<16|h[g-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var g=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,g},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var g=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,g},l.prototype.bytes=function(){var g=this.uint32(),x=this.pos,S=this.pos+g;if(S>this.len)throw a(this,g);if(this.pos+=g,Array.isArray(this.buf))return this.buf.slice(x,S);if(x===S){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,x,S)},l.prototype.string=function(){var g=this.bytes();return s.read(g,0,g.length)},l.prototype.skip=function(g){if(typeof g=="number"){if(this.pos+g>this.len)throw a(this,g);this.pos+=g}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},l.prototype.skipType=function(h){switch(h){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(h=this.uint32()&7)!==4;)this.skipType(h);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+h+" at offset "+this.pos)}return this},l._configure=function(h){o=h,l.create=u(),o._configure();var g=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return f.call(this)[g](!1)},uint64:function(){return f.call(this)[g](!0)},sint64:function(){return f.call(this).zzDecode()[g](!1)},fixed64:function(){return y.call(this)[g](!0)},sfixed64:function(){return y.call(this)[g](!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,l,d,u){if(!d)throw TypeError("request must be specified");var f=this;if(!u)return i.asPromise(r,f,s,a,l,d);if(!f.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return f.rpcImpl(s,a[f.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(y,h){if(y)return f.emit("error",y,s),u(y);if(h===null)return f.end(!0),undefined;if(!(h instanceof l))try{h=l[f.responseDelimited?"decodeDelimited":"decode"](h)}catch(g){return f.emit("error",g,s),u(g)}return f.emit("data",h,s),u(null,h)})}catch(p){return f.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(l,d){this.lo=l>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var f=d>>>0,p=(d-f)/4294967296>>>0;return u&&(p=~p>>>0,f=~f>>>0,++f>4294967295&&(f=0,++p>4294967295&&(p=0))),new o(f,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,f=~this.hi>>>0;return u||(f=f+1>>>0),-(u+f*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,f=this.hi>>>24;return f===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:f<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,l){var d=a[l];return d!=null&&a.hasOwnProperty(l)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,l){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,l):d.toNumber(!!l)};function o(s,a,l){for(var d=Object.keys(a),u=0;u<d.length;++u)(s[d[u]]===undefined||!l)&&(s[d[u]]=a[d[u]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(l,d){if(!(this instanceof a))return new a(l,d);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&o(this,d)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var l={},d=0;d<a.length;++d)l[a[d]]=1;return function(){for(var u=Object.keys(this),f=u.length-1;f>-1;--f)if(l[u[f]]===1&&this[u[f]]!==undefined&&this[u[f]]!==null)return u[f]}},i.oneOfSetter=function(a){return function(l){for(var d=0;d<a.length;++d)a[d]!==l&&delete this[a[d]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(l,d){return new s(l,d)},i._Buffer_allocUnsafe=s.allocUnsafe||function(l){return new s(l)}}},{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=f;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function l(Z,R,E){this.fn=Z,this.len=R,this.next=undefined,this.val=E}function d(){}function u(Z){this.head=Z.head,this.tail=Z.tail,this.len=Z.len,this.next=Z.states}function f(){this.len=0,this.head=new l(d,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(f.create=function(){return new o})()}:function(){return new f}};f.create=p(),f.alloc=function(R){return new i.Array(R)},i.Array!==Array&&(f.alloc=i.pool(f.alloc,i.Array.prototype.subarray)),f.prototype._push=function(R,E,I){return this.tail=this.tail.next=new l(R,E,I),this.len+=E,this};function y(Z,R,E){R[E]=Z&255}function h(Z,R,E){for(;Z>127;)R[E++]=Z&127|128,Z>>>=7;R[E]=Z}function g(Z,R){this.len=Z,this.next=undefined,this.val=R}g.prototype=Object.create(l.prototype),g.prototype.fn=h,f.prototype.uint32=function(R){return this.len+=(this.tail=this.tail.next=new g((R=R>>>0)<128?1:R<16384?2:R<2097152?3:R<268435456?4:5,R)).len,this},f.prototype.int32=function(R){return R<0?this._push(x,10,r.fromNumber(R)):this.uint32(R)},f.prototype.sint32=function(R){return this.uint32((R<<1^R>>31)>>>0)};function x(Z,R,E){for(;Z.hi;)R[E++]=Z.lo&127|128,Z.lo=(Z.lo>>>7|Z.hi<<25)>>>0,Z.hi>>>=7;for(;Z.lo>127;)R[E++]=Z.lo&127|128,Z.lo=Z.lo>>>7;R[E++]=Z.lo}f.prototype.uint64=function(R){var E=r.from(R);return this._push(x,E.length(),E)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(R){var E=r.from(R).zzEncode();return this._push(x,E.length(),E)},f.prototype.bool=function(R){return this._push(y,1,R?1:0)};function S(Z,R,E){R[E]=Z&255,R[E+1]=Z>>>8&255,R[E+2]=Z>>>16&255,R[E+3]=Z>>>24}f.prototype.fixed32=function(R){return this._push(S,4,R>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(R){var E=r.from(R);return this._push(S,4,E.lo)._push(S,4,E.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(R){return this._push(i.float.writeFloatLE,4,R)},f.prototype.double=function(R){return this._push(i.float.writeDoubleLE,8,R)};var V=i.Array.prototype.set?function(R,E,I){E.set(R,I)}:function(R,E,I){for(var v=0;v<R.length;++v)E[I+v]=R[v]};f.prototype.bytes=function(R){var E=R.length>>>0;if(!E)return this._push(y,1,0);if(i.isString(R)){var I=f.alloc(E=s.length(R));s.decode(R,I,0),R=I}return this.uint32(E)._push(V,E,R)},f.prototype.string=function(R){var E=a.length(R);return E?this.uint32(E)._push(a.write,E,R):this._push(y,1,0)},f.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(d,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(d,0,0),this.len=0),this},f.prototype.ldelim=function(){var R=this.head,E=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=R.next,this.tail=E,this.len+=I),this},f.prototype.finish=function(){for(var R=this.head.next,E=this.constructor.alloc(this.len),I=0;R;)R.fn(R.val,E,I),I+=R.len,R=R.next;return E},f._configure=function(Z){o=Z,f.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(l,d,u){d.set(l,u)}:function(l,d,u){if(l.copy)l.copy(d,u,0,l.length);else for(var f=0;f<l.length;)d[u++]=l[f++]}},r.prototype.bytes=function(l){o.isString(l)&&(l=o._Buffer_from(l,"base64"));var d=l.length>>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,l),this};function s(a,l,d){a.length<40?o.utf8.write(a,l,d):l.utf8Write?l.utf8Write(a,d):l.write(a,d)}r.prototype.string=function(l){var d=o.Buffer.byteLength(l);return this.uint32(d),d&&this._push(s,d,l),this},r._configure()},{15:15,16:16}]},{},[8])})()});var pCe=ad((Wmo,_B)=>{var wmo=_(T());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,f){f=f||{};var p=f.encodedMaskData||f.encodedMaskData===null,y=l(u,f.inputOffset||0,p),h=f.noDataValue!==null?f.noDataValue:o.defaultNoDataValue,g=r(y,f.pixelType||Float32Array,f.encodedMaskData,h,f.returnMask),x={width:y.width,height:y.height,pixelData:g.resultPixels,minValue:g.minValue,maxValue:y.pixels.maxValue,noDataValue:h};return g.resultMask&&(x.maskData=g.resultMask),f.returnEncodedMask&&y.mask&&(x.encodedMaskData=y.mask.bitset?y.mask.bitset:null),f.returnFileInfo&&(x.fileInfo=s(y),f.computeUsedBitDepths&&(x.fileInfo.bitDepths=a(y))),x};var r=function(u,f,p,y,h){var g=0,x=u.pixels.numBlocksX,S=u.pixels.numBlocksY,V=Math.floor(u.width/x),Z=Math.floor(u.height/S),R=2*u.maxZError,E=Number.MAX_VALUE,I;p=p||(u.mask?u.mask.bitset:null);var v,P;v=new f(u.width*u.height),h&&p&&(P=new Uint8Array(u.width*u.height));for(var F=new Float32Array(V*Z),N,b,G=0;G<=S;G++){var X=G!==S?Z:u.height%S;if(X!==0)for(var W=0;W<=x;W++){var A=W!==x?V:u.width%x;if(A!==0){var k=G*u.width*Z+W*V,B=u.width-A,O=u.pixels.blocks[g],H,U,K;O.encoding<2?(O.encoding===0?H=O.rawData:(d(O.stuffedData,O.bitsPerPixel,O.numValidPixels,O.offset,R,F,u.pixels.maxValue),H=F),U=0):O.encoding===2?K=0:K=O.offset;var Q;if(p)for(b=0;b<X;b++){for(k&7&&(Q=p[k>>3],Q<<=k&7),N=0;N<A;N++)k&7||(Q=p[k>>3]),Q&128?(P&&(P[k]=1),I=O.encoding<2?H[U++]:K,E=E>I?I:E,v[k++]=I):(P&&(P[k]=0),v[k++]=y),Q<<=1;k+=B}else if(O.encoding<2)for(b=0;b<X;b++){for(N=0;N<A;N++)I=H[U++],E=E>I?I:E,v[k++]=I;k+=B}else for(E=E>K?K:E,b=0;b<X;b++){for(N=0;N<A;N++)v[k++]=K;k+=B}if(O.encoding===1&&U!==O.numValidPixels)throw"Block and Mask do not match";g++}}}return{resultPixels:v,resultMask:P,minValue:E}},s=function(u){return{fileIdentifierString:u.fileIdentifierString,fileVersion:u.fileVersion,imageType:u.imageType,height:u.height,width:u.width,maxZError:u.maxZError,eofOffset:u.eofOffset,mask:u.mask?{numBlocksX:u.mask.numBlocksX,numBlocksY:u.mask.numBlocksY,numBytes:u.mask.numBytes,maxValue:u.mask.maxValue}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,numBytes:u.pixels.numBytes,maxValue:u.pixels.maxValue,noDataValue:u.noDataValue}}},a=function(u){for(var f=u.pixels.numBlocksX*u.pixels.numBlocksY,p={},y=0;y<f;y++){var h=u.pixels.blocks[y];h.encoding===0?p.float32=!0:h.encoding===1?p[h.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},l=function(u,f,p){var y={},h=new Uint8Array(u,f,10);if(y.fileIdentifierString=String.fromCharCode.apply(null,h),y.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+y.fileIdentifierString;f+=10;var g=new DataView(u,f,24);if(y.fileVersion=g.getInt32(0,!0),y.imageType=g.getInt32(4,!0),y.height=g.getUint32(8,!0),y.width=g.getUint32(12,!0),y.maxZError=g.getFloat64(16,!0),f+=24,!p)if(g=new DataView(u,f,16),y.mask={},y.mask.numBlocksY=g.getUint32(0,!0),y.mask.numBlocksX=g.getUint32(4,!0),y.mask.numBytes=g.getUint32(8,!0),y.mask.maxValue=g.getFloat32(12,!0),f+=16,y.mask.numBytes>0){var x=new Uint8Array(Math.ceil(y.width*y.height/8));g=new DataView(u,f,y.mask.numBytes);var S=g.getInt16(0,!0),V=2,Z=0;do{if(S>0)for(;S--;)x[Z++]=g.getUint8(V++);else{var R=g.getUint8(V++);for(S=-S;S--;)x[Z++]=R}S=g.getInt16(V,!0),V+=2}while(V<y.mask.numBytes);if(S!==-32768||Z<x.length)throw"Unexpected end of mask RLE encoding";y.mask.bitset=x,f+=y.mask.numBytes}else y.mask.numBytes|y.mask.numBlocksY|y.mask.maxValue||(y.mask.bitset=new Uint8Array(Math.ceil(y.width*y.height/8)));g=new DataView(u,f,16),y.pixels={},y.pixels.numBlocksY=g.getUint32(0,!0),y.pixels.numBlocksX=g.getUint32(4,!0),y.pixels.numBytes=g.getUint32(8,!0),y.pixels.maxValue=g.getFloat32(12,!0),f+=16;var E=y.pixels.numBlocksX,I=y.pixels.numBlocksY,v=E+(y.width%E>0?1:0),P=I+(y.height%I>0?1:0);y.pixels.blocks=new Array(v*P);for(var F=0,N=0;N<P;N++)for(var b=0;b<v;b++){var G=0,X=u.byteLength-f;g=new DataView(u,f,Math.min(10,X));var W={};y.pixels.blocks[F++]=W;var A=g.getUint8(0);if(G++,W.encoding=A&63,W.encoding>3)throw"Invalid block encoding ("+W.encoding+")";if(W.encoding===2){f++;continue}if(A!==0&&A!==2){if(A>>=6,W.offsetType=A,A===2)W.offset=g.getInt8(1),G++;else if(A===1)W.offset=g.getInt16(1,!0),G+=2;else if(A===0)W.offset=g.getFloat32(1,!0),G+=4;else throw"Invalid block offset type";if(W.encoding===1)if(A=g.getUint8(G),G++,W.bitsPerPixel=A&63,A>>=6,W.numValidPixelsType=A,A===2)W.numValidPixels=g.getUint8(G),G++;else if(A===1)W.numValidPixels=g.getUint16(G,!0),G+=2;else if(A===0)W.numValidPixels=g.getUint32(G,!0),G+=4;else throw"Invalid valid pixel count type"}if(f+=G,W.encoding!==3){var k,B;if(W.encoding===0){var O=(y.pixels.numBytes-1)/4;if(O!==Math.floor(O))throw"uncompressed block has invalid length";k=new ArrayBuffer(O*4),B=new Uint8Array(k),B.set(new Uint8Array(u,f,O*4));var H=new Float32Array(k);W.rawData=H,f+=O*4}else if(W.encoding===1){var U=Math.ceil(W.numValidPixels*W.bitsPerPixel/8),K=Math.ceil(U/4);k=new ArrayBuffer(K*4),B=new Uint8Array(k),B.set(new Uint8Array(u,f,U)),W.stuffedData=new Uint32Array(k),f+=U}}}return y.eofOffset=f,y},d=function(u,f,p,y,h,g,x){var S=(1<<f)-1,V=0,Z,R=0,E,I,v=Math.ceil((x-y)/h),P=u.length*4-Math.ceil(f*p/8);for(u[u.length-1]<<=8*P,Z=0;Z<p;Z++){if(R===0&&(I=u[V++],R=32),R>=f)E=I>>>R-f&S,R-=f;else{var F=f-R;E=(I&S)<<F&S,I=u[V++],R=32-F,E+=I>>>R}g[Z]=E<v?y+E*h:x}return g};return o}(),t=function(){"use strict";var o={unstuff:function(l,d,u,f,p,y,h,g){var x=(1<<u)-1,S=0,V,Z=0,R,E,I,v,P=l.length*4-Math.ceil(u*f/8);if(l[l.length-1]<<=8*P,p)for(V=0;V<f;V++)Z===0&&(E=l[S++],Z=32),Z>=u?(R=E>>>Z-u&x,Z-=u):(I=u-Z,R=(E&x)<<I&x,E=l[S++],Z=32-I,R+=E>>>Z),d[V]=p[R];else for(v=Math.ceil((g-y)/h),V=0;V<f;V++)Z===0&&(E=l[S++],Z=32),Z>=u?(R=E>>>Z-u&x,Z-=u):(I=u-Z,R=(E&x)<<I&x,E=l[S++],Z=32-I,R+=E>>>Z),d[V]=R<v?y+R*h:g},unstuffLUT:function(l,d,u,f,p,y){var h=(1<<d)-1,g=0,x=0,S=0,V=0,Z=0,R,E=[],I=l.length*4-Math.ceil(d*u/8);l[l.length-1]<<=8*I;var v=Math.ceil((y-f)/p);for(x=0;x<u;x++)V===0&&(R=l[g++],V=32),V>=d?(Z=R>>>V-d&h,V-=d):(S=d-V,Z=(R&h)<<S&h,R=l[g++],V=32-S,Z+=R>>>V),E[x]=Z<v?f+Z*p:y;return E.unshift(f),E},unstuff2:function(l,d,u,f,p,y,h,g){var x=(1<<u)-1,S=0,V,Z=0,R=0,E,I,v;if(p)for(V=0;V<f;V++)Z===0&&(I=l[S++],Z=32,R=0),Z>=u?(E=I>>>R&x,Z-=u,R+=u):(v=u-Z,E=I>>>R&x,I=l[S++],Z=32-v,E|=(I&(1<<v)-1)<<u-v,R=v),d[V]=p[E];else{var P=Math.ceil((g-y)/h);for(V=0;V<f;V++)Z===0&&(I=l[S++],Z=32,R=0),Z>=u?(E=I>>>R&x,Z-=u,R+=u):(v=u-Z,E=I>>>R&x,I=l[S++],Z=32-v,E|=(I&(1<<v)-1)<<u-v,R=v),d[V]=E<P?y+E*h:g}return d},unstuffLUT2:function(l,d,u,f,p,y){var h=(1<<d)-1,g=0,x=0,S=0,V=0,Z=0,R=0,E,I=[],v=Math.ceil((y-f)/p);for(x=0;x<u;x++)V===0&&(E=l[g++],V=32,R=0),V>=d?(Z=E>>>R&h,V-=d,R+=d):(S=d-V,Z=E>>>R&h,E=l[g++],V=32-S,Z|=(E&(1<<S)-1)<<d-S,R=S),I[x]=Z<v?f+Z*p:y;return I.unshift(f),I},originalUnstuff:function(l,d,u,f){var p=(1<<u)-1,y=0,h,g=0,x,S,V,Z=l.length*4-Math.ceil(u*f/8);for(l[l.length-1]<<=8*Z,h=0;h<f;h++)g===0&&(S=l[y++],g=32),g>=u?(x=S>>>g-u&p,g-=u):(V=u-g,x=(S&p)<<V&p,S=l[y++],g=32-V,x+=S>>>g),d[h]=x;return d},originalUnstuff2:function(l,d,u,f){var p=(1<<u)-1,y=0,h,g=0,x=0,S,V,Z;for(h=0;h<f;h++)g===0&&(V=l[y++],g=32,x=0),g>=u?(S=V>>>x&p,g-=u,x+=u):(Z=u-g,S=V>>>x&p,V=l[y++],g=32-Z,S|=(V&(1<<Z)-1)<<u-Z,x=Z),d[h]=S;return d}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(l){for(var d=65535,u=65535,f=l.length,p=Math.floor(f/2),y=0;p;){var h=p>=359?359:p;p-=h;do d+=l[y++]<<8,u+=d+=l[y++];while(--h);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return f&1&&(u+=d+=l[y]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(l,d){var u=d.ptr,f=new Uint8Array(l,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,f),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var y=new DataView(l,u,8),h=y.getInt32(0,!0);p.fileVersion=h,u+=4,h>=3&&(p.checksum=y.getUint32(4,!0),u+=4),y=new DataView(l,u,12),p.height=y.getUint32(0,!0),p.width=y.getUint32(4,!0),u+=8,h>=4?(p.numDims=y.getUint32(8,!0),u+=4):p.numDims=1,y=new DataView(l,u,40),p.numValidPixel=y.getUint32(0,!0),p.microBlockSize=y.getInt32(4,!0),p.blobSize=y.getInt32(8,!0),p.imageType=y.getInt32(12,!0),p.maxZError=y.getFloat64(16,!0),p.zMin=y.getFloat64(24,!0),p.zMax=y.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var g,x;if(h>=3&&(x=h>=4?52:48,g=this.computeChecksumFletcher32(new Uint8Array(l,u-x,p.blobSize-14)),g!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(l,d){var u=d.headerInfo,f=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),y=this.readSubArray(l,d.ptr,f,p),h=this.readSubArray(l,d.ptr+p,f,p);d.ptr+=2*p;var g,x=!0;for(g=0;g<u.numDims;g++)if(y[g]!==h[g]){x=!1;break}return u.minValues=y,u.maxValues=h,x},readSubArray:function(l,d,u,f){var p;if(u===Uint8Array)p=new Uint8Array(l,d,f);else{var y=new ArrayBuffer(f),h=new Uint8Array(y);h.set(new Uint8Array(l,d,f)),p=new u(y)}return p},readMask:function(l,d){var u=d.ptr,f=d.headerInfo,p=f.width*f.height,y=f.numValidPixel,h=new DataView(l,u,4),g={};if(g.numBytes=h.getUint32(0,!0),u+=4,(y===0||p===y)&&g.numBytes!==0)throw"invalid mask";var x,S;if(y===0)x=new Uint8Array(Math.ceil(p/8)),g.bitset=x,S=new Uint8Array(p),d.pixels.resultMask=S,u+=g.numBytes;else if(g.numBytes>0){x=new Uint8Array(Math.ceil(p/8)),h=new DataView(l,u,g.numBytes);var V=h.getInt16(0,!0),Z=2,R=0,E=0;do{if(V>0)for(;V--;)x[R++]=h.getUint8(Z++);else for(E=h.getUint8(Z++),V=-V;V--;)x[R++]=E;V=h.getInt16(Z,!0),Z+=2}while(Z<g.numBytes);if(V!==-32768||R<x.length)throw"Unexpected end of mask RLE encoding";S=new Uint8Array(p);var I=0,v=0;for(v=0;v<p;v++)v&7?(I=x[v>>3],I<<=v&7):I=x[v>>3],I&128&&(S[v]=1);d.pixels.resultMask=S,g.bitset=x,u+=g.numBytes}return d.ptr=u,d.mask=g,!0},readDataOneSweep:function(l,d,u){var f=d.ptr,p=d.headerInfo,y=p.numDims,h=p.width*p.height,g=p.imageType,x=p.numValidPixel*r.getDataTypeSize(g)*y,S,V=d.pixels.resultMask;if(u===Uint8Array)S=new Uint8Array(l,f,x);else{var Z=new ArrayBuffer(x),R=new Uint8Array(Z);R.set(new Uint8Array(l,f,x)),S=new u(Z)}if(S.length===h*y)d.pixels.resultPixels=S;else{d.pixels.resultPixels=new u(h*y);var E=0,I=0,v=0,P=0;if(y>1)for(v=0;v<y;v++)for(P=v*h,I=0;I<h;I++)V[I]&&(d.pixels.resultPixels[P+I]=S[E++]);else for(I=0;I<h;I++)V[I]&&(d.pixels.resultPixels[I]=S[E++])}return f+=x,d.ptr=f,!0},readHuffmanTree:function(l,d){var u=this.HUFFMAN_LUT_BITS_MAX,f=new DataView(l,d.ptr,16);d.ptr+=16;var p=f.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var y=f.getInt32(4,!0),h=f.getInt32(8,!0),g=f.getInt32(12,!0);if(h>=g)return!1;var x=new Uint32Array(g-h);r.decodeBits(l,d,x);var S=[],V,Z,R,E;for(V=h;V<g;V++)Z=V-(V<y?0:y),S[Z]={first:x[V-h],second:null};var I=l.byteLength-d.ptr,v=Math.ceil(I/4),P=new ArrayBuffer(v*4),F=new Uint8Array(P);F.set(new Uint8Array(l,d.ptr,I));var N=new Uint32Array(P),b=0,G,X=0;for(G=N[0],V=h;V<g;V++)Z=V-(V<y?0:y),E=S[Z].first,E>0&&(S[Z].second=G<<b>>>32-E,32-b>=E?(b+=E,b===32&&(b=0,X++,G=N[X])):(b+=E-32,X++,G=N[X],S[Z].second|=G>>>32-b));var W=0,A=0,k=new s;for(V=0;V<S.length;V++)S[V]!==void 0&&(W=Math.max(W,S[V].first));W>=u?A=u:A=W,W>=30&&console.log("WARning, large NUM LUT BITS IS "+W);var B=[],O,H,U,K,Q,ie;for(V=h;V<g;V++)if(Z=V-(V<y?0:y),E=S[Z].first,E>0)if(O=[E,Z],E<=A)for(H=S[Z].second<<A-E,U=1<<A-E,R=0;R<U;R++)B[H|R]=O;else for(H=S[Z].second,ie=k,K=E-1;K>=0;K--)Q=H>>>K&1,Q?(ie.right||(ie.right=new s),ie=ie.right):(ie.left||(ie.left=new s),ie=ie.left),K===0&&!ie.val&&(ie.val=O[1]);return{decodeLut:B,numBitsLUTQick:A,numBitsLUT:W,tree:k,stuffedData:N,srcPtr:X,bitPos:b}},readHuffman:function(l,d,u){var f=d.headerInfo,p=f.numDims,y=d.headerInfo.height,h=d.headerInfo.width,g=h*y,x=this.readHuffmanTree(l,d),S=x.decodeLut,V=x.tree,Z=x.stuffedData,R=x.srcPtr,E=x.bitPos,I=x.numBitsLUTQick,v=x.numBitsLUT,P=d.headerInfo.imageType===0?128:0,F,N,b,G=d.pixels.resultMask,X,W,A,k,B,O,H,U=0;E>0&&(R++,E=0);var K=Z[R],Q=d.encodeMode===1,ie=new u(g*p),j=ie,$;for($=0;$<f.numDims;$++){if(p>1&&(j=new u(ie.buffer,g*$,g),U=0),d.headerInfo.numValidPixel===h*y)for(O=0,k=0;k<y;k++)for(B=0;B<h;B++,O++){if(N=0,X=K<<E>>>32-I,W=X,32-E<I&&(X|=Z[R+1]>>>64-E-I,W=X),S[W])N=S[W][1],E+=S[W][0];else for(X=K<<E>>>32-v,W=X,32-E<v&&(X|=Z[R+1]>>>64-E-v,W=X),F=V,H=0;H<v;H++)if(A=X>>>v-H-1&1,F=A?F.right:F.left,!(F.left||F.right)){N=F.val,E=E+H+1;break}E>=32&&(E-=32,R++,K=Z[R]),b=N-P,Q?(B>0?b+=U:k>0?b+=j[O-h]:b+=U,b&=255,j[O]=b,U=b):j[O]=b}else for(O=0,k=0;k<y;k++)for(B=0;B<h;B++,O++)if(G[O]){if(N=0,X=K<<E>>>32-I,W=X,32-E<I&&(X|=Z[R+1]>>>64-E-I,W=X),S[W])N=S[W][1],E+=S[W][0];else for(X=K<<E>>>32-v,W=X,32-E<v&&(X|=Z[R+1]>>>64-E-v,W=X),F=V,H=0;H<v;H++)if(A=X>>>v-H-1&1,F=A?F.right:F.left,!(F.left||F.right)){N=F.val,E=E+H+1;break}E>=32&&(E-=32,R++,K=Z[R]),b=N-P,Q?(B>0&&G[O-1]?b+=U:k>0&&G[O-h]?b+=j[O-h]:b+=U,b&=255,j[O]=b,U=b):j[O]=b}d.ptr=d.ptr+(R+1)*4+(E>0?4:0)}d.pixels.resultPixels=ie},decodeBits:function(l,d,u,f,p){{var y=d.headerInfo,h=y.fileVersion,g=0,x=new DataView(l,d.ptr,5),S=x.getUint8(0);g++;var V=S>>6,Z=V===0?4:3-V,R=(S&32)>0,E=S&31,I=0;if(Z===1)I=x.getUint8(g),g++;else if(Z===2)I=x.getUint16(g,!0),g+=2;else if(Z===4)I=x.getUint32(g,!0),g+=4;else throw"Invalid valid pixel count type";var v=2*y.maxZError,P,F,N,b,G,X,W,A,k,B,O=y.numDims>1?y.maxValues[p]:y.zMax;if(R){for(d.counter.lut++,A=x.getUint8(g),k=E,g++,b=Math.ceil((A-1)*E/8),G=Math.ceil(b/4),F=new ArrayBuffer(G*4),N=new Uint8Array(F),d.ptr+=g,N.set(new Uint8Array(l,d.ptr,b)),W=new Uint32Array(F),d.ptr+=b,B=0;A-1>>>B;)B++;b=Math.ceil(I*B/8),G=Math.ceil(b/4),F=new ArrayBuffer(G*4),N=new Uint8Array(F),N.set(new Uint8Array(l,d.ptr,b)),P=new Uint32Array(F),d.ptr+=b,h>=3?X=o.unstuffLUT2(W,E,A-1,f,v,O):X=o.unstuffLUT(W,E,A-1,f,v,O),h>=3?o.unstuff2(P,u,B,I,X):o.unstuff(P,u,B,I,X)}else d.counter.bitstuffer++,B=E,d.ptr+=g,B>0&&(b=Math.ceil(I*B/8),G=Math.ceil(b/4),F=new ArrayBuffer(G*4),N=new Uint8Array(F),N.set(new Uint8Array(l,d.ptr,b)),P=new Uint32Array(F),d.ptr+=b,h>=3?f==null?o.originalUnstuff2(P,u,B,I):o.unstuff2(P,u,B,I,!1,f,v,O):f==null?o.originalUnstuff(P,u,B,I):o.unstuff(P,u,B,I,!1,f,v,O))}},readTiles:function(l,d,u){var f=d.headerInfo,p=f.width,y=f.height,h=f.microBlockSize,g=f.imageType,x=r.getDataTypeSize(g),S=Math.ceil(p/h),V=Math.ceil(y/h);d.pixels.numBlocksY=V,d.pixels.numBlocksX=S,d.pixels.ptr=0;var Z=0,R=0,E=0,I=0,v=0,P=0,F=0,N=0,b=0,G=0,X=0,W=0,A=0,k=0,B=0,O=0,H,U,K,Q,ie,j,$=new u(h*h),ne=y%h||h,be=p%h||h,Ce,me,_e=f.numDims,Ve,Ie=d.pixels.resultMask,Ze=d.pixels.resultPixels;for(E=0;E<V;E++)for(v=E!==V-1?h:ne,I=0;I<S;I++)for(P=I!==S-1?h:be,X=E*p*h+I*h,W=p-P,Ve=0;Ve<_e;Ve++){if(_e>1&&(Ze=new u(d.pixels.resultPixels.buffer,p*y*Ve*x,p*y)),F=l.byteLength-d.ptr,H=new DataView(l,d.ptr,Math.min(10,F)),U={},O=0,N=H.getUint8(0),O++,b=N>>6&255,G=N>>2&15,G!==(I*h>>3&15))throw"integrity issue";if(j=N&3,j>3)throw d.ptr+=O,"Invalid block encoding ("+j+")";if(j===2){d.counter.constant++,d.ptr+=O;continue}else if(j===0){if(d.counter.uncompressed++,d.ptr+=O,A=v*P*x,k=l.byteLength-d.ptr,A=A<k?A:k,K=new ArrayBuffer(A%x===0?A:A+x-A%x),Q=new Uint8Array(K),Q.set(new Uint8Array(l,d.ptr,A)),ie=new u(K),B=0,Ie)for(Z=0;Z<v;Z++){for(R=0;R<P;R++)Ie[X]&&(Ze[X]=ie[B++]),X++;X+=W}else for(Z=0;Z<v;Z++){for(R=0;R<P;R++)Ze[X++]=ie[B++];X+=W}d.ptr+=B*x}else if(Ce=r.getDataTypeUsed(g,b),me=r.getOnePixel(U,O,Ce,H),O+=r.getDataTypeSize(Ce),j===3)if(d.ptr+=O,d.counter.constantoffset++,Ie)for(Z=0;Z<v;Z++){for(R=0;R<P;R++)Ie[X]&&(Ze[X]=me),X++;X+=W}else for(Z=0;Z<v;Z++){for(R=0;R<P;R++)Ze[X++]=me;X+=W}else if(d.ptr+=O,r.decodeBits(l,d,$,me,Ve),O=0,Ie)for(Z=0;Z<v;Z++){for(R=0;R<P;R++)Ie[X]&&(Ze[X]=$[O++]),X++;X+=W}else for(Z=0;Z<v;Z++){for(R=0;R<P;R++)Ze[X++]=$[O++];X+=W}}},formatFileInfo:function(l){return{fileIdentifierString:l.headerInfo.fileIdentifierString,fileVersion:l.headerInfo.fileVersion,imageType:l.headerInfo.imageType,height:l.headerInfo.height,width:l.headerInfo.width,numValidPixel:l.headerInfo.numValidPixel,microBlockSize:l.headerInfo.microBlockSize,blobSize:l.headerInfo.blobSize,maxZError:l.headerInfo.maxZError,pixelType:r.getPixelType(l.headerInfo.imageType),eofOffset:l.eofOffset,mask:l.mask?{numBytes:l.mask.numBytes}:null,pixels:{numBlocksX:l.pixels.numBlocksX,numBlocksY:l.pixels.numBlocksY,maxValue:l.headerInfo.zMax,minValue:l.headerInfo.zMin,noDataValue:l.noDataValue}}},constructConstantSurface:function(l){var d=l.headerInfo.zMax,u=l.headerInfo.numDims,f=l.headerInfo.height*l.headerInfo.width,p=f*u,y=0,h=0,g=0,x=l.pixels.resultMask;if(x)if(u>1)for(y=0;y<u;y++)for(g=y*f,h=0;h<f;h++)x[h]&&(l.pixels.resultPixels[g+h]=d);else for(h=0;h<f;h++)x[h]&&(l.pixels.resultPixels[h]=d);else if(l.pixels.resultPixels.fill)l.pixels.resultPixels.fill(d);else for(h=0;h<p;h++)l.pixels.resultPixels[h]=d},getDataTypeArray:function(l){var d;switch(l){case 0:d=Int8Array;break;case 1:d=Uint8Array;break;case 2:d=Int16Array;break;case 3:d=Uint16Array;break;case 4:d=Int32Array;break;case 5:d=Uint32Array;break;case 6:d=Float32Array;break;case 7:d=Float64Array;break;default:d=Float32Array}return d},getPixelType:function(l){var d;switch(l){case 0:d="S8";break;case 1:d="U8";break;case 2:d="S16";break;case 3:d="U16";break;case 4:d="S32";break;case 5:d="U32";break;case 6:d="F32";break;case 7:d="F64";break;default:d="F32"}return d},isValidPixelValue:function(l,d){if(d==null)return!1;var u;switch(l){case 0:u=d>=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(l){var d=0;switch(l){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=l}return d},getDataTypeUsed:function(l,d){var u=l;switch(l){case 2:case 4:u=l-d;break;case 3:case 5:u=l-2*d;break;case 6:d===0?u=l:d===1?u=2:u=1;break;case 7:d===0?u=l:u=l-2*d+1;break;default:u=l;break}return u},getOnePixel:function(l,d,u,f){var p=0;switch(u){case 0:p=f.getInt8(d);break;case 1:p=f.getUint8(d);break;case 2:p=f.getInt16(d,!0);break;case 3:p=f.getUint16(d,!0);break;case 4:p=f.getInt32(d,!0);break;case 5:p=f.getUInt32(d,!0);break;case 6:p=f.getFloat32(d,!0);break;case 7:p=f.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(l,d,u){this.val=l,this.left=d,this.right=u},a={decode:function(l,d){d=d||{};var u=d.noDataValue,f=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(l,p)){var y=p.headerInfo,h=y.fileVersion,g=r.getDataTypeArray(y.imageType);r.readMask(l,p),y.numValidPixel!==y.width*y.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var x=y.width*y.height;if(p.pixels.resultPixels=new g(x*y.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},y.numValidPixel!==0)if(y.zMax===y.zMin)r.constructConstantSurface(p);else if(h>=4&&r.checkMinMaxRanges(l,p))r.constructConstantSurface(p);else{var S=new DataView(l,p.ptr,2),V=S.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(l,p,g);else if(h>1&&y.imageType<=1&&Math.abs(y.maxZError-.5)<1e-5){var Z=S.getUint8(1);if(p.ptr++,p.encodeMode=Z,Z>2||h<4&&Z>1)throw"Invalid Huffman flag "+Z;Z?r.readHuffman(l,p,g):r.readTiles(l,p,g)}else r.readTiles(l,p,g)}p.eofOffset=p.ptr;var R;d.inputOffset?(R=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(R)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(R=p.headerInfo.blobSize-p.ptr,Math.abs(R)>=1&&(p.eofOffset=p.headerInfo.blobSize));var E={width:y.width,height:y.height,pixelData:p.pixels.resultPixels,minValue:y.zMin,maxValue:y.zMax,validPixelCount:y.numValidPixel,dimCount:y.numDims,dimStats:{minValues:y.minValues,maxValues:y.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(y.imageType,u)){var I=p.pixels.resultMask;for(f=0;f<x;f++)I[f]||(E.pixelData[f]=u);E.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(E.fileInfo=r.formatFileInfo(p)),E}},getBandCount:function(l){var d=0,u=0,f={};for(f.ptr=0,f.pixels={};u<l.byteLength-58;)r.readHeaderInfo(l,f),u+=f.headerInfo.blobSize,d++,f.ptr=u;return d}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),l=String.fromCharCode.apply(null,a),d,u;if(l.trim()==="CntZImage")d=e,u=1;else if(l.substring(0,5)==="Lerc2")d=t,u=2;else throw"Unexpected file identifier string: "+l;for(var f=0,p=o.byteLength-10,y,h=[],g,x,S={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var V=d.decode(o,{inputOffset:s,encodedMaskData:y,maskData:x,returnMask:f===0,returnEncodedMask:f===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=V.fileInfo.eofOffset,f===0&&(y=V.encodedMaskData,x=V.maskData,S.width=V.width,S.height=V.height,S.dimCount=V.dimCount||1,S.pixelType=V.pixelType||V.fileInfo.pixelType,S.mask=V.maskData),u>1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&h.push(V.maskData),f++,S.pixels.push(V.pixelData),S.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var Z,R,E;if(u>1&&h.length>1){for(E=S.width*S.height,S.bandMasks=h,x=new Uint8Array(E),x.set(h[0]),Z=1;Z<h.length;Z++)for(g=h[Z],R=0;R<E;R++)x[R]=x[R]&g[R];S.maskData=x}return S}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof _B<"u"&&_B.exports?_B.exports=i:this.Lerc=i})()});var t1e=ad((l9o,e1e)=>{var d9o=_(T());e1e.exports={webm:"data:video/webm;base64, ",mp4:"data:video/mp4;base64, "}});var i1e=ad((u9o,n1e)=>{var m9o=_(T()),{webm:LVt,mp4:ZVt}=t1e(),cq=()=>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,lq=()=>"wakeLock"in navigator,dq=class{constructor(){if(this.enabled=!1,lq()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else cq()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",LVt),this._addSourceToVideo(this.noSleepVideo,"mp4",ZVt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return lq()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):cq()?(this.disable(),console.warn(`
        NoSleep enabled for older iOS devices. This can interrupt
        active or long-running network requests from completing successfully.
        See https://github.com/richtr/NoSleep.js/issues/15 for more details.
      `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){lq()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):cq()?this.noSleepTimer&&(console.warn(`
          NoSleep now disabled for older iOS devices.
        `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};n1e.exports=dq});var YVt={};b1e(YVt,{AlphaMode:()=>Th,AlphaPipelineStage:()=>XW,AnchorPointDirect:()=>PI,AnchorPointIndirect:()=>vI,Animation:()=>bM,AnimationViewModel:()=>yM,Appearance:()=>no,ApproximateTerrainHeights:()=>ui,ArcGISTiledElevationTerrainProvider:()=>n7,ArcGisBaseMapType:()=>Mf,ArcGisMapServerImageryProvider:()=>l0,ArcGisMapService:()=>Jd,ArcType:()=>Kt,ArticulationStageType:()=>yc,AssociativeArray:()=>Zt,Atmosphere:()=>C_,AtmospherePipelineStage:()=>dW,AttributeCompression:()=>Fn,AttributeType:()=>rn,AutoExposure:()=>RA,AutomaticUniforms:()=>_p,Axis:()=>Po,AxisAlignedBoundingBox:()=>J0,B3dmLoader:()=>KI,B3dmParser:()=>YI,BaseLayerPicker:()=>xM,BaseLayerPickerViewModel:()=>gM,BatchTable:()=>Ix,BatchTableHierarchy:()=>t_,BatchTexture:()=>Qc,BatchTexturePipelineStage:()=>IW,Billboard:()=>co,BillboardCollection:()=>Gd,BillboardGraphics:()=>cc,BillboardLoadState:()=>is,BillboardTexture:()=>xb,BillboardVisualizer:()=>yE,BingMapsGeocoderService:()=>o7,BingMapsImageryProvider:()=>tF,BingMapsStyle:()=>JV,BlendEquation:()=>Pa,BlendFunction:()=>Co,BlendOption:()=>Lo,BlendingState:()=>un,BoundingRectangle:()=>je,BoundingSphere:()=>ue,BoundingSphereState:()=>ut,BoundingVolumeSemantics:()=>g_,BoxEmitter:()=>J7,BoxGeometry:()=>Wa,BoxGeometryUpdater:()=>EX,BoxGraphics:()=>Nx,BoxOutlineGeometry:()=>Fm,BrdfLutGenerator:()=>IF,Buffer:()=>_t,BufferLoader:()=>s_,BufferUsage:()=>Ne,CPUStylingPipelineStage:()=>vW,CallbackPositionProperty:()=>XX,CallbackProperty:()=>Om,Camera:()=>oo,CameraEventAggregator:()=>PA,CameraEventType:()=>Ni,CameraFlightPath:()=>wF,Cartesian2:()=>D,Cartesian3:()=>m,Cartesian4:()=>ce,Cartographic:()=>pe,CartographicGeocoderService:()=>s7,CatmullRomSpline:()=>a7,Cesium3DContentGroup:()=>e_,Cesium3DTile:()=>Ku,Cesium3DTileBatchTable:()=>zp,Cesium3DTileColorBlendMode:()=>Wl,Cesium3DTileContent:()=>Q7,Cesium3DTileContentFactory:()=>M_,Cesium3DTileContentState:()=>Ho,Cesium3DTileContentType:()=>Zs,Cesium3DTileFeature:()=>Us,Cesium3DTileFeatureTable:()=>of,Cesium3DTileOptimizationHint:()=>Du,Cesium3DTileOptimizations:()=>gP,Cesium3DTilePass:()=>Fo,Cesium3DTilePassState:()=>hm,Cesium3DTilePointFeature:()=>_b,Cesium3DTileRefine:()=>Bo,Cesium3DTileStyle:()=>RS,Cesium3DTileStyleEngine:()=>VP,Cesium3DTilesInspector:()=>LM,Cesium3DTilesInspectorViewModel:()=>VM,Cesium3DTilesVoxelProvider:()=>j7,Cesium3DTileset:()=>bs,Cesium3DTilesetBaseTraversal:()=>XP,Cesium3DTilesetCache:()=>TP,Cesium3DTilesetGraphics:()=>Hx,Cesium3DTilesetHeatmap:()=>SP,Cesium3DTilesetMetadata:()=>K_,Cesium3DTilesetMostDetailedTraversal:()=>RP,Cesium3DTilesetSkipTraversal:()=>wP,Cesium3DTilesetStatistics:()=>pf,Cesium3DTilesetTraversal:()=>zs,Cesium3DTilesetVisualizer:()=>PP,CesiumInspector:()=>GM,CesiumInspectorViewModel:()=>RM,CesiumTerrainProvider:()=>_S,CesiumWidget:()=>G9,Check:()=>C,CheckerboardMaterialProperty:()=>X1,CircleEmitter:()=>O9,CircleGeometry:()=>f7,CircleOutlineGeometry:()=>h7,ClassificationModelDrawCommand:()=>Rw,ClassificationPipelineStage:()=>WW,ClassificationPrimitive:()=>bC,ClassificationType:()=>Un,ClearCommand:()=>ti,ClippingPlane:()=>x_,ClippingPlaneCollection:()=>hs,ClippingPolygon:()=>HC,ClippingPolygonCollection:()=>qm,Clock:()=>_f,ClockRange:()=>zr,ClockStep:()=>fo,ClockViewModel:()=>fM,CloudCollection:()=>i6,CloudType:()=>GS,Color:()=>Y,ColorBlendMode:()=>bc,ColorGeometryInstanceAttribute:()=>Yt,ColorMaterialProperty:()=>Ut,Command:()=>z6,ComponentDatatype:()=>q,Composite3DTileContent:()=>NX,CompositeEntityCollection:()=>AK,CompositeMaterialProperty:()=>W1,CompositePositionProperty:()=>ya,CompositeProperty:()=>Sc,CompressedTextureBuffer:()=>yZ,ComputeCommand:()=>vc,ComputeEngine:()=>bZ,ConditionsExpression:()=>M9,ConeEmitter:()=>r6,ConstantPositionProperty:()=>Oc,ConstantProperty:()=>Qn,ConstantSpline:()=>qI,ContentMetadata:()=>lP,Context:()=>lE,ContextLimits:()=>mt,CoplanarPolygonGeometry:()=>g2,CoplanarPolygonGeometryLibrary:()=>Eb,CoplanarPolygonOutlineGeometry:()=>zu,CornerType:()=>Fi,CorrelationGroup:()=>FI,CorridorGeometry:()=>eT,CorridorGeometryLibrary:()=>Bi,CorridorGeometryUpdater:()=>DP,CorridorGraphics:()=>Ux,CorridorOutlineGeometry:()=>OP,Credit:()=>Ct,CreditDisplay:()=>AF,CubeMap:()=>Uo,CubeMapFace:()=>RZ,CubicRealPolynomial:()=>bx,CullFace:()=>_i,CullingVolume:()=>fs,CumulusCloud:()=>au,CustomDataSource:()=>JP,CustomHeightmapTerrainProvider:()=>p7,CustomShader:()=>aS,CustomShaderMode:()=>bb,CustomShaderPipelineStage:()=>OW,CustomShaderTranslucencyMode:()=>Iy,CylinderGeometry:()=>QP,CylinderGeometryLibrary:()=>tT,CylinderGeometryUpdater:()=>qP,CylinderGraphics:()=>Ox,CylinderOutlineGeometry:()=>jP,CzmlDataSource:()=>c2,DataSource:()=>Hr,DataSourceClock:()=>Tf,DataSourceCollection:()=>l2,DataSourceDisplay:()=>z2,DebugAppearance:()=>d6,DebugCameraPrimitive:()=>op,DebugInspector:()=>OA,DebugModelMatrixPrimitive:()=>Y9,DefaultProxy:()=>y7,DepthFunction:()=>lc,DepthPlane:()=>DF,DequantizationPipelineStage:()=>BW,DerivedCommand:()=>rp,DeveloperError:()=>L,DeviceOrientationCameraController:()=>BF,DirectionalLight:()=>u6,DiscardEmptyTileImagePolicy:()=>QV,DiscardMissingTileImagePolicy:()=>$v,DistanceDisplayCondition:()=>vt,DistanceDisplayConditionGeometryInstanceAttribute:()=>kn,DoubleEndedPriorityQueue:()=>mS,DoublyLinkedList:()=>_P,DracoLoader:()=>eb,DrawCommand:()=>et,DynamicAtmosphereLightingType:()=>rb,DynamicEnvironmentMapManager:()=>sb,DynamicGeometryBatch:()=>aT,DynamicGeometryUpdater:()=>ii,EarthOrientationParameters:()=>aZ,EarthOrientationParametersSample:()=>P0,EasingFunction:()=>Jr,EllipseGeometry:()=>cl,EllipseGeometryLibrary:()=>Yl,EllipseGeometryUpdater:()=>u2,EllipseGraphics:()=>Dx,EllipseOutlineGeometry:()=>Md,Ellipsoid:()=>re,EllipsoidGeodesic:()=>Fp,EllipsoidGeometry:()=>Js,EllipsoidGeometryUpdater:()=>f2,EllipsoidGraphics:()=>Bx,EllipsoidOutlineGeometry:()=>Id,EllipsoidPrimitive:()=>ZF,EllipsoidRhumbLine:()=>va,EllipsoidSurfaceAppearance:()=>m6,EllipsoidTangentPlane:()=>$r,EllipsoidTerrainProvider:()=>ep,EllipsoidalOccluder:()=>kb,Empty3DTileContent:()=>y1,EncodedCartesian3:()=>Bn,Entity:()=>$o,EntityCluster:()=>wd,EntityCollection:()=>Ks,EntityView:()=>J2,Event:()=>ye,EventHelper:()=>hr,Expression:()=>Iu,ExpressionNodeType:()=>gt,ExtrapolationType:()=>ol,FeatureDetection:()=>Ot,FeatureIdPipelineStage:()=>Xy,Fog:()=>YF,ForEach:()=>we,FrameRateMonitor:()=>K9,FrameState:()=>HF,Framebuffer:()=>Fr,FramebufferManager:()=>hi,Frozen:()=>z,FrustumCommands:()=>jF,FrustumGeometry:()=>NT,FrustumOutlineGeometry:()=>kF,Fullscreen:()=>_r,FullscreenButton:()=>XM,FullscreenButtonViewModel:()=>EM,GeoJsonDataSource:()=>gg,GeoJsonLoader:()=>JI,GeocodeType:()=>Bg,Geocoder:()=>PM,GeocoderService:()=>PL,GeocoderViewModel:()=>wM,GeographicProjection:()=>Xi,GeographicTilingScheme:()=>Ki,Geometry:()=>dt,Geometry3DTileContent:()=>DX,GeometryAttribute:()=>Ee,GeometryAttributes:()=>fn,GeometryFactory:()=>x7,GeometryInstance:()=>Rt,GeometryInstanceAttribute:()=>dc,GeometryOffsetAttribute:()=>$t,GeometryPipeline:()=>An,GeometryPipelineStage:()=>KW,GeometryType:()=>yu,GeometryUpdater:()=>oi,GeometryUpdaterSet:()=>gT,GeometryVisualizer:()=>v2,GetFeatureInfoFormat:()=>vT,Globe:()=>SF,GlobeDepth:()=>qF,GlobeSurfaceShaderSet:()=>qv,GlobeSurfaceTile:()=>um,GlobeSurfaceTileProvider:()=>mF,GlobeTranslucency:()=>fF,GlobeTranslucencyFramebuffer:()=>$F,GlobeTranslucencyState:()=>zF,GltfBufferViewLoader:()=>XC,GltfDracoLoader:()=>IC,GltfGpmLoader:()=>MI,GltfGpmLocal:()=>KC,GltfImageLoader:()=>WC,GltfIndexBufferLoader:()=>wC,GltfJsonLoader:()=>vC,GltfLoader:()=>nf,GltfLoaderUtil:()=>vl,GltfMeshPrimitiveGpmLoader:()=>OI,GltfStructuralMetadataLoader:()=>WI,GltfTextureLoader:()=>FC,GltfVertexBufferLoader:()=>AC,GoogleEarthEnterpriseImageryProvider:()=>h6,GoogleEarthEnterpriseMapsProvider:()=>oF,GoogleEarthEnterpriseMetadata:()=>G0,GoogleEarthEnterpriseTerrainData:()=>vL,GoogleEarthEnterpriseTerrainProvider:()=>R7,GoogleEarthEnterpriseTileInformation:()=>w9,GoogleGeocoderService:()=>E7,GoogleMaps:()=>CS,GpxDataSource:()=>xv,GregorianDate:()=>eh,GridImageryProvider:()=>p6,GridMaterialProperty:()=>O1,GroundGeometryUpdater:()=>Yn,GroundPolylineGeometry:()=>vx,GroundPolylinePrimitive:()=>Am,GroundPrimitive:()=>kc,GroupMetadata:()=>R1,HeadingPitchRange:()=>rm,HeadingPitchRoll:()=>Ea,Heap:()=>iZ,HeightReference:()=>ze,HeightmapEncoding:()=>cm,HeightmapTerrainData:()=>Da,HeightmapTessellator:()=>YV,HermitePolynomialApproximation:()=>$P,HermiteSpline:()=>Ry,HilbertOrder:()=>ZC,HomeButton:()=>WM,HomeButtonViewModel:()=>IM,HorizontalOrigin:()=>xi,I3SBuildingSceneLayerExplorer:()=>nq,I3SBuildingSceneLayerExplorerViewModel:()=>vM,I3SDataProvider:()=>jf,I3SDecoder:()=>J9,I3SFeature:()=>Q9,I3SField:()=>j9,I3SGeometry:()=>NL,I3SLayer:()=>wS,I3SNode:()=>kL,I3SStatistics:()=>eM,I3SSublayer:()=>nM,I3SSymbology:()=>$9,I3dmLoader:()=>jI,I3dmParser:()=>QI,ITwinData:()=>x6,ITwinPlatform:()=>as,Iau2000Orientation:()=>VF,Iau2006XysData:()=>cZ,Iau2006XysSample:()=>mx,IauOrientationAxes:()=>LF,IauOrientationParameters:()=>CF,ImageBasedLighting:()=>$x,ImageBasedLightingPipelineStage:()=>mW,ImageMaterialProperty:()=>$0,Imagery:()=>nL,ImageryLayer:()=>Ya,ImageryLayerCollection:()=>hF,ImageryLayerFeatureInfo:()=>Af,ImageryProvider:()=>fl,ImageryState:()=>ci,Implicit3DTileContent:()=>kC,ImplicitAvailabilityBitstream:()=>GC,ImplicitMetadataView:()=>EC,ImplicitSubdivisionScheme:()=>tr,ImplicitSubtree:()=>b_,ImplicitSubtreeCache:()=>k9,ImplicitSubtreeMetadata:()=>BX,ImplicitTileCoordinates:()=>j_,ImplicitTileset:()=>Q_,IndexDatatype:()=>Me,InfoBox:()=>AM,InfoBoxViewModel:()=>FM,InspectorShared:()=>sd,InstanceAttributeSemantic:()=>ns,InstancingPipelineStage:()=>ZW,InterpolationAlgorithm:()=>X7,InterpolationType:()=>ef,Intersect:()=>zt,IntersectionTests:()=>qn,Intersections2D:()=>Z0,Interval:()=>Ia,InvertClassification:()=>fL,Ion:()=>Ym,IonGeocodeProviderType:()=>E0,IonGeocoderService:()=>VS,IonImageryProvider:()=>d0,IonResource:()=>xd,IonWorldImageryStyle:()=>u0,Iso8601:()=>Ye,JobScheduler:()=>KF,JobType:()=>fa,JsonMetadataTable:()=>ab,JulianDate:()=>ee,KTX2Transcoder:()=>gZ,KeyboardEventModifier:()=>ia,KeyframeNode:()=>bo,KmlCamera:()=>_v,KmlDataSource:()=>XT,KmlLookAt:()=>Tv,KmlTour:()=>Sv,KmlTourFlyTo:()=>Vv,KmlTourWait:()=>Lv,Label:()=>Fy,LabelCollection:()=>Gh,LabelGraphics:()=>Nm,LabelStyle:()=>Yo,LabelVisualizer:()=>F2,LagrangePolynomialApproximation:()=>e2,LeapSecond:()=>Hi,Light:()=>_6,LightingModel:()=>Lh,LightingPipelineStage:()=>QW,LinearApproximation:()=>Qy,LinearSpline:()=>Zy,ManagedArray:()=>Jc,MapMode2D:()=>ed,MapProjection:()=>w7,MapboxImageryProvider:()=>rF,MapboxStyleImageryProvider:()=>T6,Material:()=>zi,MaterialAppearance:()=>so,MaterialPipelineStage:()=>qW,MaterialProperty:()=>qo,Math:()=>w,Matrix2:()=>Ii,Matrix3:()=>te,Matrix4:()=>M,Megatexture:()=>TL,MeshPrimitiveGpmLocal:()=>UI,MetadataClass:()=>Jm,MetadataClassProperty:()=>gh,MetadataComponentType:()=>At,MetadataEntity:()=>Nn,MetadataEnum:()=>dI,MetadataEnumValue:()=>lI,MetadataPicking:()=>JF,MetadataPickingPipelineStage:()=>Ld,MetadataPipelineStage:()=>Fu,MetadataSchema:()=>Cd,MetadataSchemaLoader:()=>MC,MetadataSemantic:()=>y_,MetadataTable:()=>Wu,MetadataTableProperty:()=>HX,MetadataType:()=>lt,MipmapHint:()=>_u,Model:()=>af,Model3DTileContent:()=>Rd,ModelAlphaOptions:()=>bw,ModelAnimation:()=>nW,ModelAnimationChannel:()=>tW,ModelAnimationCollection:()=>iW,ModelAnimationLoop:()=>Al,ModelAnimationState:()=>rf,ModelArticulation:()=>hW,ModelArticulationStage:()=>fW,ModelClippingPlanesPipelineStage:()=>yW,ModelClippingPolygonsPipelineStage:()=>_W,ModelColorPipelineStage:()=>Ey,ModelComponents:()=>Cn,ModelDrawCommand:()=>Gw,ModelDrawCommands:()=>Iw,ModelFeature:()=>oW,ModelFeatureTable:()=>sW,ModelGraphics:()=>Up,ModelLightingOptions:()=>Vw,ModelMatrixUpdateStage:()=>RW,ModelNode:()=>TW,ModelRenderResources:()=>yw,ModelRuntimeNode:()=>EW,ModelRuntimePrimitive:()=>hw,ModelSceneGraph:()=>Ww,ModelSilhouettePipelineStage:()=>_w,ModelSkin:()=>pw,ModelSplitterPipelineStage:()=>Sw,ModelStatistics:()=>ww,ModelType:()=>mr,ModelUtility:()=>qt,ModelVisualizer:()=>A2,Moon:()=>GF,MorphTargetsPipelineStage:()=>ew,MorphWeightSpline:()=>P7,MortonOrder:()=>Oy,Multiple3DTileContent:()=>mP,MultisampleFramebuffer:()=>dE,NavigationHelpButton:()=>DM,NavigationHelpButtonViewModel:()=>OM,NearFarScalar:()=>Nt,NeverTileDiscardPolicy:()=>C6,NodeRenderResources:()=>Cw,NodeStatisticsPipelineStage:()=>GW,NodeTransformationProperty:()=>Yx,OIT:()=>eA,Occluder:()=>EF,OffsetGeometryInstanceAttribute:()=>$i,OpenCageGeocoderService:()=>F7,OpenStreetMapImageryProvider:()=>I0,OrderedGroundPrimitiveCollection:()=>d2,OrientedBoundingBox:()=>Xn,OrthographicFrustum:()=>sn,OrthographicOffCenterFrustum:()=>Oo,Packable:()=>A7,PackableForInterpolation:()=>M7,Particle:()=>DL,ParticleBurst:()=>L6,ParticleEmitter:()=>Z6,ParticleSystem:()=>R6,Pass:()=>Xe,PassState:()=>sc,PathGraphics:()=>Op,PathVisualizer:()=>N2,PeliasGeocoderService:()=>v9,PerInstanceColorAppearance:()=>an,PerformanceDisplay:()=>p0,PerformanceWatchdog:()=>UM,PerformanceWatchdogViewModel:()=>kM,PerspectiveFrustum:()=>Ci,PerspectiveOffCenterFrustum:()=>hl,PickDepth:()=>QF,PickDepthFramebuffer:()=>nA,PickFramebuffer:()=>oA,PickedMetadataInfo:()=>b9,Picking:()=>cA,PickingPipelineStage:()=>tw,PinBuilder:()=>r0,PixelDatatype:()=>Ue,PixelFormat:()=>ke,Plane:()=>cn,PlaneGeometry:()=>h2,PlaneGeometryUpdater:()=>b2,PlaneGraphics:()=>SX,PlaneOutlineGeometry:()=>p2,PntsLoader:()=>vw,PntsParser:()=>I_,PointCloud:()=>Z9,PointCloudEyeDomeLighting:()=>lb,PointCloudShading:()=>Vh,PointCloudStylingPipelineStage:()=>iw,PointGraphics:()=>zx,PointPrimitive:()=>Gs,PointPrimitiveCollection:()=>A1,PointVisualizer:()=>U2,PolygonGeometry:()=>ob,PolygonGeometryLibrary:()=>Dn,PolygonGeometryUpdater:()=>_2,PolygonGraphics:()=>km,PolygonHierarchy:()=>Fa,PolygonOutlineGeometry:()=>x2,PolygonPipeline:()=>ai,Polyline:()=>ku,PolylineArrowMaterialProperty:()=>B1,PolylineCollection:()=>df,PolylineColorAppearance:()=>es,PolylineDashMaterialProperty:()=>H1,PolylineGeometry:()=>e0,PolylineGeometryUpdater:()=>B2,PolylineGlowMaterialProperty:()=>K1,PolylineGraphics:()=>uc,PolylineMaterialAppearance:()=>ua,PolylineOutlineMaterialProperty:()=>jy,PolylinePipeline:()=>vi,PolylineVisualizer:()=>H2,PolylineVolumeGeometry:()=>C2,PolylineVolumeGeometryLibrary:()=>bf,PolylineVolumeGeometryUpdater:()=>R2,PolylineVolumeGraphics:()=>Kx,PolylineVolumeOutlineGeometry:()=>Z2,PositionProperty:()=>Mm,PositionPropertyArray:()=>Bb,PostProcessStage:()=>mo,PostProcessStageCollection:()=>XA,PostProcessStageComposite:()=>nd,PostProcessStageLibrary:()=>$d,PostProcessStageSampleMode:()=>qd,PostProcessStageTextureCache:()=>jT,PpeMetadata:()=>kI,PpeSource:()=>D6,PpeTexture:()=>NI,Primitive:()=>In,PrimitiveCollection:()=>al,PrimitiveLoadPlan:()=>Z_,PrimitiveOutlineGenerator:()=>L_,PrimitiveOutlinePipelineStage:()=>sw,PrimitivePipeline:()=>Wx,PrimitiveRenderResources:()=>Lw,PrimitiveState:()=>Zr,PrimitiveStatisticsPipelineStage:()=>aw,PrimitiveType:()=>ve,ProjectionPicker:()=>NM,ProjectionPickerViewModel:()=>MM,Property:()=>J,PropertyArray:()=>Q1,PropertyAttribute:()=>V_,PropertyAttributeProperty:()=>GI,PropertyBag:()=>Bc,PropertyTable:()=>qc,PropertyTexture:()=>cb,PropertyTextureProperty:()=>RI,ProviderViewModel:()=>ls,Proxy:()=>k7,QuadraticRealPolynomial:()=>Fc,QuadtreeOccluders:()=>pF,QuadtreePrimitive:()=>TF,QuadtreeTile:()=>bF,QuadtreeTileLoadState:()=>$s,QuadtreeTileProvider:()=>G6,QuantizedMeshTerrainData:()=>xS,QuarticRealPolynomial:()=>TZ,Quaternion:()=>Fe,QuaternionSpline:()=>eW,Queue:()=>_y,Ray:()=>bn,Rectangle:()=>de,RectangleCollisionChecker:()=>_T,RectangleGeometry:()=>mT,RectangleGeometryLibrary:()=>Rs,RectangleGeometryUpdater:()=>G2,RectangleGraphics:()=>Um,RectangleOutlineGeometry:()=>U_,ReferenceFrame:()=>Ui,ReferenceProperty:()=>Yb,RenderState:()=>Oe,Renderbuffer:()=>md,RenderbufferFormat:()=>ac,Request:()=>Jo,RequestErrorEvent:()=>ih,RequestScheduler:()=>ic,RequestState:()=>jn,RequestType:()=>us,Resource:()=>Ge,ResourceCache:()=>Ri,ResourceCacheKey:()=>Fl,ResourceCacheStatistics:()=>fI,ResourceLoader:()=>Ji,ResourceLoaderState:()=>xt,Rotation:()=>qu,RuntimeError:()=>le,S2Cell:()=>Qp,SDFSettings:()=>Ys,SampledPositionProperty:()=>xa,SampledProperty:()=>Fd,Sampler:()=>en,ScaledPositionProperty:()=>Mh,Scene:()=>g9,SceneFramebuffer:()=>BT,SceneMode:()=>se,SceneMode2DPipelineStage:()=>cw,SceneModePicker:()=>KM,SceneModePickerViewModel:()=>zM,SceneTransforms:()=>Oi,SceneTransitioner:()=>wA,ScreenSpaceCameraController:()=>AA,ScreenSpaceEventHandler:()=>tu,ScreenSpaceEventType:()=>Vn,SelectedFeatureIdPipelineStage:()=>Wy,SelectionIndicator:()=>HM,SelectionIndicatorViewModel:()=>YM,SensorVolumePortionToDisplay:()=>eV,ShaderBuilder:()=>Lx,ShaderCache:()=>oE,ShaderDestination:()=>xe,ShaderFunction:()=>hE,ShaderProgram:()=>tn,ShaderSource:()=>Be,ShaderStruct:()=>fE,ShadowMap:()=>g0,ShadowMapShader:()=>cp,ShadowMode:()=>Sn,ShadowVolumeAppearance:()=>pd,ShowGeometryInstanceAttribute:()=>Tn,Simon1994PlanetaryPositions:()=>Y0,SimplePolylineGeometry:()=>U7,SingleTileImageryProvider:()=>sF,SkinningPipelineStage:()=>dw,SkyAtmosphere:()=>x9,SkyBox:()=>_9,SpatialNode:()=>f9,Spdcf:()=>AI,SpecularEnvironmentCubeMap:()=>Bm,SphereEmitter:()=>X6,SphereGeometry:()=>O7,SphereOutlineGeometry:()=>Ib,Spherical:()=>t2,Spline:()=>Pi,SplitDirection:()=>Ar,Splitter:()=>LL,StaticGeometryColorBatch:()=>nm,StaticGeometryPerMaterialBatch:()=>im,StaticGroundGeometryColorBatch:()=>gV,StaticGroundGeometryPerMaterialBatch:()=>P2,StaticGroundPolylinePerMaterialBatch:()=>Y2,StaticOutlineGeometryBatch:()=>TV,StencilConstants:()=>kt,StencilFunction:()=>On,StencilOperation:()=>ft,SteppedSpline:()=>$I,Stereographic:()=>pc,StorageType:()=>Ch,StripeMaterialProperty:()=>q1,StripeOrientation:()=>Sf,StructuralMetadata:()=>Ds,StyleCommandsNeeded:()=>sf,StyleExpression:()=>I6,Sun:()=>C9,SunLight:()=>Xp,SunPostProcess:()=>kA,SupportedImageFormats:()=>wI,SvgPathBindingHandler:()=>uM,TaskProcessor:()=>gi,Terrain:()=>sM,TerrainData:()=>Ff,TerrainEncoding:()=>Rc,TerrainFillMesh:()=>sL,TerrainMesh:()=>dm,TerrainOffsetProperty:()=>Jx,TerrainProvider:()=>rs,TerrainQuantization:()=>qs,TerrainState:()=>uo,Texture:()=>Pt,TextureAtlas:()=>Zx,TextureCache:()=>rE,TextureMagnificationFilter:()=>di,TextureManager:()=>c9,TextureMinificationFilter:()=>Jt,TexturePacker:()=>cC,TextureUniform:()=>U6,TextureWrap:()=>xn,TileAvailability:()=>Hf,TileBoundingRegion:()=>Xd,TileBoundingS2Cell:()=>bP,TileBoundingSphere:()=>Wb,TileBoundingVolume:()=>W6,TileCoordinatesImageryProvider:()=>cM,TileDiscardPolicy:()=>P6,TileEdge:()=>_n,TileImagery:()=>iL,TileMapServiceImageryProvider:()=>Rg,TileMetadata:()=>dP,TileOrientedBoundingBox:()=>Ol,TileProviderError:()=>Ro,TileReplacementQueue:()=>yF,TileSelectionResult:()=>Jn,TileState:()=>v6,Tileset3DTileContent:()=>Mw,TilesetMetadata:()=>yP,TilesetPipelineStage:()=>aW,TilingScheme:()=>D7,TimeConstants:()=>Kn,TimeDynamicImagery:()=>FT,TimeDynamicPointCloud:()=>RL,TimeInterval:()=>Zn,TimeIntervalCollection:()=>Yr,TimeIntervalCollectionPositionProperty:()=>Hb,TimeIntervalCollectionProperty:()=>zb,TimeStandard:()=>zn,Timeline:()=>jM,TimelineHighlightRange:()=>JM,TimelineTrack:()=>QM,Tipsify:()=>SZ,ToggleButtonViewModel:()=>Qg,Tonemapper:()=>_0,TrackingReferenceFrame:()=>vp,Transforms:()=>wt,TranslationRotationScale:()=>ey,TranslucentTileClassification:()=>rA,TridiagonalSystemSolver:()=>t1,TrustedServers:()=>JS,TweenCollection:()=>tS,UniformState:()=>cE,UniformType:()=>rS,UrlTemplateImageryProvider:()=>Ba,VERSION:()=>BVt,VRButton:()=>tN,VRButtonViewModel:()=>eN,VRTheWorldTerrainProvider:()=>Y7,VaryingType:()=>O6,Vector3DTileBatch:()=>bh,Vector3DTileClampedPolylines:()=>sP,Vector3DTileContent:()=>cP,Vector3DTileGeometry:()=>Jp,Vector3DTilePoints:()=>$w,Vector3DTilePolygons:()=>eP,Vector3DTilePolylines:()=>A_,Vector3DTilePrimitive:()=>o_,VelocityOrientationProperty:()=>i2,VelocityVectorProperty:()=>Kb,VertexArray:()=>ni,VertexArrayFacade:()=>Ip,VertexAttributeSemantic:()=>pt,VertexFormat:()=>We,VerticalExaggeration:()=>Lr,VerticalExaggerationPipelineStage:()=>mw,VerticalOrigin:()=>Mn,VideoSynchronizer:()=>B7,View:()=>zT,Viewer:()=>mq,ViewportQuad:()=>F6,Visibility:()=>yr,Visualizer:()=>Oj,VoxelBoxShape:()=>lS,VoxelCell:()=>DA,VoxelContent:()=>cS,VoxelCylinderShape:()=>dS,VoxelEllipsoidShape:()=>uS,VoxelInspector:()=>$M,VoxelInspectorViewModel:()=>qM,VoxelMetadataOrder:()=>gm,VoxelPrimitive:()=>Ng,VoxelProvider:()=>M6,VoxelRenderResources:()=>o9,VoxelShape:()=>N6,VoxelShapeType:()=>La,VoxelTraversal:()=>h9,VulkanConstants:()=>H7,WallGeometry:()=>X2,WallGeometryLibrary:()=>fT,WallGeometryUpdater:()=>w2,WallGraphics:()=>Dp,WallOutlineGeometry:()=>W2,WebGLConstants:()=>oe,WebMapServiceImageryProvider:()=>cF,WebMapTileServiceImageryProvider:()=>dF,WebMercatorProjection:()=>Wi,WebMercatorTilingScheme:()=>ss,WindingOrder:()=>qr,WireframeIndexGenerator:()=>l1,WireframePipelineStage:()=>fw,_shadersAcesTonemappingStage:()=>lA,_shadersAdditiveBlend:()=>MA,_shadersAdjustTranslucentFS:()=>kV,_shadersAllMaterialAppearanceFS:()=>_E,_shadersAllMaterialAppearanceVS:()=>TE,_shadersAmbientOcclusionGenerate:()=>dA,_shadersAmbientOcclusionModulate:()=>uA,_shadersAspectRampMaterial:()=>ZE,_shadersAtmosphereCommon:()=>$m,_shadersAtmosphereStageFS:()=>cW,_shadersAtmosphereStageVS:()=>lW,_shadersBasicMaterialAppearanceFS:()=>SE,_shadersBasicMaterialAppearanceVS:()=>CE,_shadersBillboardCollectionFS:()=>Nw,_shadersBillboardCollectionVS:()=>kw,_shadersBlackAndWhite:()=>mA,_shadersBloomComposite:()=>fA,_shadersBrdfLutGeneratorFS:()=>Ev,_shadersBrightPass:()=>NA,_shadersBrightness:()=>hA,_shadersBumpMapMaterial:()=>RE,_shadersCPUStylingStageFS:()=>PW,_shadersCPUStylingStageVS:()=>wW,_shadersCheckerboardMaterial:()=>GE,_shadersCloudCollectionFS:()=>Xv,_shadersCloudCollectionVS:()=>Iv,_shadersCloudNoiseFS:()=>Wv,_shadersCloudNoiseVS:()=>wv,_shadersCompareAndPackTranslucentDepth:()=>Pv,_shadersCompositeOITFS:()=>vv,_shadersCompositeTranslucentClassification:()=>HT,_shadersComputeIrradianceFS:()=>_I,_shadersComputeRadianceMapFS:()=>TI,_shadersContrastBias:()=>pA,_shadersConvolveSpecularMapFS:()=>SI,_shadersConvolveSpecularMapVS:()=>CI,_shadersCustomShaderStageFS:()=>AW,_shadersCustomShaderStageVS:()=>FW,_shadersCzmBuiltins:()=>Sx,_shadersDepthOfField:()=>bA,_shadersDepthPlaneFS:()=>Fv,_shadersDepthPlaneVS:()=>Av,_shadersDepthView:()=>yA,_shadersDepthViewPacked:()=>k6,_shadersDotMaterial:()=>EE,_shadersEdgeDetection:()=>gA,_shadersElevationBandMaterial:()=>XE,_shadersElevationContourMaterial:()=>IE,_shadersElevationRampMaterial:()=>WE,_shadersEllipsoidFS:()=>UV,_shadersEllipsoidSurfaceAppearanceFS:()=>H9,_shadersEllipsoidSurfaceAppearanceVS:()=>z9,_shadersEllipsoidVS:()=>OV,_shadersFXAA:()=>TA,_shadersFXAA3_11:()=>Mv,_shadersFadeMaterial:()=>wE,_shadersFeatureIdStageFS:()=>MW,_shadersFeatureIdStageVS:()=>NW,_shadersFilmicTonemapping:()=>xA,_shadersGaussianBlur1D:()=>vg,_shadersGeometryStageFS:()=>YW,_shadersGeometryStageVS:()=>HW,_shadersGlobeFS:()=>Nv,_shadersGlobeVS:()=>kv,_shadersGridMaterial:()=>PE,_shadersGroundAtmosphere:()=>DV,_shadersHSBToRGB:()=>iG,_shadersHSLToRGB:()=>oG,_shadersImageBasedLightingStageFS:()=>uW,_shadersInstancingStageCommon:()=>SW,_shadersInstancingStageVS:()=>CW,_shadersIntersectBox:()=>QA,_shadersIntersectClippingPlanes:()=>JA,_shadersIntersectCylinder:()=>jA,_shadersIntersectDepth:()=>KA,_shadersIntersectEllipsoid:()=>qA,_shadersIntersectLongitude:()=>xL,_shadersIntersection:()=>oS,_shadersIntersectionUtils:()=>zA,_shadersLegacyInstancingStageVS:()=>VW,_shadersLensFlare:()=>SA,_shadersLightingStageFS:()=>JW,_shadersMaterialStageFS:()=>jW,_shadersMegatexture:()=>i9,_shadersMetadataStageFS:()=>kW,_shadersMetadataStageVS:()=>UW,_shadersModelClippingPlanesStageFS:()=>bW,_shadersModelClippingPolygonsStageFS:()=>xW,_shadersModelClippingPolygonsStageVS:()=>gW,_shadersModelColorStageFS:()=>pW,_shadersModelFS:()=>Xw,_shadersModelSilhouetteStageFS:()=>gw,_shadersModelSilhouetteStageVS:()=>xw,_shadersModelSplitterStageFS:()=>Tw,_shadersModelVS:()=>Ew,_shadersModifiedReinhardTonemapping:()=>CA,_shadersMorphTargetsStageVS:()=>$W,_shadersNightVision:()=>VA,_shadersNormalMapMaterial:()=>vE,_shadersOctree:()=>n9,_shadersPassThrough:()=>td,_shadersPassThroughDepth:()=>Wg,_shadersPbrNeutralTonemapping:()=>_A,_shadersPerInstanceColorAppearanceFS:()=>HE,_shadersPerInstanceColorAppearanceVS:()=>zE,_shadersPerInstanceFlatColorAppearanceFS:()=>Xx,_shadersPerInstanceFlatColorAppearanceVS:()=>KE,_shadersPointCloudEyeDomeLighting:()=>DI,_shadersPointCloudStylingStageVS:()=>nw,_shadersPointPrimitiveCollectionFS:()=>Jy,_shadersPointPrimitiveCollectionVS:()=>BP,_shadersPolygonSignedDistanceFS:()=>gI,_shadersPolylineArrowMaterial:()=>FE,_shadersPolylineColorAppearanceVS:()=>lX,_shadersPolylineCommon:()=>bd,_shadersPolylineDashMaterial:()=>AE,_shadersPolylineFS:()=>Ax,_shadersPolylineGlowMaterial:()=>ME,_shadersPolylineMaterialAppearanceVS:()=>dX,_shadersPolylineOutlineMaterial:()=>NE,_shadersPolylineShadowVolumeFS:()=>rX,_shadersPolylineShadowVolumeMorphFS:()=>sX,_shadersPolylineShadowVolumeMorphVS:()=>aX,_shadersPolylineShadowVolumeVS:()=>cX,_shadersPolylineVS:()=>zw,_shadersPrimitiveOutlineStageFS:()=>rw,_shadersPrimitiveOutlineStageVS:()=>ow,_shadersRGBToHSB:()=>XG,_shadersRGBToHSL:()=>IG,_shadersRGBToXYZ:()=>WG,_shadersReinhardTonemapping:()=>LA,_shadersReprojectWebMercatorFS:()=>Uv,_shadersReprojectWebMercatorVS:()=>Ov,_shadersRimLightingMaterial:()=>kE,_shadersSelectedFeatureIdStageCommon:()=>c1,_shadersShadowVolumeAppearanceFS:()=>hC,_shadersShadowVolumeAppearanceVS:()=>jE,_shadersShadowVolumeFS:()=>Q0,_shadersSilhouette:()=>ZA,_shadersSkinningStageVS:()=>lw,_shadersSkyAtmosphereCommon:()=>BV,_shadersSkyAtmosphereFS:()=>Dv,_shadersSkyAtmosphereVS:()=>Bv,_shadersSkyBoxFS:()=>Yv,_shadersSkyBoxVS:()=>Hv,_shadersSlopeRampMaterial:()=>UE,_shadersStripeMaterial:()=>OE,_shadersSunFS:()=>zv,_shadersSunTextureFS:()=>Kv,_shadersSunVS:()=>Jv,_shadersTexturedMaterialAppearanceFS:()=>VE,_shadersTexturedMaterialAppearanceVS:()=>LE,_shadersVector3DTileClampedPolylinesFS:()=>oP,_shadersVector3DTileClampedPolylinesVS:()=>iP,_shadersVector3DTilePolylinesVS:()=>tP,_shadersVectorTileVS:()=>LC,_shadersVerticalExaggerationStageVS:()=>uw,_shadersViewportQuadFS:()=>Qv,_shadersViewportQuadVS:()=>fx,_shadersVoxelFS:()=>YA,_shadersVoxelUtils:()=>BA,_shadersVoxelVS:()=>HA,_shadersWater:()=>BE,_shadersWaterMaskMaterial:()=>DE,_shadersXYZToRGB:()=>nE,_shadersacesTonemapping:()=>TR,_shadersalphaWeight:()=>SR,_shadersantialias:()=>CR,_shadersapplyHSBShift:()=>VR,_shadersapproximateSphericalCoordinates:()=>LR,_shadersapproximateTanh:()=>ZR,_shadersbackFacing:()=>RR,_shadersbranchFreeTernary:()=>GR,_shaderscascadeColor:()=>ER,_shaderscascadeDistance:()=>XR,_shaderscascadeMatrix:()=>IR,_shaderscascadeWeights:()=>WR,_shadersclipPolygons:()=>wR,_shaderscolumbusViewMorph:()=>PR,_shaderscomputeAtmosphereColor:()=>vR,_shaderscomputeGroundAtmosphereScattering:()=>FR,_shaderscomputePosition:()=>AR,_shaderscomputeScattering:()=>MR,_shadersconvertUvToBox:()=>$A,_shadersconvertUvToCylinder:()=>e9,_shadersconvertUvToEllipsoid:()=>t9,_shaderscosineAndSine:()=>NR,_shadersdecompressTextureCoordinates:()=>kR,_shadersdegreesPerRadian:()=>EZ,_shadersdepthClamp:()=>UR,_shadersdepthRange:()=>XZ,_shadersdepthRangeStruct:()=>fR,_shaderseastNorthUpToEyeCoordinates:()=>OR,_shadersellipsoidContainsPoint:()=>DR,_shadersellipsoidTextureCoordinates:()=>BR,_shadersepsilon1:()=>IZ,_shadersepsilon2:()=>WZ,_shadersepsilon3:()=>wZ,_shadersepsilon4:()=>PZ,_shadersepsilon5:()=>vZ,_shadersepsilon6:()=>FZ,_shadersepsilon7:()=>AZ,_shadersequalsEpsilon:()=>YR,_shaderseyeOffset:()=>HR,_shaderseyeToWindowCoordinates:()=>zR,_shadersfastApproximateAtan:()=>KR,_shadersfog:()=>JR,_shadersgammaCorrect:()=>QR,_shadersgeodeticSurfaceNormal:()=>jR,_shadersgetDefaultMaterial:()=>qR,_shadersgetDynamicAtmosphereLightDirection:()=>$R,_shadersgetLambertDiffuse:()=>eG,_shadersgetSpecular:()=>tG,_shadersgetWaterNoise:()=>nG,_shadershue:()=>rG,_shadersinfinity:()=>MZ,_shadersinverseGamma:()=>sG,_shadersisEmpty:()=>aG,_shadersisFull:()=>cG,_shaderslatitudeToWebMercatorFraction:()=>lG,_shaderslineDistance:()=>uG,_shaderslinearToSrgb:()=>dG,_shadersluminance:()=>mG,_shadersmaterial:()=>hR,_shadersmaterialInput:()=>pR,_shadersmaximumComponent:()=>fG,_shadersmetersPerPixel:()=>hG,_shadersmodelMaterial:()=>bR,_shadersmodelToWindowCoordinates:()=>pG,_shadersmodelVertexOutput:()=>yR,_shadersmultiplyWithColorBalance:()=>bG,_shadersnearFarScalar:()=>yG,_shadersoctDecode:()=>gG,_shadersoneOverPi:()=>NZ,_shadersoneOverTwoPi:()=>kZ,_shaderspackDepth:()=>xG,_shaderspassCesium3DTile:()=>UZ,_shaderspassCesium3DTileClassification:()=>OZ,_shaderspassCesium3DTileClassificationIgnoreShow:()=>DZ,_shaderspassClassification:()=>BZ,_shaderspassCompute:()=>YZ,_shaderspassEnvironment:()=>HZ,_shaderspassGlobe:()=>zZ,_shaderspassOpaque:()=>KZ,_shaderspassOverlay:()=>JZ,_shaderspassTerrainClassification:()=>QZ,_shaderspassTranslucent:()=>jZ,_shaderspassVoxels:()=>qZ,_shaderspbrLighting:()=>_G,_shaderspbrNeutralTonemapping:()=>TG,_shadersphong:()=>SG,_shaderspi:()=>$Z,_shaderspiOverFour:()=>eR,_shaderspiOverSix:()=>tR,_shaderspiOverThree:()=>nR,_shaderspiOverTwo:()=>iR,_shadersplaneDistance:()=>CG,_shaderspointAlongRay:()=>VG,_shadersradiansPerDegree:()=>oR,_shadersray:()=>gR,_shadersrayEllipsoidIntersectionInterval:()=>LG,_shadersraySegment:()=>xR,_shadersraySphereIntersectionInterval:()=>ZG,_shadersreadDepth:()=>RG,_shadersreadNonPerspective:()=>GG,_shadersreverseLogDepth:()=>EG,_shadersround:()=>wG,_shaderssaturation:()=>PG,_shaderssceneMode2D:()=>rR,_shaderssceneMode3D:()=>sR,_shaderssceneModeColumbusView:()=>aR,_shaderssceneModeMorphing:()=>cR,_shadersshadowDepthCompare:()=>vG,_shadersshadowParameters:()=>_R,_shadersshadowVisibility:()=>FG,_shaderssignNotZero:()=>AG,_shaderssolarRadius:()=>lR,_shaderssphericalHarmonics:()=>MG,_shaderssrgbToLinear:()=>NG,_shaderstangentToEyeSpaceMatrix:()=>kG,_shaderstextureCube:()=>UG,_shadersthreePiOver2:()=>dR,_shaderstransformPlane:()=>OG,_shaderstranslateRelativeToEye:()=>DG,_shaderstranslucentPhong:()=>BG,_shaderstranspose:()=>YG,_shaderstwoPi:()=>uR,_shadersunpackClippingExtents:()=>HG,_shadersunpackDepth:()=>zG,_shadersunpackFloat:()=>KG,_shadersunpackUint:()=>JG,_shadersvalueTransform:()=>QG,_shadersvertexLogDepth:()=>jG,_shaderswebMercatorMaxLatitude:()=>mR,_shaderswindowToEyeCoordinates:()=>qG,_shaderswriteDepthClamp:()=>$G,_shaderswriteLogDepth:()=>eE,_shaderswriteNonPerspective:()=>tE,addBuffer:()=>tI,addDefaults:()=>zX,addExtensionsRequired:()=>qX,addExtensionsUsed:()=>wu,addPipelineExtras:()=>my,addToArray:()=>Vs,appendForwardSlash:()=>$L,arrayRemoveDuplicates:()=>xo,barycentricCoordinates:()=>px,binarySearch:()=>Wo,buildModuleUrl:()=>on,buildVoxelDrawCommands:()=>s9,clone:()=>He,combine:()=>St,computeFlyToLocationForRectangle:()=>WT,createBillboardPointCallback:()=>w_,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>_M,createDefaultTerrainProviderViewModels:()=>TM,createElevationBandMaterial:()=>s6,createGooglePhotorealistic3DTileset:()=>a6,createGuid:()=>Hn,createMaterialPropertyDescriptor:()=>wo,createOsmBuildingsAsync:()=>c6,createPropertyDescriptor:()=>fe,createRawPropertyDescriptor:()=>Dc,createTangentSpaceDebugPrimitive:()=>l6,createTaskProcessorWorker:()=>B6,createUniform:()=>fZ,createUniformArray:()=>hZ,createWorldBathymetryAsync:()=>I9,createWorldImageryAsync:()=>m0,createWorldTerrainAsync:()=>TS,decodeGoogleEarthEnterpriseData:()=>W9,decodeVectorPolylinePositions:()=>aP,defaultValue:()=>g7,defer:()=>Cl,defined:()=>c,demodernizeShader:()=>iE,deprecationWarning:()=>Cs,destroyObject:()=>he,exportKml:()=>jQ,findAccessorMinMax:()=>m_,findContentMetadata:()=>N_,findGroupMetadata:()=>k_,findTileMetadata:()=>uP,forEachTextureInMaterial:()=>PC,formatError:()=>qh,freezeRenderState:()=>mZ,getAbsoluteUri:()=>th,getAccessorByteStride:()=>Pl,getBaseUri:()=>eZ,getBinaryAccessor:()=>_d,getClipAndStyleCode:()=>V9,getClippingFunction:()=>c0,getComponentReader:()=>nb,getElement:()=>Wn,getExtensionFromUri:()=>ox,getFilenameFromUri:()=>Ob,getImageFromTypedArray:()=>a9,getImagePixels:()=>Rm,getJsonFromTypedArray:()=>er,getMagic:()=>Hm,getMetadataClassProperty:()=>p9,getMetadataProperty:()=>y9,getStringFromTypedArray:()=>Il,getTimestamp:()=>Ti,hasExtension:()=>ri,heightReferenceOnEntityPropertyChanged:()=>Bp,isBitSet:()=>Wc,isBlobUri:()=>rx,isCrossOriginUrl:()=>F0,isDataUri:()=>Sp,isLeapYear:()=>Lm,knockout:()=>Se,knockout_3_5_1:()=>vS,knockout_es5:()=>dM,loadAndExecuteScript:()=>sx,loadCubeMap:()=>mE,loadImageFromTypedArray:()=>l_,loadKTX2:()=>Ll,mergeSort:()=>h0,moveTechniqueRenderStates:()=>jX,moveTechniquesToExtension:()=>$X,numberOfComponentsForType:()=>Sd,objectToQuery:()=>ax,oneTimeWarning:()=>ht,parseBatchTable:()=>mb,parseFeatureMetadataLegacy:()=>II,parseGlb:()=>JX,parseResponseHeaders:()=>tZ,parseStructuralMetadata:()=>XI,pickModel:()=>m1,pointInsideTriangle:()=>N7,preprocess3DTileContent:()=>Gb,processVoxelProperties:()=>r9,queryToObject:()=>ld,readAccessorPacked:()=>nI,removeExtension:()=>f_,removeExtensionsRequired:()=>KX,removeExtensionsUsed:()=>u_,removePipelineExtras:()=>QX,removeUnusedElements:()=>eI,resizeImageToNextPowerOfTwo:()=>py,sampleTerrain:()=>jv,sampleTerrainMostDetailed:()=>IT,scaleToGeodeticSurface:()=>ix,srgbToLinear:()=>LS,subdivideArray:()=>qE,subscribeAndEvaluate:()=>Za,updateAccessorComponentTypes:()=>iI,updateVersion:()=>oI,usesExtension:()=>ur,viewerCesium3DTilesInspectorMixin:()=>fq,viewerCesiumInspectorMixin:()=>hq,viewerDragDropMixin:()=>bq,viewerPerformanceWatchdogMixin:()=>yq,viewerVoxelInspectorMixin:()=>gq,webGLConstantToGlslType:()=>z7,wrapFunction:()=>A9,writeTextToCanvas:()=>v_});var dNo=_(T(),1);var Spo=_(T(),1);var qLt=_(T(),1);var bLt=_(T(),1);var iLt=_(T(),1);var QVt=_(T(),1);function g1e(e){return e!=null}var c=g1e;var $Vt=_(T(),1);function tx(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(tx.prototype=Object.create(Error.prototype),tx.prototype.constructor=tx);tx.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=`
${this.stack.toString()}`),e};tx.throwInstantiationError=function(){throw new tx("This function defines an interface and should not be called directly.")};var L=tx;var Ts={};Ts.typeOf={};function x1e(e){return`${e} is required, actual value was undefined`}function NS(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}Ts.defined=function(e,t){if(!c(t))throw new L(x1e(e))};Ts.typeOf.func=function(e,t){if(typeof t!="function")throw new L(NS(typeof t,"function",e))};Ts.typeOf.string=function(e,t){if(typeof t!="string")throw new L(NS(typeof t,"string",e))};Ts.typeOf.number=function(e,t){if(typeof t!="number")throw new L(NS(typeof t,"number",e))};Ts.typeOf.number.lessThan=function(e,t,n){if(Ts.typeOf.number(e,t),t>=n)throw new L(`Expected ${e} to be less than ${n}, actual value was ${t}`)};Ts.typeOf.number.lessThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t>n)throw new L(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThan=function(e,t,n){if(Ts.typeOf.number(e,t),t<=n)throw new L(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};Ts.typeOf.number.greaterThanOrEquals=function(e,t,n){if(Ts.typeOf.number(e,t),t<n)throw new L(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};Ts.typeOf.object=function(e,t){if(typeof t!="object")throw new L(NS(typeof t,"object",e))};Ts.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new L(NS(typeof t,"boolean",e))};Ts.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new L(NS(typeof t,"bigint",e))};Ts.typeOf.number.equals=function(e,t,n,i){if(Ts.typeOf.number(e,n),Ts.typeOf.number(t,i),n!==i)throw new L(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var C=Ts;var dLt=_(T(),1),JB=_(oN(),1);var ct={};ct.EPSILON1=.1;ct.EPSILON2=.01;ct.EPSILON3=.001;ct.EPSILON4=1e-4;ct.EPSILON5=1e-5;ct.EPSILON6=1e-6;ct.EPSILON7=1e-7;ct.EPSILON8=1e-8;ct.EPSILON9=1e-9;ct.EPSILON10=1e-10;ct.EPSILON11=1e-11;ct.EPSILON12=1e-12;ct.EPSILON13=1e-13;ct.EPSILON14=1e-14;ct.EPSILON15=1e-15;ct.EPSILON16=1e-16;ct.EPSILON17=1e-17;ct.EPSILON18=1e-18;ct.EPSILON19=1e-19;ct.EPSILON20=1e-20;ct.EPSILON21=1e-21;ct.GRAVITATIONALPARAMETER=3986004418e5;ct.SOLAR_RADIUS=6955e5;ct.LUNAR_RADIUS=1737400;ct.SIXTY_FOUR_KILOBYTES=64*1024;ct.FOUR_GIGABYTES=4*1024*1024*1024;ct.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};ct.signNotZero=function(e){return e<0?-1:1};ct.toSNorm=function(e,t){return t=t??255,Math.round((ct.clamp(e,-1,1)*.5+.5)*t)};ct.fromSNorm=function(e,t){return t=t??255,ct.clamp(e,0,t)/t*2-1};ct.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:ct.clamp((e-t)/n,0,1)};ct.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};ct.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};ct.lerp=function(e,t,n){return(1-n)*e+n*t};ct.PI=Math.PI;ct.ONE_OVER_PI=1/Math.PI;ct.PI_OVER_TWO=Math.PI/2;ct.PI_OVER_THREE=Math.PI/3;ct.PI_OVER_FOUR=Math.PI/4;ct.PI_OVER_SIX=Math.PI/6;ct.THREE_PI_OVER_TWO=3*Math.PI/2;ct.TWO_PI=2*Math.PI;ct.ONE_OVER_TWO_PI=1/(2*Math.PI);ct.RADIANS_PER_DEGREE=Math.PI/180;ct.DEGREES_PER_RADIAN=180/Math.PI;ct.RADIANS_PER_ARCSECOND=ct.RADIANS_PER_DEGREE/3600;ct.toRadians=function(e){if(!c(e))throw new L("degrees is required.");return e*ct.RADIANS_PER_DEGREE};ct.toDegrees=function(e){if(!c(e))throw new L("radians is required.");return e*ct.DEGREES_PER_RADIAN};ct.convertLongitudeRange=function(e){if(!c(e))throw new L("angle is required.");let t=ct.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};ct.clampToLatitudeRange=function(e){if(!c(e))throw new L("angle is required.");return ct.clamp(e,-1*ct.PI_OVER_TWO,ct.PI_OVER_TWO)};ct.negativePiToPi=function(e){if(!c(e))throw new L("angle is required.");return e>=-ct.PI&&e<=ct.PI?e:ct.zeroToTwoPi(e+ct.PI)-ct.PI};ct.zeroToTwoPi=function(e){if(!c(e))throw new L("angle is required.");if(e>=0&&e<=ct.TWO_PI)return e;let t=ct.mod(e,ct.TWO_PI);return Math.abs(t)<ct.EPSILON14&&Math.abs(e)>ct.EPSILON14?ct.TWO_PI:t};ct.mod=function(e,t){if(!c(e))throw new L("m is required.");if(!c(t))throw new L("n is required.");if(t===0)throw new L("divisor cannot be 0.");return ct.sign(e)===ct.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};ct.equalsEpsilon=function(e,t,n,i){if(!c(e))throw new L("left is required.");if(!c(t))throw new L("right is required.");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))};ct.lessThan=function(e,t,n){if(!c(e))throw new L("first is required.");if(!c(t))throw new L("second is required.");if(!c(n))throw new L("absoluteEpsilon is required.");return e-t<-n};ct.lessThanOrEquals=function(e,t,n){if(!c(e))throw new L("first is required.");if(!c(t))throw new L("second is required.");if(!c(n))throw new L("absoluteEpsilon is required.");return e-t<n};ct.greaterThan=function(e,t,n){if(!c(e))throw new L("first is required.");if(!c(t))throw new L("second is required.");if(!c(n))throw new L("absoluteEpsilon is required.");return e-t>n};ct.greaterThanOrEquals=function(e,t,n){if(!c(e))throw new L("first is required.");if(!c(t))throw new L("second is required.");if(!c(n))throw new L("absoluteEpsilon is required.");return e-t>-n};var rN=[1];ct.factorial=function(e){if(typeof e!="number"||e<0)throw new L("A number greater than or equal to 0 is required.");let t=rN.length;if(e>=t){let n=rN[t-1];for(let i=t;i<=e;i++){let o=n*i;rN.push(o),n=o}}return rN[e]};ct.incrementWrap=function(e,t,n){if(n=n??0,!c(e))throw new L("n is required.");if(t<=n)throw new L("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};ct.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new L("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};ct.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new L("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};ct.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new L("A number between 0 and (2^32)-1 is required.");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};ct.clamp=function(e,t,n){return C.typeOf.number("value",e),C.typeOf.number("min",t),C.typeOf.number("max",n),e<t?t:e>n?n:e};var Cq=new JB.default;ct.setRandomNumberSeed=function(e){if(!c(e))throw new L("seed is required.");Cq=new JB.default(e)};ct.nextRandomNumber=function(){return Cq.random()};ct.randomBetween=function(e,t){return ct.nextRandomNumber()*(t-e)+e};ct.acosClamped=function(e){if(!c(e))throw new L("value is required.");return Math.acos(ct.clamp(e,-1,1))};ct.asinClamped=function(e){if(!c(e))throw new L("value is required.");return Math.asin(ct.clamp(e,-1,1))};ct.chordLength=function(e,t){if(!c(e))throw new L("angle is required.");if(!c(t))throw new L("radius is required.");return 2*t*Math.sin(e*.5)};ct.logBase=function(e,t){if(!c(e))throw new L("number is required.");if(!c(t))throw new L("base is required.");return Math.log(e)/Math.log(t)};ct.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};ct.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};ct.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};ct.fastApproximateAtan=function(e){return C.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};ct.fastApproximateAtan2=function(e,t){C.typeOf.number("x",e),C.typeOf.number("y",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;if(isNaN(r))throw new L("either x or y must be nonzero");return i=ct.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?ct.PI_OVER_TWO-i:i,i=e<0?ct.PI-i:i,i=t<0?-i:i,i};var w=ct;function tt(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}tt.fromSpherical=function(e,t){C.typeOf.object("spherical",e),c(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 c(i)?(i.x=e,i.y=t,i.z=n,i):new tt(e,t,n)};tt.clone=function(e,t){if(c(e))return c(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 C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};tt.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new tt),n.x=e[t++],n.y=e[t++],n.z=e[t],n};tt.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*3;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)tt.pack(e[o],t,o*3);return t};tt.unpackArray=function(e,t){if(C.defined("array",e),C.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new L("array length must be a multiple of 3.");let n=e.length;c(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 C.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)};tt.minimumComponent=function(e){return C.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)};tt.minimumByComponent=function(e,t,n){return C.typeOf.object("first",e),C.typeOf.object("second",t),C.typeOf.object("result",n),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 C.typeOf.object("first",e),C.typeOf.object("second",t),C.typeOf.object("result",n),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){C.typeOf.object("value",e),C.typeOf.object("min",t),C.typeOf.object("max",n),C.typeOf.object("result",i);let o=w.clamp(e.x,t.x,n.x),r=w.clamp(e.y,t.y,n.y),s=w.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};tt.magnitudeSquared=function(e){return C.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z};tt.magnitude=function(e){return Math.sqrt(tt.magnitudeSquared(e))};var aN=new tt;tt.distance=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),tt.subtract(e,t,aN),tt.magnitude(aN)};tt.distanceSquared=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),tt.subtract(e,t,aN),tt.magnitudeSquared(aN)};tt.normalize=function(e,t){C.typeOf.object("cartesian",e),C.typeOf.object("result",t);let n=tt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new L("normalized result is not a number");return t};tt.dot=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z};tt.multiplyComponents=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("cartesian",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};tt.divideByScalar=function(e,t,n){return C.typeOf.object("cartesian",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};tt.negate=function(e,t){return C.typeOf.object("cartesian",e),C.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t};tt.abs=function(e,t){return C.typeOf.object("cartesian",e),C.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var Vq=new tt;tt.lerp=function(e,t,n,i){return C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i),tt.multiplyByScalar(t,n,Vq),i=tt.multiplyByScalar(e,1-n,i),tt.add(Vq,i,i)};var sN=new tt,QB=new tt;tt.angleBetween=function(e,t){C.typeOf.object("left",e),C.typeOf.object("right",t),tt.normalize(e,sN),tt.normalize(t,QB);let n=tt.dot(sN,QB),i=tt.magnitude(tt.cross(sN,QB,sN));return Math.atan2(i,n)};var _1e=new tt;tt.mostOrthogonalAxis=function(e,t){C.typeOf.object("cartesian",e),C.typeOf.object("result",t);let n=tt.normalize(e,_1e);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){C.defined("a",e),C.defined("b",t),C.defined("result",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||c(e)&&c(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||c(e)&&c(t)&&w.equalsEpsilon(e.x,t.x,n,i)&&w.equalsEpsilon(e.y,t.y,n,i)&&w.equalsEpsilon(e.z,t.z,n,i)};tt.cross=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,l=t.z,d=o*l-r*a,u=r*s-i*l,f=i*a-o*s;return n.x=d,n.y=u,n.z=f,n};tt.midpoint=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.number("longitude",e),C.typeOf.number("latitude",t),e=w.toRadians(e),t=w.toRadians(t),tt.fromRadians(e,t,n,i,o)};var hu=new tt,kS=new tt;tt._ellipsoidRadiiSquared=new tt(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);tt.fromRadians=function(e,t,n,i,o){C.typeOf.number("longitude",e),C.typeOf.number("latitude",t),n=n??0;let r=c(i)?i.radiiSquared:tt._ellipsoidRadiiSquared,s=Math.cos(t);hu.x=s*Math.cos(e),hu.y=s*Math.sin(e),hu.z=Math.sin(t),hu=tt.normalize(hu,hu),tt.multiplyComponents(r,hu,kS);let a=Math.sqrt(tt.dot(hu,kS));return kS=tt.divideByScalar(kS,a,kS),hu=tt.multiplyByScalar(hu,n,hu),c(o)||(o=new tt),tt.add(kS,hu,o)};tt.fromDegreesArray=function(e,t,n){if(C.defined("coordinates",e),e.length<2||e.length%2!==0)throw new L("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(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){if(C.defined("coordinates",e),e.length<2||e.length%2!==0)throw new L("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(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){if(C.defined("coordinates",e),e.length<3||e.length%3!==0)throw new L("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(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],l=o/3;n[l]=tt.fromDegrees(r,s,a,t,n[l])}return n};tt.fromRadiansArrayHeights=function(e,t,n){if(C.defined("coordinates",e),e.length<3||e.length%3!==0)throw new L("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(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],l=o/3;n[l]=tt.fromRadians(r,s,a,t,n[l])}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 m=tt;var YLt=_(T(),1);var SLt=_(T(),1);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 c(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 C.typeOf.object("color",e),c(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(c(e))return c(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 C.typeOf.object("value",e),C.defined("array",t),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 C.defined("array",e),t=t??0,c(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){C.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Tt.pack(e[o],t,o*4);return t};Tt.unpackArray=function(e,t){if(C.defined("array",e),C.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new L("array length must be a multiple of 4.");let n=e.length;c(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 C.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};Tt.minimumComponent=function(e){return C.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};Tt.minimumByComponent=function(e,t,n){return C.typeOf.object("first",e),C.typeOf.object("second",t),C.typeOf.object("result",n),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 C.typeOf.object("first",e),C.typeOf.object("second",t),C.typeOf.object("result",n),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){C.typeOf.object("value",e),C.typeOf.object("min",t),C.typeOf.object("max",n),C.typeOf.object("result",i);let o=w.clamp(e.x,t.x,n.x),r=w.clamp(e.y,t.y,n.y),s=w.clamp(e.z,t.z,n.z),a=w.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 C.typeOf.object("cartesian",e),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 cN=new Tt;Tt.distance=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),Tt.subtract(e,t,cN),Tt.magnitude(cN)};Tt.distanceSquared=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),Tt.subtract(e,t,cN),Tt.magnitudeSquared(cN)};Tt.normalize=function(e,t){C.typeOf.object("cartesian",e),C.typeOf.object("result",t);let n=Tt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new L("normalized result is not a number");return t};Tt.dot=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};Tt.multiplyComponents=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("cartesian",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),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 C.typeOf.object("cartesian",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),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 C.typeOf.object("cartesian",e),C.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};Tt.abs=function(e,t){return C.typeOf.object("cartesian",e),C.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var Lq=new Tt;Tt.lerp=function(e,t,n,i){return C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i),Tt.multiplyByScalar(t,n,Lq),i=Tt.multiplyByScalar(e,1-n,i),Tt.add(Lq,i,i)};var T1e=new Tt;Tt.mostOrthogonalAxis=function(e,t){C.typeOf.object("cartesian",e),C.typeOf.object("result",t);let n=Tt.normalize(e,T1e);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||c(e)&&c(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||c(e)&&c(t)&&w.equalsEpsilon(e.x,t.x,n,i)&&w.equalsEpsilon(e.y,t.y,n,i)&&w.equalsEpsilon(e.z,t.z,n,i)&&w.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 jB=new Float32Array(1),$a=new Uint8Array(jB.buffer),S1e=new Uint32Array([287454020]),C1e=new Uint8Array(S1e.buffer),Zq=C1e[0]===68;Tt.packFloat=function(e,t){return C.typeOf.number("value",e),c(t)||(t=new Tt),jB[0]=e,Zq?(t.x=$a[0],t.y=$a[1],t.z=$a[2],t.w=$a[3]):(t.x=$a[3],t.y=$a[2],t.z=$a[1],t.w=$a[0]),t};Tt.unpackFloat=function(e){return C.typeOf.object("packedFloat",e),Zq?($a[0]=e.x,$a[1]=e.y,$a[2]=e.z,$a[3]=e.w):($a[0]=e.w,$a[1]=e.z,$a[2]=e.y,$a[3]=e.x),jB[0]};var ce=Tt;var VLt=_(T(),1),qB={};qB.EMPTY_OBJECT=Object.freeze({});qB.EMPTY_ARRAY=Object.freeze([]);var z=qB;var ILt=_(T(),1);function it(e,t,n,i,o,r,s,a,l){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]=l??0}it.packedLength=9;it.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),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};it.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(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};it.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*9;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)it.pack(e[o],t,o*9);return t};it.unpackArray=function(e,t){if(C.defined("array",e),C.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new L("array length must be a multiple of 9.");let n=e.length;c(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=it.unpack(e,i,t[o])}return t};it.clone=function(e,t){if(c(e))return c(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 it(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};it.fromArray=it.unpack;it.fromColumnMajorArray=function(e,t){return C.defined("values",e),it.clone(e,t)};it.fromRowMajorArray=function(e,t){return C.defined("values",e),c(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 it(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};it.fromQuaternion=function(e,t){C.typeOf.object("quaternion",e);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,l=e.y*e.w,d=e.z*e.z,u=e.z*e.w,f=e.w*e.w,p=n-s-d+f,y=2*(i-u),h=2*(o+l),g=2*(i+u),x=-n+s-d+f,S=2*(a-r),V=2*(o-l),Z=2*(a+r),R=-n-s+d+f;return c(t)?(t[0]=p,t[1]=g,t[2]=V,t[3]=y,t[4]=x,t[5]=Z,t[6]=h,t[7]=S,t[8]=R,t):new it(p,y,h,g,x,S,V,Z,R)};it.fromHeadingPitchRoll=function(e,t){C.typeOf.object("headingPitchRoll",e);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),l=n*i,d=-o*s+a*r*i,u=a*s+o*r*i,f=n*s,p=o*i+a*r*s,y=-a*i+o*r*s,h=-r,g=a*n,x=o*n;return c(t)?(t[0]=l,t[1]=f,t[2]=h,t[3]=d,t[4]=p,t[5]=g,t[6]=u,t[7]=y,t[8]=x,t):new it(l,d,u,f,p,y,h,g,x)};it.fromScale=function(e,t){return C.typeOf.object("scale",e),c(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 it(e.x,0,0,0,e.y,0,0,0,e.z)};it.fromUniformScale=function(e,t){return C.typeOf.number("scale",e),c(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 it(e,0,0,0,e,0,0,0,e)};it.fromCrossProduct=function(e,t){return C.typeOf.object("vector",e),c(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 it(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};it.fromRotationX=function(e,t){C.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 it(1,0,0,0,n,-i,0,i,n)};it.fromRotationY=function(e,t){C.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 it(n,0,i,0,1,0,-i,0,n)};it.fromRotationZ=function(e,t){C.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(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 it(n,-i,0,i,n,0,0,0,1)};it.toArray=function(e,t){return C.typeOf.object("matrix",e),c(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]]};it.getElementIndex=function(e,t){return C.typeOf.number.greaterThanOrEquals("row",t,0),C.typeOf.number.lessThanOrEquals("row",t,2),C.typeOf.number.greaterThanOrEquals("column",e,0),C.typeOf.number.lessThanOrEquals("column",e,2),e*3+t};it.getColumn=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,2),C.typeOf.object("result",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};it.setColumn=function(e,t,n,i){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,2),C.typeOf.object("cartesian",n),C.typeOf.object("result",i),i=it.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};it.getRow=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,2),C.typeOf.object("result",n);let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};it.setRow=function(e,t,n,i){return C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,2),C.typeOf.object("cartesian",n),C.typeOf.object("result",i),i=it.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var V1e=new m;it.setScale=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("scale",t),C.typeOf.object("result",n);let i=it.getScale(e,V1e),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 L1e=new m;it.setUniformScale=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number("scale",t),C.typeOf.object("result",n);let i=it.getScale(e,L1e),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 $B=new m;it.getScale=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],$B)),t.y=m.magnitude(m.fromElements(e[3],e[4],e[5],$B)),t.z=m.magnitude(m.fromElements(e[6],e[7],e[8],$B)),t};var Rq=new m;it.getMaximumScale=function(e){return it.getScale(e,Rq),m.maximumComponent(Rq)};var Z1e=new m;it.setRotation=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("result",n);let i=it.getScale(e,Z1e);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 R1e=new m;it.getRotation=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=it.getScale(e,R1e);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};it.multiply=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",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],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],d=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=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]=l,n[6]=d,n[7]=u,n[8]=f,n};it.add=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};it.subtract=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};it.multiplyByVector=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("cartesian",t),C.typeOf.object("result",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,l=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=l,n};it.multiplyByScalar=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),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};it.multiplyByScale=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.object("scale",t),C.typeOf.object("result",n),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};it.multiplyByUniformScale=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.number("scale",t),C.typeOf.object("result",n),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};it.negate=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};it.transpose=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],l=e[2],d=e[5],u=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=l,t[7]=d,t[8]=u,t};function G1e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var e3=[1,0,0],t3=[2,2,1];function E1e(e){let t=0;for(let n=0;n<3;++n){let i=e[it.getElementIndex(t3[n],e3[n])];t+=2*i*i}return Math.sqrt(t)}function X1e(e,t){let n=w.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[it.getElementIndex(t3[d],e3[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=e3[o],l=t3[o];if(Math.abs(e[it.getElementIndex(l,a)])>n){let d=e[it.getElementIndex(l,l)],u=e[it.getElementIndex(a,a)],f=e[it.getElementIndex(l,a)],p=(d-u)/2/f,y;p<0?y=-1/(-p+Math.sqrt(1+p*p)):y=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+y*y),s=y*r}return t=it.clone(it.IDENTITY,t),t[it.getElementIndex(a,a)]=t[it.getElementIndex(l,l)]=r,t[it.getElementIndex(l,a)]=s,t[it.getElementIndex(a,l)]=-s,t}var lN=new it,Gq=new it;it.computeEigenDecomposition=function(e,t){C.typeOf.object("matrix",e);let n=w.EPSILON20,i=10,o=0,r=0;c(t)||(t={});let s=t.unitary=it.clone(it.IDENTITY,t.unitary),a=t.diagonal=it.clone(e,t.diagonal),l=n*G1e(a);for(;r<i&&E1e(a)>l;)X1e(a,lN),it.transpose(lN,Gq),it.multiply(a,lN,a),it.multiply(Gq,a,a),it.multiply(s,lN,s),++o>2&&(++r,o=0);return t};it.abs=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};it.determinant=function(e){C.typeOf.object("matrix",e);let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],l=e[5],d=e[8];return t*(r*d-l*s)+o*(l*i-n*d)+a*(n*s-r*i)};it.inverse=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],d=e[7],u=e[8],f=it.determinant(e);if(Math.abs(f)<=w.EPSILON15)throw new L("matrix is not invertible");t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=l*a-r*u,t[4]=n*u-l*o,t[5]=r*o-n*a,t[6]=r*d-l*s,t[7]=l*i-n*d,t[8]=n*s-r*i;let p=1/f;return it.multiplyByScalar(t,p,t)};var I1e=new it;it.inverseTranspose=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),it.inverse(it.transpose(e,I1e),t)};it.equals=function(e,t){return e===t||c(e)&&c(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]};it.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};it.IDENTITY=Object.freeze(new it(1,0,0,0,1,0,0,0,1));it.ZERO=Object.freeze(new it(0,0,0,0,0,0,0,0,0));it.COLUMN0ROW0=0;it.COLUMN0ROW1=1;it.COLUMN0ROW2=2;it.COLUMN1ROW0=3;it.COLUMN1ROW1=4;it.COLUMN1ROW2=5;it.COLUMN2ROW0=6;it.COLUMN2ROW1=7;it.COLUMN2ROW2=8;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]};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var te=it;var PLt=_(T(),1);function QL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(QL.prototype=Object.create(Error.prototype),QL.prototype.constructor=QL);QL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=`
${this.stack.toString()}`),e};var le=QL;function nt(e,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g){this[0]=e??0,this[1]=o??0,this[2]=l??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=d??0,this[7]=y??0,this[8]=n??0,this[9]=s??0,this[10]=u??0,this[11]=h??0,this[12]=i??0,this[13]=a??0,this[14]=f??0,this[15]=g??0}nt.packedLength=16;nt.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),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};nt.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new nt),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};nt.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*16;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)nt.pack(e[o],t,o*16);return t};nt.unpackArray=function(e,t){if(C.defined("array",e),C.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new L("array length must be a multiple of 16.");let n=e.length;c(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=nt.unpack(e,i,t[o])}return t};nt.clone=function(e,t){if(c(e))return c(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 nt(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])};nt.fromArray=nt.unpack;nt.fromColumnMajorArray=function(e,t){return C.defined("values",e),nt.clone(e,t)};nt.fromRowMajorArray=function(e,t){return C.defined("values",e),c(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 nt(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])};nt.fromRotationTranslation=function(e,t,n){return C.typeOf.object("rotation",e),t=t??m.ZERO,c(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 nt(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)};nt.fromTranslationQuaternionRotationScale=function(e,t,n,i){C.typeOf.object("translation",e),C.typeOf.object("rotation",t),C.typeOf.object("scale",n),c(i)||(i=new nt);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,l=t.x*t.y,d=t.x*t.z,u=t.x*t.w,f=t.y*t.y,p=t.y*t.z,y=t.y*t.w,h=t.z*t.z,g=t.z*t.w,x=t.w*t.w,S=a-f-h+x,V=2*(l-g),Z=2*(d+y),R=2*(l+g),E=-a+f-h+x,I=2*(p-u),v=2*(d-y),P=2*(p+u),F=-a-f+h+x;return i[0]=S*o,i[1]=R*o,i[2]=v*o,i[3]=0,i[4]=V*r,i[5]=E*r,i[6]=P*r,i[7]=0,i[8]=Z*s,i[9]=I*s,i[10]=F*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};nt.fromTranslationRotationScale=function(e,t){return C.typeOf.object("translationRotationScale",e),nt.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};nt.fromTranslation=function(e,t){return C.typeOf.object("translation",e),nt.fromRotationTranslation(te.IDENTITY,e,t)};nt.fromScale=function(e,t){return C.typeOf.object("scale",e),c(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 nt(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};nt.fromUniformScale=function(e,t){return C.typeOf.number("scale",e),c(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 nt(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};nt.fromRotation=function(e,t){return C.typeOf.object("rotation",e),c(t)||(t=new nt),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 US=new m,OS=new m,jL=new m;nt.fromCamera=function(e,t){C.typeOf.object("camera",e);let n=e.position,i=e.direction,o=e.up;C.typeOf.object("camera.position",n),C.typeOf.object("camera.direction",i),C.typeOf.object("camera.up",o),m.normalize(i,US),m.normalize(m.cross(US,o,OS),OS),m.normalize(m.cross(OS,US,jL),jL);let r=OS.x,s=OS.y,a=OS.z,l=US.x,d=US.y,u=US.z,f=jL.x,p=jL.y,y=jL.z,h=n.x,g=n.y,x=n.z,S=r*-h+s*-g+a*-x,V=f*-h+p*-g+y*-x,Z=l*h+d*g+u*x;return c(t)?(t[0]=r,t[1]=f,t[2]=-l,t[3]=0,t[4]=s,t[5]=p,t[6]=-d,t[7]=0,t[8]=a,t[9]=y,t[10]=-u,t[11]=0,t[12]=S,t[13]=V,t[14]=Z,t[15]=1,t):new nt(r,s,a,S,f,p,y,V,-l,-d,-u,Z,0,0,0,1)};nt.computePerspectiveFieldOfView=function(e,t,n,i,o){C.typeOf.number.greaterThan("fovY",e,0),C.typeOf.number.lessThan("fovY",e,Math.PI),C.typeOf.number.greaterThan("near",n,0),C.typeOf.number.greaterThan("far",i,0),C.typeOf.object("result",o);let s=1/Math.tan(e*.5),a=s/t,l=(i+n)/(n-i),d=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=l,o[11]=-1,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o};nt.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){C.typeOf.number("left",e),C.typeOf.number("right",t),C.typeOf.number("bottom",n),C.typeOf.number("top",i),C.typeOf.number("near",o),C.typeOf.number("far",r),C.typeOf.object("result",s);let a=1/(t-e),l=1/(i-n),d=1/(r-o),u=-(t+e)*a,f=-(i+n)*l,p=-(r+o)*d;return a*=2,l*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=f,s[14]=p,s[15]=1,s};nt.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){C.typeOf.number("left",e),C.typeOf.number("right",t),C.typeOf.number("bottom",n),C.typeOf.number("top",i),C.typeOf.number("near",o),C.typeOf.number("far",r),C.typeOf.object("result",s);let a=2*o/(t-e),l=2*o/(i-n),d=(t+e)/(t-e),u=(i+n)/(i-n),f=-(r+o)/(r-o),p=-1,y=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=f,s[11]=p,s[12]=0,s[13]=0,s[14]=y,s[15]=0,s};nt.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){C.typeOf.number("left",e),C.typeOf.number("right",t),C.typeOf.number("bottom",n),C.typeOf.number("top",i),C.typeOf.number("near",o),C.typeOf.object("result",r);let s=2*o/(t-e),a=2*o/(i-n),l=(t+e)/(t-e),d=(i+n)/(i-n),u=-1,f=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=l,r[9]=d,r[10]=u,r[11]=f,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};nt.computeViewportTransformation=function(e,t,n,i){c(i)||(i=new nt),e=e??z.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 l=s*.5,d=a*.5,u=(n-t)*.5,f=l,p=d,y=u,h=o+l,g=r+d,x=t+u,S=1;return i[0]=f,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=y,i[11]=0,i[12]=h,i[13]=g,i[14]=x,i[15]=S,i};nt.computeView=function(e,t,n,i,o){return C.typeOf.object("position",e),C.typeOf.object("direction",t),C.typeOf.object("up",n),C.typeOf.object("right",i),C.typeOf.object("result",o),o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-m.dot(i,e),o[13]=-m.dot(n,e),o[14]=m.dot(t,e),o[15]=1,o};nt.toArray=function(e,t){return C.typeOf.object("matrix",e),c(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]]};nt.getElementIndex=function(e,t){return C.typeOf.number.greaterThanOrEquals("row",t,0),C.typeOf.number.lessThanOrEquals("row",t,3),C.typeOf.number.greaterThanOrEquals("column",e,0),C.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};nt.getColumn=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,3),C.typeOf.object("result",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};nt.setColumn=function(e,t,n,i){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,3),C.typeOf.object("cartesian",n),C.typeOf.object("result",i),i=nt.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};nt.getRow=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,3),C.typeOf.object("result",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};nt.setRow=function(e,t,n,i){return C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,3),C.typeOf.object("cartesian",n),C.typeOf.object("result",i),i=nt.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};nt.setTranslation=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.object("translation",t),C.typeOf.object("result",n),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 W1e=new m;nt.setScale=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("scale",t),C.typeOf.object("result",n);let i=nt.getScale(e,W1e),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 w1e=new m;nt.setUniformScale=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number("scale",t),C.typeOf.object("result",n);let i=nt.getScale(e,w1e),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 n3=new m;nt.getScale=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t.x=m.magnitude(m.fromElements(e[0],e[1],e[2],n3)),t.y=m.magnitude(m.fromElements(e[4],e[5],e[6],n3)),t.z=m.magnitude(m.fromElements(e[8],e[9],e[10],n3)),t};var Eq=new m;nt.getMaximumScale=function(e){return nt.getScale(e,Eq),m.maximumComponent(Eq)};var P1e=new m;nt.setRotation=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("result",n);let i=nt.getScale(e,P1e);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 v1e=new m;nt.getRotation=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=nt.getScale(e,v1e);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};nt.multiply=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],l=e[5],d=e[6],u=e[7],f=e[8],p=e[9],y=e[10],h=e[11],g=e[12],x=e[13],S=e[14],V=e[15],Z=t[0],R=t[1],E=t[2],I=t[3],v=t[4],P=t[5],F=t[6],N=t[7],b=t[8],G=t[9],X=t[10],W=t[11],A=t[12],k=t[13],B=t[14],O=t[15],H=i*Z+a*R+f*E+g*I,U=o*Z+l*R+p*E+x*I,K=r*Z+d*R+y*E+S*I,Q=s*Z+u*R+h*E+V*I,ie=i*v+a*P+f*F+g*N,j=o*v+l*P+p*F+x*N,$=r*v+d*P+y*F+S*N,ne=s*v+u*P+h*F+V*N,be=i*b+a*G+f*X+g*W,Ce=o*b+l*G+p*X+x*W,me=r*b+d*G+y*X+S*W,_e=s*b+u*G+h*X+V*W,Ve=i*A+a*k+f*B+g*O,Ie=o*A+l*k+p*B+x*O,Ze=r*A+d*k+y*B+S*O,De=s*A+u*k+h*B+V*O;return n[0]=H,n[1]=U,n[2]=K,n[3]=Q,n[4]=ie,n[5]=j,n[6]=$,n[7]=ne,n[8]=be,n[9]=Ce,n[10]=me,n[11]=_e,n[12]=Ve,n[13]=Ie,n[14]=Ze,n[15]=De,n};nt.add=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};nt.subtract=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};nt.multiplyTransformation=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],d=e[8],u=e[9],f=e[10],p=e[12],y=e[13],h=e[14],g=t[0],x=t[1],S=t[2],V=t[4],Z=t[5],R=t[6],E=t[8],I=t[9],v=t[10],P=t[12],F=t[13],N=t[14],b=i*g+s*x+d*S,G=o*g+a*x+u*S,X=r*g+l*x+f*S,W=i*V+s*Z+d*R,A=o*V+a*Z+u*R,k=r*V+l*Z+f*R,B=i*E+s*I+d*v,O=o*E+a*I+u*v,H=r*E+l*I+f*v,U=i*P+s*F+d*N+p,K=o*P+a*F+u*N+y,Q=r*P+l*F+f*N+h;return n[0]=b,n[1]=G,n[2]=X,n[3]=0,n[4]=W,n[5]=A,n[6]=k,n[7]=0,n[8]=B,n[9]=O,n[10]=H,n[11]=0,n[12]=U,n[13]=K,n[14]=Q,n[15]=1,n};nt.multiplyByMatrix3=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("rotation",t),C.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],d=e[8],u=e[9],f=e[10],p=t[0],y=t[1],h=t[2],g=t[3],x=t[4],S=t[5],V=t[6],Z=t[7],R=t[8],E=i*p+s*y+d*h,I=o*p+a*y+u*h,v=r*p+l*y+f*h,P=i*g+s*x+d*S,F=o*g+a*x+u*S,N=r*g+l*x+f*S,b=i*V+s*Z+d*R,G=o*V+a*Z+u*R,X=r*V+l*Z+f*R;return n[0]=E,n[1]=I,n[2]=v,n[3]=0,n[4]=P,n[5]=F,n[6]=N,n[7]=0,n[8]=b,n[9]=G,n[10]=X,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};nt.multiplyByTranslation=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("translation",t),C.typeOf.object("result",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],l=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]=l,n[15]=e[15],n};nt.multiplyByScale=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("scale",t),C.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?nt.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)};nt.multiplyByUniformScale=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.number("scale",t),C.typeOf.object("result",n),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};nt.multiplyByVector=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("cartesian",t),C.typeOf.object("result",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,l=e[1]*i+e[5]*o+e[9]*r+e[13]*s,d=e[2]*i+e[6]*o+e[10]*r+e[14]*s,u=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=l,n.z=d,n.w=u,n};nt.multiplyByPointAsVector=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("cartesian",t),C.typeOf.object("result",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,l=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=l,n};nt.multiplyByPoint=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("cartesian",t),C.typeOf.object("result",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],l=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=l,n};nt.multiplyByScalar=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),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};nt.negate=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};nt.transpose=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",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};nt.abs=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};nt.equals=function(e,t){return e===t||c(e)&&c(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]};nt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};nt.getTranslation=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};nt.getMatrix3=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var F1e=new te,A1e=new te,M1e=new ce,N1e=new ce(0,0,0,1);nt.inverse=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],l=e[9],d=e[13],u=e[2],f=e[6],p=e[10],y=e[14],h=e[3],g=e[7],x=e[11],S=e[15],V=p*S,Z=y*x,R=f*S,E=y*g,I=f*x,v=p*g,P=u*S,F=y*h,N=u*x,b=p*h,G=u*g,X=f*h,W=V*a+E*l+I*d-(Z*a+R*l+v*d),A=Z*s+P*l+b*d-(V*s+F*l+N*d),k=R*s+F*a+G*d-(E*s+P*a+X*d),B=v*s+N*a+X*l-(I*s+b*a+G*l),O=Z*i+R*o+v*r-(V*i+E*o+I*r),H=V*n+F*o+N*r-(Z*n+P*o+b*r),U=E*n+P*i+X*r-(R*n+F*i+G*r),K=I*n+b*i+G*o-(v*n+N*i+X*o);V=o*d,Z=r*l,R=i*d,E=r*a,I=i*l,v=o*a,P=n*d,F=r*s,N=n*l,b=o*s,G=n*a,X=i*s;let Q=V*g+E*x+I*S-(Z*g+R*x+v*S),ie=Z*h+P*x+b*S-(V*h+F*x+N*S),j=R*h+F*g+G*S-(E*h+P*g+X*S),$=v*h+N*g+X*x-(I*h+b*g+G*x),ne=R*p+v*y+Z*f-(I*y+V*f+E*p),be=N*y+V*u+F*p-(P*p+b*y+Z*u),Ce=P*f+X*y+E*u-(G*y+R*u+F*f),me=G*p+I*u+b*f-(N*f+X*p+v*u),_e=n*W+i*A+o*k+r*B;if(Math.abs(_e)<w.EPSILON21){if(te.equalsEpsilon(nt.getMatrix3(e,F1e),A1e,w.EPSILON7)&&ce.equals(nt.getRow(e,3,M1e),N1e))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 le("matrix is not invertible because its determinate is zero.")}return _e=1/_e,t[0]=W*_e,t[1]=A*_e,t[2]=k*_e,t[3]=B*_e,t[4]=O*_e,t[5]=H*_e,t[6]=U*_e,t[7]=K*_e,t[8]=Q*_e,t[9]=ie*_e,t[10]=j*_e,t[11]=$*_e,t[12]=ne*_e,t[13]=be*_e,t[14]=Ce*_e,t[15]=me*_e,t};nt.inverseTransformation=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],l=e[8],d=e[9],u=e[10],f=e[12],p=e[13],y=e[14],h=-n*f-i*p-o*y,g=-r*f-s*p-a*y,x=-l*f-d*p-u*y;return t[0]=n,t[1]=r,t[2]=l,t[3]=0,t[4]=i,t[5]=s,t[6]=d,t[7]=0,t[8]=o,t[9]=a,t[10]=u,t[11]=0,t[12]=h,t[13]=g,t[14]=x,t[15]=1,t};var k1e=new nt;nt.inverseTranspose=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),nt.inverse(nt.transpose(e,k1e),t)};nt.IDENTITY=Object.freeze(new nt(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));nt.ZERO=Object.freeze(new nt(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));nt.COLUMN0ROW0=0;nt.COLUMN0ROW1=1;nt.COLUMN0ROW2=2;nt.COLUMN0ROW3=3;nt.COLUMN1ROW0=4;nt.COLUMN1ROW1=5;nt.COLUMN1ROW2=6;nt.COLUMN1ROW3=7;nt.COLUMN2ROW0=8;nt.COLUMN2ROW1=9;nt.COLUMN2ROW2=10;nt.COLUMN2ROW3=11;nt.COLUMN3ROW0=12;nt.COLUMN3ROW1=13;nt.COLUMN3ROW2=14;nt.COLUMN3ROW3=15;Object.defineProperties(nt.prototype,{length:{get:function(){return nt.packedLength}}});nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.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]};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.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=nt;var zLt=_(T(),1),U1e={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},oe=Object.freeze(U1e);var O1e=new m;function Gt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var ca={};ca[oe.FLOAT]="float";ca[oe.FLOAT_VEC2]="vec2";ca[oe.FLOAT_VEC3]="vec3";ca[oe.FLOAT_VEC4]="vec4";ca[oe.INT]="int";ca[oe.INT_VEC2]="ivec2";ca[oe.INT_VEC3]="ivec3";ca[oe.INT_VEC4]="ivec4";ca[oe.BOOL]="bool";ca[oe.BOOL_VEC2]="bvec2";ca[oe.BOOL_VEC3]="bvec3";ca[oe.BOOL_VEC4]="bvec4";ca[oe.FLOAT_MAT2]="mat2";ca[oe.FLOAT_MAT3]="mat3";ca[oe.FLOAT_MAT4]="mat4";ca[oe.SAMPLER_2D]="sampler2D";ca[oe.SAMPLER_CUBE]="samplerCube";Gt.prototype.getDeclaration=function(e){let t=`uniform ${ca[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var D1e={czm_viewport:new Gt({size:1,datatype:oe.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Gt({size:1,datatype:oe.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Gt({size:1,datatype:oe.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Gt({size:1,datatype:oe.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Gt({size:1,datatype:oe.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Gt({size:1,datatype:oe.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Gt({size:1,datatype:oe.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Gt({size:1,datatype:oe.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,O1e)}}),czm_frameNumber:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Gt({size:1,datatype:oe.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Gt({size:1,datatype:oe.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Gt({size:1,datatype:oe.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Gt({size:1,datatype:oe.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Gt({size:9,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Gt({size:1,datatype:oe.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Gt({size:1,datatype:oe.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Gt({size:1,datatype:oe.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Gt({size:1,datatype:oe.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},_p=D1e;var CZt=_(T(),1);var eZt=_(T(),1);function B1e(){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 Hn=B1e;var iZt=_(T(),1);function Y1e(){return!0}function H1e(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){throw new L(t)}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=Y1e}var he=H1e;var lZt=_(T(),1);var Fs={UNSIGNED_BYTE:oe.UNSIGNED_BYTE,UNSIGNED_SHORT:oe.UNSIGNED_SHORT,UNSIGNED_INT:oe.UNSIGNED_INT};Fs.getSizeInBytes=function(e){switch(e){case Fs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Fs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Fs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new L("indexDatatype is required and must be a valid IndexDatatype constant.")};Fs.fromSizeInBytes=function(e){switch(e){case 2:return Fs.UNSIGNED_SHORT;case 4:return Fs.UNSIGNED_INT;case 1:return Fs.UNSIGNED_BYTE;default:throw new L("Size in bytes cannot be mapped to an IndexDatatype")}};Fs.validate=function(e){return c(e)&&(e===Fs.UNSIGNED_BYTE||e===Fs.UNSIGNED_SHORT||e===Fs.UNSIGNED_INT)};Fs.createTypedArray=function(e,t){if(!c(e))throw new L("numberOfVertices is required.");return e>=w.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Fs.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!c(e))throw new L("numberOfVertices is required.");if(!c(t))throw new L("sourceArray is required.");if(!c(n))throw new L("byteOffset is required.");return e>=w.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Fs.fromTypedArray=function(e){if(e instanceof Uint8Array)return Fs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Fs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Fs.UNSIGNED_INT;throw new L("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var Me=Object.freeze(Fs);var mZt=_(T(),1);var dN={STREAM_DRAW:oe.STREAM_DRAW,STATIC_DRAW:oe.STATIC_DRAW,DYNAMIC_DRAW:oe.DYNAMIC_DRAW,validate:function(e){return e===dN.STREAM_DRAW||e===dN.STATIC_DRAW||e===dN.DYNAMIC_DRAW}},Ne=Object.freeze(dN);function pu(e){if(e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context),!c(e.typedArray)&&!c(e.sizeInBytes))throw new L("Either options.sizeInBytes or options.typedArray is required.");if(c(e.typedArray)&&c(e.sizeInBytes))throw new L("Cannot pass in both options.sizeInBytes and options.typedArray.");if(c(e.typedArray)&&(C.typeOf.object("options.typedArray",e.typedArray),C.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!Ne.validate(e.usage))throw new L("usage is invalid.");let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=c(i);s&&(o=i.byteLength),C.typeOf.number.greaterThan("sizeInBytes",o,0);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Hn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}pu.createVertexBuffer=function(e){return C.defined("options.context",e.context),new pu({context:e.context,bufferTarget:oe.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};pu.createIndexBuffer=function(e){if(C.defined("options.context",e.context),!Me.validate(e.indexDatatype))throw new L("Invalid indexDatatype.");if(e.indexDatatype===Me.UNSIGNED_INT&&!e.context.elementIndexUint)throw new L("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system.  Check context.elementIndexUint.");let t=e.context,n=e.indexDatatype,i=Me.getSizeInBytes(n),o=new pu({context:t,bufferTarget:oe.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(pu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});pu.prototype._getBuffer=function(){return this._buffer};pu.prototype.copyFromArrayView=function(e,t){t=t??0,C.defined("arrayView",e),C.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};pu.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new L("A WebGL 2 context is required.");if(!c(e))throw new L("readBuffer must be defined.");if(!c(i)||i<=0)throw new L("sizeInBytes must be defined and be greater than zero.");if(!c(t)||t<0||t+i>e._sizeInBytes)throw new L("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!c(n)||n<0||n+i>this._sizeInBytes)throw new L("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&n<t+i||t>n&&t<n+i))throw new L("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===oe.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==oe.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==oe.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===oe.ELEMENT_ARRAY_BUFFER)throw new L("Can not copy an index buffer into another buffer type.");let o=oe.COPY_READ_BUFFER,r=oe.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)};pu.prototype.getBufferData=function(e,t,n,i){if(t=t??0,n=n??0,!this._webgl2)throw new L("A WebGL 2 context is required.");if(!c(e))throw new L("arrayView is required.");let o,r,s=e.byteLength;if(c(i)?(o=i,c(s)?r=1:(s=e.length,r=e.BYTES_PER_ELEMENT)):c(s)?(o=s-n,r=1):(s=e.length,o=s-n,r=e.BYTES_PER_ELEMENT),n<0||n>s)throw new L("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>s)throw new L("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new L("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*r>this._sizeInBytes)throw new L("sourceOffset + length must be less than the buffers size.");let a=this._gl,l=oe.COPY_READ_BUFFER;a.bindBuffer(l,this._buffer),a.getBufferSubData(l,t,e,n,i),a.bindBuffer(l,null)};pu.prototype.isDestroyed=function(){return!1};pu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),he(this)};var _t=pu;var DZt=_(T(),1);var NZt=_(T(),1);var WZt=_(T(),1);var ZZt=_(T(),1);var w0,Pr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Sl={};Object.defineProperties(Sl,{element:{get:function(){if(Sl.supportsFullscreen())return document[Pr.fullscreenElement]}},changeEventName:{get:function(){if(Sl.supportsFullscreen())return Pr.fullscreenchange}},errorEventName:{get:function(){if(Sl.supportsFullscreen())return Pr.fullscreenerror}},enabled:{get:function(){if(Sl.supportsFullscreen())return document[Pr.fullscreenEnabled]}},fullscreen:{get:function(){if(Sl.supportsFullscreen())return Sl.element!==null}}});Sl.supportsFullscreen=function(){if(c(w0))return w0;w0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Pr.requestFullscreen="requestFullscreen",Pr.exitFullscreen="exitFullscreen",Pr.fullscreenEnabled="fullscreenEnabled",Pr.fullscreenElement="fullscreenElement",Pr.fullscreenchange="fullscreenchange",Pr.fullscreenerror="fullscreenerror",w0=!0,w0;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"?(Pr.requestFullscreen=n,w0=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Pr.requestFullscreen=n,w0=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Pr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Pr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Pr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Pr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Pr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Pr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Pr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Pr.fullscreenerror=n)}return w0};Sl.requestFullscreen=function(e,t){Sl.supportsFullscreen()&&e[Pr.requestFullscreen]({vrDisplay:t})};Sl.exitFullscreen=function(){Sl.supportsFullscreen()&&document[Pr.exitFullscreen]()};Sl._names=Pr;var _r=Sl;var tc;typeof navigator<"u"?tc=navigator:tc={};function nx(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var uN,Xq;function c3(){if(!c(uN)&&(uN=!1,!yN())){let e=/ Chrome\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(uN=!0,Xq=nx(e[1]))}return uN}function z1e(){return c3()&&Xq}var mN,Iq;function Wq(){if(!c(mN)&&(mN=!1,!c3()&&!yN()&&/ Safari\/[\.0-9]+/.test(tc.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(mN=!0,Iq=nx(e[1]))}return mN}function K1e(){return Wq()&&Iq}var fN,s3;function wq(){if(!c(fN)){fN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(tc.userAgent);e!==null&&(fN=!0,s3=nx(e[1]),s3.isNightly=!!e[2])}return fN}function J1e(){return wq()&&s3}var qL,a3;function Pq(){if(!c(qL)){qL=!1;let e;tc.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(tc.userAgent),e!==null&&(qL=!0,a3=nx(e[1]))):tc.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(tc.userAgent),e!==null&&(qL=!0,a3=nx(e[1])))}return qL}function Q1e(){return Pq()&&a3}var hN,vq;function yN(){if(!c(hN)){hN=!1;let e=/ Edg\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(hN=!0,vq=nx(e[1]))}return hN}function j1e(){return yN()&&vq}var pN,l3;function gN(){if(!c(pN)){pN=!1;let e=/Firefox\/([\.0-9]+)/.exec(tc.userAgent);e!==null&&(pN=!0,l3=nx(e[1]))}return pN}var i3;function q1e(){return c(i3)||(i3=/Windows/i.test(tc.appVersion)),i3}var o3;function $1e(){return c(o3)||(o3=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),o3}function eVe(){return gN()&&l3}var r3;function tVe(){return c(r3)||(r3=!gN()&&typeof PointerEvent<"u"&&(!c(tc.pointerEnabled)||tc.pointerEnabled)),r3}var Fq,bN;function Aq(){if(!c(bN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;bN=c(t)&&t!=="",bN&&(Fq=t)}return bN}function nVe(){return Aq()?Fq:void 0}function ec(){if(!ec.initialized)throw new L("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return ec._result}ec._promise=void 0;ec._result=void 0;ec.initialize=function(){return c(ec._promise)||(ec._promise=new Promise(e=>{let t=new Image;t.onload=function(){ec._result=t.width>0&&t.height>0,e(ec._result)},t.onerror=function(){ec._result=!1,e(ec._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ec._promise};Object.defineProperties(ec,{initialized:{get:function(){return c(ec._result)}}});var DS=[];typeof ArrayBuffer<"u"&&(DS.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&DS.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&DS.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&DS.push(BigInt64Array),typeof BigUint64Array<"u"&&DS.push(BigUint64Array));var bu={isChrome:c3,chromeVersion:z1e,isSafari:Wq,safariVersion:K1e,isWebkit:wq,webkitVersion:J1e,isInternetExplorer:Pq,internetExplorerVersion:Q1e,isEdge:yN,edgeVersion:j1e,isFirefox:gN,firefoxVersion:eVe,isWindows:q1e,isIPadOrIOS:$1e,hardwareConcurrency:tc.hardwareConcurrency??3,supportsPointerEvents:tVe,supportsImageRenderingPixelated:Aq,supportsWebP:ec,imageRenderingValue:nVe,typedArrayTypes:DS};bu.supportsBasis=function(e){return bu.supportsWebAssembly()&&e.context.supportsBasis};bu.supportsFullscreen=function(){return _r.supportsFullscreen()};bu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};bu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};bu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};bu.supportsBigInt=function(){return typeof BigInt<"u"};bu.supportsWebWorkers=function(){return typeof Worker<"u"};bu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};bu.supportsWebgl2=function(e){return C.defined("scene",e),e.context.webgl2};bu.supportsEsmWebWorkers=function(){return!gN()||parseInt(l3)>=114};var Ot=bu;function d3(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 C.typeOf.object("cartesian",e),c(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),c(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 C.typeOf.object("color",e),C.typeOf.number("alpha",t),c(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 u3,m3,Tp;Ot.supportsTypedArrays()&&(u3=new ArrayBuffer(4),m3=new Uint32Array(u3),Tp=new Uint8Array(u3));ae.fromRgba=function(e,t){return m3[0]=e,ae.fromBytes(Tp[0],Tp[1],Tp[2],Tp[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 l;n<.5?l=n*(1+t):l=n+t-n*t;let d=2*n-l;r=d3(d,l,e+1/3),s=d3(d,l,e),a=d3(d,l,e-1/3)}return c(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??z.EMPTY_OBJECT;let n=e.red;if(!c(n)){let s=e.minimumRed??0,a=e.maximumRed??1;C.typeOf.number.lessThanOrEquals("minimumRed",s,a),n=s+w.nextRandomNumber()*(a-s)}let i=e.green;if(!c(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;C.typeOf.number.lessThanOrEquals("minimumGreen",s,a),i=s+w.nextRandomNumber()*(a-s)}let o=e.blue;if(!c(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;C.typeOf.number.lessThanOrEquals("minimumBlue",s,a),o=s+w.nextRandomNumber()*(a-s)}let r=e.alpha;if(!c(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;C.typeOf.number.lessThanOrEquals("minimumAlpha",s,a),r=s+w.nextRandomNumber()*(a-s)}return c(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new ae(n,i,o,r)};var iVe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,oVe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,rVe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,sVe=/^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){C.typeOf.string("color",e),c(t)||(t=new ae),e=e.trim();let n=ae[e.toUpperCase()];if(c(n))return ae.clone(n,t),t;let i=iVe.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=oVe.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=rVe.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=sVe.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 C.typeOf.object("value",e),C.defined("array",t),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 C.defined("array",e),t=t??0,c(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(c(e))return c(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||c(e)&&c(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||c(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 c(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};ae.prototype.toRgba=function(){return Tp[0]=ae.floatToByte(this.red),Tp[1]=ae.floatToByte(this.green),Tp[2]=ae.floatToByte(this.blue),Tp[3]=ae.floatToByte(this.alpha),m3[0]};ae.prototype.brighten=function(e,t){return C.typeOf.number("magnitude",e),C.typeOf.number.greaterThanOrEquals("magnitude",e,0),C.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};ae.prototype.darken=function(e,t){return C.typeOf.number("magnitude",e),C.typeOf.number.greaterThanOrEquals("magnitude",e,0),C.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};ae.prototype.withAlpha=function(e,t){return ae.fromAlpha(this,e,t)};ae.add=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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 C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i),i.red=w.lerp(e.red,t.red,n),i.green=w.lerp(e.green,t.green,n),i.blue=w.lerp(e.blue,t.blue,n),i.alpha=w.lerp(e.alpha,t.alpha,n),i};ae.multiplyByScalar=function(e,t,n){return C.typeOf.object("color",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),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 C.typeOf.object("color",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),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 Y=ae;function xN(e){e=e??z.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}xN.ALL=Object.freeze(new xN({color:new Y(0,0,0,0),depth:1,stencil:0}));xN.prototype.execute=function(e,t){e.clear(this,t)};var ti=xN;var JZt=_(T(),1);var YZt=_(T(),1),aVe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Xe=Object.freeze(aVe);function Mq(e){e=e??z.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=Xe.COMPUTE,this.owner=e.owner}Mq.prototype.execute=function(e){e.execute(this)};var vc=Mq;var Awt=_(T(),1);var DIt=_(T(),1);var tRt=_(T(),1);function Mt(e,t){this.x=e??0,this.y=t??0}Mt.fromElements=function(e,t,n){return c(n)?(n.x=e,n.y=t,n):new Mt(e,t)};Mt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t):new Mt(e.x,e.y)};Mt.fromCartesian3=Mt.clone;Mt.fromCartesian4=Mt.clone;Mt.packedLength=2;Mt.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.x,t[n]=e.y,t};Mt.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new Mt),n.x=e[t++],n.y=e[t],n};Mt.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*2;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Mt.pack(e[o],t,o*2);return t};Mt.unpackArray=function(e,t){if(C.defined("array",e),C.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new L("array length must be a multiple of 2.");let n=e.length;c(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Mt.unpack(e,i,t[o])}return t};Mt.fromArray=Mt.unpack;Mt.maximumComponent=function(e){return C.typeOf.object("cartesian",e),Math.max(e.x,e.y)};Mt.minimumComponent=function(e){return C.typeOf.object("cartesian",e),Math.min(e.x,e.y)};Mt.minimumByComponent=function(e,t,n){return C.typeOf.object("first",e),C.typeOf.object("second",t),C.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Mt.maximumByComponent=function(e,t,n){return C.typeOf.object("first",e),C.typeOf.object("second",t),C.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Mt.clamp=function(e,t,n,i){C.typeOf.object("value",e),C.typeOf.object("min",t),C.typeOf.object("max",n),C.typeOf.object("result",i);let o=w.clamp(e.x,t.x,n.x),r=w.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Mt.magnitudeSquared=function(e){return C.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y};Mt.magnitude=function(e){return Math.sqrt(Mt.magnitudeSquared(e))};var _N=new Mt;Mt.distance=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),Mt.subtract(e,t,_N),Mt.magnitude(_N)};Mt.distanceSquared=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),Mt.subtract(e,t,_N),Mt.magnitudeSquared(_N)};Mt.normalize=function(e,t){C.typeOf.object("cartesian",e),C.typeOf.object("result",t);let n=Mt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new L("normalized result is not a number");return t};Mt.dot=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),e.x*t.x+e.y*t.y};Mt.cross=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),e.x*t.y-e.y*t.x};Mt.multiplyComponents=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n};Mt.divideComponents=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n};Mt.add=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n};Mt.subtract=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n};Mt.multiplyByScalar=function(e,t,n){return C.typeOf.object("cartesian",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n};Mt.divideByScalar=function(e,t,n){return C.typeOf.object("cartesian",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n};Mt.negate=function(e,t){return C.typeOf.object("cartesian",e),C.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t};Mt.abs=function(e,t){return C.typeOf.object("cartesian",e),C.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var Nq=new Mt;Mt.lerp=function(e,t,n,i){return C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i),Mt.multiplyByScalar(t,n,Nq),i=Mt.multiplyByScalar(e,1-n,i),Mt.add(Nq,i,i)};var kq=new Mt,Uq=new Mt;Mt.angleBetween=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),Mt.normalize(e,kq),Mt.normalize(t,Uq),w.acosClamped(Mt.dot(kq,Uq))};var cVe=new Mt;Mt.mostOrthogonalAxis=function(e,t){C.typeOf.object("cartesian",e),C.typeOf.object("result",t);let n=Mt.normalize(e,cVe);return Mt.abs(n,n),n.x<=n.y?t=Mt.clone(Mt.UNIT_X,t):t=Mt.clone(Mt.UNIT_Y,t),t};Mt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y};Mt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Mt.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&w.equalsEpsilon(e.x,t.x,n,i)&&w.equalsEpsilon(e.y,t.y,n,i)};Mt.ZERO=Object.freeze(new Mt(0,0));Mt.ONE=Object.freeze(new Mt(1,1));Mt.UNIT_X=Object.freeze(new Mt(1,0));Mt.UNIT_Y=Object.freeze(new Mt(0,1));Mt.prototype.clone=function(e){return Mt.clone(this,e)};Mt.prototype.equals=function(e){return Mt.equals(this,e)};Mt.prototype.equalsEpsilon=function(e,t,n){return Mt.equalsEpsilon(this,e,t,n)};Mt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var D=Mt;var hRt=_(T(),1);var aRt=_(T(),1);var lVe=new m,dVe=new m;function uVe(e,t,n,i,o){if(!c(e))throw new L("cartesian is required.");if(!c(t))throw new L("oneOverRadii is required.");if(!c(n))throw new L("oneOverRadiiSquared is required.");if(!c(i))throw new L("centerToleranceSquared is required.");let r=e.x,s=e.y,a=e.z,l=t.x,d=t.y,u=t.z,f=r*r*l*l,p=s*s*d*d,y=a*a*u*u,h=f+p+y,g=Math.sqrt(1/h),x=m.multiplyByScalar(e,g,lVe);if(h<i)return isFinite(g)?m.clone(x,o):void 0;let S=n.x,V=n.y,Z=n.z,R=dVe;R.x=x.x*S*2,R.y=x.y*V*2,R.z=x.z*Z*2;let E=(1-g)*m.magnitude(e)/(.5*m.magnitude(R)),I=0,v,P,F,N,b,G,X,W,A,k,B;do{E-=I,F=1/(1+E*S),N=1/(1+E*V),b=1/(1+E*Z),G=F*F,X=N*N,W=b*b,A=G*F,k=X*N,B=W*b,v=f*G+p*X+y*W-1,P=f*A*S+p*k*V+y*B*Z;let O=-2*P;I=v/O}while(Math.abs(v)>w.EPSILON12);return c(o)?(o.x=r*F,o.y=s*N,o.z=a*b,o):new m(r*F,s*N,a*b)}var ix=uVe;function Mo(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}Mo.fromRadians=function(e,t,n,i){return C.typeOf.number("longitude",e),C.typeOf.number("latitude",t),n=n??0,c(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Mo(e,t,n)};Mo.fromDegrees=function(e,t,n,i){return C.typeOf.number("longitude",e),C.typeOf.number("latitude",t),e=w.toRadians(e),t=w.toRadians(t),Mo.fromRadians(e,t,n,i)};var mVe=new m,fVe=new m,hVe=new m;Mo._ellipsoidOneOverRadii=new m(1/6378137,1/6378137,1/6356752314245179e-9);Mo._ellipsoidOneOverRadiiSquared=new m(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Mo._ellipsoidCenterToleranceSquared=w.EPSILON1;Mo.fromCartesian=function(e,t,n){let i=c(t)?t.oneOverRadii:Mo._ellipsoidOneOverRadii,o=c(t)?t.oneOverRadiiSquared:Mo._ellipsoidOneOverRadiiSquared,r=c(t)?t._centerToleranceSquared:Mo._ellipsoidCenterToleranceSquared,s=ix(e,i,o,r,fVe);if(!c(s))return;let a=m.multiplyComponents(s,o,mVe);a=m.normalize(a,a);let l=m.subtract(e,s,hVe),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),f=w.sign(m.dot(l,e))*m.magnitude(l);return c(n)?(n.longitude=d,n.latitude=u,n.height=f,n):new Mo(d,u,f)};Mo.toCartesian=function(e,t,n){return C.defined("cartographic",e),m.fromRadians(e.longitude,e.latitude,e.height,t,n)};Mo.clone=function(e,t){if(c(e))return c(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Mo(e.longitude,e.latitude,e.height)};Mo.equals=function(e,t){return e===t||c(e)&&c(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Mo.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Mo.ZERO=Object.freeze(new Mo(0,0,0));Mo.prototype.clone=function(e){return Mo.clone(this,e)};Mo.prototype.equals=function(e){return Mo.equals(this,e)};Mo.prototype.equalsEpsilon=function(e,t){return Mo.equalsEpsilon(this,e,t)};Mo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var pe=Mo;var VRt=_(T(),1);function Dq(e,t,n,i){t=t??0,n=n??0,i=i??0,C.typeOf.number.greaterThanOrEquals("x",t,0),C.typeOf.number.greaterThanOrEquals("y",n,0),C.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new m(t,n,i),e._radiiSquared=new m(t*t,n*n,i*i),e._radiiToTheFourth=new m(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new m(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new m(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=w.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function yi(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,Dq(this,e,t,n)}Object.defineProperties(yi.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}}});yi.clone=function(e,t){if(!c(e))return;let n=e._radii;return c(t)?(m.clone(n,t._radii),m.clone(e._radiiSquared,t._radiiSquared),m.clone(e._radiiToTheFourth,t._radiiToTheFourth),m.clone(e._oneOverRadii,t._oneOverRadii),m.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new yi(n.x,n.y,n.z)};yi.fromCartesian3=function(e,t){return c(t)||(t=new yi),c(e)&&Dq(t,e.x,e.y,e.z),t};yi.WGS84=Object.freeze(new yi(6378137,6378137,6356752314245179e-9));yi.UNIT_SPHERE=Object.freeze(new yi(1,1,1));yi.MOON=Object.freeze(new yi(w.LUNAR_RADIUS,w.LUNAR_RADIUS,w.LUNAR_RADIUS));yi._default=yi.WGS84;Object.defineProperties(yi,{default:{get:function(){return yi._default},set:function(e){C.typeOf.object("value",e),yi._default=e,m._ellipsoidRadiiSquared=e.radiiSquared,pe._ellipsoidOneOverRadii=e.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});yi.prototype.clone=function(e){return yi.clone(this,e)};yi.packedLength=m.packedLength;yi.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,m.pack(e._radii,t,n),t};yi.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=m.unpack(e,t);return yi.fromCartesian3(i,n)};yi.prototype.geocentricSurfaceNormal=m.normalize;yi.prototype.geodeticSurfaceNormalCartographic=function(e,t){C.typeOf.object("cartographic",e);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 c(t)||(t=new m),t.x=r,t.y=s,t.z=a,m.normalize(t,t)};yi.prototype.geodeticSurfaceNormal=function(e,t){if(C.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new L("cartesian has a NaN component");if(!m.equalsEpsilon(e,m.ZERO,w.EPSILON14))return c(t)||(t=new m),t=m.multiplyComponents(e,this._oneOverRadiiSquared,t),m.normalize(t,t)};var pVe=new m,bVe=new m;yi.prototype.cartographicToCartesian=function(e,t){let n=pVe,i=bVe;this.geodeticSurfaceNormalCartographic(e,n),m.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(m.dot(n,i));return m.divideByScalar(i,o,i),m.multiplyByScalar(n,e.height,n),c(t)||(t=new m),m.add(i,n,t)};yi.prototype.cartographicArrayToCartesianArray=function(e,t){C.defined("cartographics",e);let n=e.length;c(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 yVe=new m,gVe=new m,xVe=new m;yi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,gVe);if(!c(n))return;let i=this.geodeticSurfaceNormal(n,yVe),o=m.subtract(e,n,xVe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=w.sign(m.dot(o,e))*m.magnitude(o);return c(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new pe(r,s,a)};yi.prototype.cartesianArrayToCartographicArray=function(e,t){C.defined("cartesians",e);let n=e.length;c(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};yi.prototype.scaleToGeodeticSurface=function(e,t){return ix(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};yi.prototype.scaleToGeocentricSurface=function(e,t){C.typeOf.object("cartesian",e),c(t)||(t=new m);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return m.multiplyByScalar(e,s,t)};yi.prototype.transformPositionToScaledSpace=function(e,t){return c(t)||(t=new m),m.multiplyComponents(e,this._oneOverRadii,t)};yi.prototype.transformPositionFromScaledSpace=function(e,t){return c(t)||(t=new m),m.multiplyComponents(e,this._radii,t)};yi.prototype.equals=function(e){return this===e||c(e)&&m.equals(this._radii,e._radii)};yi.prototype.toString=function(){return this._radii.toString()};yi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(C.typeOf.object("position",e),!w.equalsEpsilon(this._radii.x,this._radii.y,w.EPSILON15))throw new L("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");C.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=t??0;let i=this._squaredXOverSquaredZ;if(c(n)||(n=new m),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var _Ve=new m;yi.prototype.getLocalCurvature=function(e,t){C.typeOf.object("surfacePosition",e),c(t)||(t=new D);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,_Ve),i=m.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return D.fromElements(1/i,1/r,t)};var TVe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],SVe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Oq(e,t,n){C.typeOf.number("a",e),C.typeOf.number("b",t),C.typeOf.func("func",n);let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*TVe[s];r+=SVe[s]*(n(i+a)+n(i-a))}return r*=o,r}yi.prototype.surfaceArea=function(e){C.typeOf.object("rectangle",e);let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=w.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,l=r.z,d=s*a;return Oq(i,o,function(u){let f=Math.cos(u),p=Math.sin(u);return Math.cos(u)*Oq(t,n,function(y){let h=Math.cos(y),g=Math.sin(y);return Math.sqrt(d*p*p+l*(a*h*h+s*g*g)*f*f)})})};var re=yi;var IRt=_(T(),1);function TN(e){this._ellipsoid=e??re.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(TN.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});TN.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};TN.prototype.unproject=function(e,t){if(!c(e))throw new L("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new pe(i,o,r)};var Xi=TN;var wRt=_(T(),1),CVe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},zt=Object.freeze(CVe);var wIt=_(T(),1);var CIt=_(T(),1);var LXt=_(T(),1);var FRt=_(T(),1);function VVe(e,t,n){C.defined("array",e),C.defined("itemToFind",t),C.defined("comparator",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 Wo=VVe;var MRt=_(T(),1);function LVe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var P0=LVe;var cGt=_(T(),1);var HRt=_(T(),1);var URt=_(T(),1);function ZVe(e){if(e===null||isNaN(e))throw new L("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var Lm=ZVe;var Bq=[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,g(),x(),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 g(){C.typeOf.number.greaterThanOrEquals("Year",e,1),C.typeOf.number.lessThanOrEquals("Year",e,9999),C.typeOf.number.greaterThanOrEquals("Month",t,1),C.typeOf.number.lessThanOrEquals("Month",t,12),C.typeOf.number.greaterThanOrEquals("Day",n,1),C.typeOf.number.lessThanOrEquals("Day",n,31),C.typeOf.number.greaterThanOrEquals("Hour",i,0),C.typeOf.number.lessThanOrEquals("Hour",i,23),C.typeOf.number.greaterThanOrEquals("Minute",o,0),C.typeOf.number.lessThanOrEquals("Minute",o,59),C.typeOf.bool("IsLeapSecond",a),C.typeOf.number.greaterThanOrEquals("Second",r,0),C.typeOf.number.lessThanOrEquals("Second",r,a?60:59),C.typeOf.number.greaterThanOrEquals("Millisecond",s,0),C.typeOf.number.lessThan("Millisecond",s,1e3)}function x(){let S=t===2&&Lm(e)?Bq[t-1]+1:Bq[t-1];if(n>S)throw new L("Month and Day represents invalid date")}}var eh=RVe;var KRt=_(T(),1);function GVe(e,t){this.julianDate=e,this.offset=t}var Hi=GVe;var QRt=_(T(),1),EVe={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},Kn=Object.freeze(EVe);var qRt=_(T(),1),XVe={UTC:0,TAI:1},zn=Object.freeze(XVe);var Hq=new eh,SN=[31,28,31,30,31,30,31,31,30,31,30,31],CN=29;function f3(e,t){return Wt.compare(e.julianDate,t.julianDate)}var BS=new Hi;function LN(e){BS.julianDate=e;let t=Wt.leapSeconds,n=Wo(t,BS,f3);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&Wt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),Wt.addSeconds(e,i,e)}function Yq(e,t){BS.julianDate=e;let n=Wt.leapSeconds,i=Wo(n,BS,f3);if(i<0&&(i=~i),i===0)return Wt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return Wt.addSeconds(e,-n[i-1].offset,t);let o=Wt.secondsDifference(n[i].julianDate,e);if(o===0)return Wt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return Wt.addSeconds(e,-n[--i].offset,t)}function v0(e,t,n){let i=t/Kn.SECONDS_PER_DAY|0;return e+=i,t-=Kn.SECONDS_PER_DAY*i,t<0&&(e--,t+=Kn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function h3(e,t,n,i,o,r,s){let a=(t-14)/12|0,l=e+4800+a,d=(1461*l/4|0)+(367*(t-2-12*a)/12|0)-(3*((l+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*Kn.SECONDS_PER_HOUR+o*Kn.SECONDS_PER_MINUTE+s*Kn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var IVe=/^(\d{4})$/,WVe=/^(\d{4})-(\d{2})$/,wVe=/^(\d{4})-?(\d{3})$/,PVe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,vVe=/^(\d{4})-?(\d{2})-?(\d{2})$/,p3=/([Z+\-])?(\d{2})?:?(\d{2})?$/,FVe=/^(\d{2})(\.\d+)?/.source+p3.source,AVe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+p3.source,MVe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+p3.source,Zm="Invalid ISO 8601 date.";function Wt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??zn.UTC;let i=e|0;t=t+(e-i)*Kn.SECONDS_PER_DAY,v0(i,t,this),n===zn.UTC&&LN(this)}Wt.fromGregorianDate=function(e,t){if(!(e instanceof eh))throw new L("date must be a valid GregorianDate.");let n=h3(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return c(t)?(v0(n[0],n[1],t),LN(t),t):new Wt(n[0],n[1],zn.UTC)};Wt.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new L("date must be a valid JavaScript Date.");let n=h3(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return c(t)?(v0(n[0],n[1],t),LN(t),t):new Wt(n[0],n[1],zn.UTC)};Wt.fromIso8601=function(e,t){if(typeof e!="string")throw new L(Zm);e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,l=0,d=0,u=n[0],f=n[1],p,y;if(!c(u))throw new L(Zm);let h;if(n=u.match(vVe),n!==null){if(h=u.split("-").length-1,h>0&&h!==2)throw new L(Zm);i=+n[1],o=+n[2],r=+n[3]}else if(n=u.match(WVe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(IVe),n!==null)i=+n[1];else{let V;if(n=u.match(wVe),n!==null){if(i=+n[1],V=+n[2],y=Lm(i),V<1||y&&V>366||!y&&V>365)throw new L(Zm)}else if(n=u.match(PVe),n!==null){i=+n[1];let Z=+n[2],R=+n[3]||0;if(h=u.split("-").length-1,h>0&&(!c(n[3])&&h!==1||c(n[3])&&h!==2))throw new L(Zm);let E=new Date(Date.UTC(i,0,4));V=Z*7+R-E.getUTCDay()-3}else throw new L(Zm);p=new Date(Date.UTC(i,0,1)),p.setUTCDate(V),o=p.getUTCMonth()+1,r=p.getUTCDate()}if(y=Lm(i),o<1||o>12||r<1||(o!==2||!y)&&r>SN[o-1]||y&&o===2&&r>CN)throw new L(Zm);let g;if(c(f)){if(n=f.match(MVe),n!==null){if(h=f.split(":").length-1,h>0&&h!==2&&h!==3)throw new L(Zm);s=+n[1],a=+n[2],l=+n[3],d=+(n[4]||0)*1e3,g=5}else if(n=f.match(AVe),n!==null){if(h=f.split(":").length-1,h>2)throw new L(Zm);s=+n[1],a=+n[2],l=+(n[3]||0)*60,g=4}else if(n=f.match(FVe),n!==null)s=+n[1],a=+(n[2]||0)*60,g=3;else throw new L(Zm);if(a>=60||l>=61||s>24||s===24&&(a>0||l>0||d>0))throw new L(Zm);let V=n[g],Z=+n[g+1],R=+(n[g+2]||0);switch(V){case"+":s=s-Z,a=a-R;break;case"-":s=s+Z,a=a+R;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=l===60;for(x&&l--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=y&&o===2?CN:SN[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=y&&o===2?CN:SN[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=y&&o===2?CN:SN[o-1],r+=p;let S=h3(i,o,r,s,a,l,d);return c(t)?(v0(S[0],S[1],t),LN(t)):t=new Wt(S[0],S[1],zn.UTC),x&&Wt.addSeconds(t,1,t),t};Wt.now=function(e){return Wt.fromDate(new Date,e)};var VN=new Wt(0,0,zn.TAI);Wt.toGregorianDate=function(e,t){if(!c(e))throw new L("julianDate is required.");let n=!1,i=Yq(e,VN);c(i)||(Wt.addSeconds(e,-1,VN),i=Yq(VN,VN),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 l=4e3*(s+1)/1461001|0;s=s-(1461*l/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let f=d+2-12*s|0,p=100*(a-49)+l+s|0,y=r/Kn.SECONDS_PER_HOUR|0,h=r-y*Kn.SECONDS_PER_HOUR,g=h/Kn.SECONDS_PER_MINUTE|0;h=h-g*Kn.SECONDS_PER_MINUTE;let x=h|0,S=(h-x)/Kn.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(x+=1),c(t)?(t.year=p,t.month=f,t.day=u,t.hour=y,t.minute=g,t.second=x,t.millisecond=S,t.isLeapSecond=n,t):new eh(p,f,u,y,g,x,S,n)};Wt.toDate=function(e){if(!c(e))throw new L("julianDate is required.");let t=Wt.toGregorianDate(e,Hq),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))};Wt.toIso8601=function(e,t){if(!c(e))throw new L("julianDate is required.");let n=Wt.toGregorianDate(e,Hq),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,l=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&l===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;if(!c(t)&&d!==0){let f=d*.01;return u=f<1e-6?f.toFixed(20).replace(".","").replace(/0+$/,""):f.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")}:${l.toString().padStart(2,"0")}.${u}Z`}return!c(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")}:${l.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${u}Z`)};Wt.clone=function(e,t){if(c(e))return c(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new Wt(e.dayNumber,e.secondsOfDay,zn.TAI)};Wt.compare=function(e,t){if(!c(e))throw new L("left is required.");if(!c(t))throw new L("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};Wt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};Wt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(Wt.secondsDifference(e,t))<=n};Wt.totalDays=function(e){if(!c(e))throw new L("julianDate is required.");return e.dayNumber+e.secondsOfDay/Kn.SECONDS_PER_DAY};Wt.secondsDifference=function(e,t){if(!c(e))throw new L("left is required.");if(!c(t))throw new L("right is required.");return(e.dayNumber-t.dayNumber)*Kn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};Wt.daysDifference=function(e,t){if(!c(e))throw new L("left is required.");if(!c(t))throw new L("right is required.");let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/Kn.SECONDS_PER_DAY;return n+i};Wt.computeTaiMinusUtc=function(e){BS.julianDate=e;let t=Wt.leapSeconds,n=Wo(t,BS,f3);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};Wt.addSeconds=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("seconds is required.");if(!c(n))throw new L("result is required.");return v0(e.dayNumber,e.secondsOfDay+t,n)};Wt.addMinutes=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("minutes is required.");if(!c(n))throw new L("result is required.");let i=e.secondsOfDay+t*Kn.SECONDS_PER_MINUTE;return v0(e.dayNumber,i,n)};Wt.addHours=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("hours is required.");if(!c(n))throw new L("result is required.");let i=e.secondsOfDay+t*Kn.SECONDS_PER_HOUR;return v0(e.dayNumber,i,n)};Wt.addDays=function(e,t,n){if(!c(e))throw new L("julianDate is required.");if(!c(t))throw new L("days is required.");if(!c(n))throw new L("result is required.");let i=e.dayNumber+t;return v0(i,e.secondsOfDay,n)};Wt.lessThan=function(e,t){return Wt.compare(e,t)<0};Wt.lessThanOrEquals=function(e,t){return Wt.compare(e,t)<=0};Wt.greaterThan=function(e,t){return Wt.compare(e,t)>0};Wt.greaterThanOrEquals=function(e,t){return Wt.compare(e,t)>=0};Wt.prototype.clone=function(e){return Wt.clone(this,e)};Wt.prototype.equals=function(e){return Wt.equals(this,e)};Wt.prototype.equalsEpsilon=function(e,t){return Wt.equalsEpsilon(this,e,t)};Wt.prototype.toString=function(){return Wt.toIso8601(this)};Wt.leapSeconds=[new Hi(new Wt(2441317,43210,zn.TAI),10),new Hi(new Wt(2441499,43211,zn.TAI),11),new Hi(new Wt(2441683,43212,zn.TAI),12),new Hi(new Wt(2442048,43213,zn.TAI),13),new Hi(new Wt(2442413,43214,zn.TAI),14),new Hi(new Wt(2442778,43215,zn.TAI),15),new Hi(new Wt(2443144,43216,zn.TAI),16),new Hi(new Wt(2443509,43217,zn.TAI),17),new Hi(new Wt(2443874,43218,zn.TAI),18),new Hi(new Wt(2444239,43219,zn.TAI),19),new Hi(new Wt(2444786,43220,zn.TAI),20),new Hi(new Wt(2445151,43221,zn.TAI),21),new Hi(new Wt(2445516,43222,zn.TAI),22),new Hi(new Wt(2446247,43223,zn.TAI),23),new Hi(new Wt(2447161,43224,zn.TAI),24),new Hi(new Wt(2447892,43225,zn.TAI),25),new Hi(new Wt(2448257,43226,zn.TAI),26),new Hi(new Wt(2448804,43227,zn.TAI),27),new Hi(new Wt(2449169,43228,zn.TAI),28),new Hi(new Wt(2449534,43229,zn.TAI),29),new Hi(new Wt(2450083,43230,zn.TAI),30),new Hi(new Wt(2450630,43231,zn.TAI),31),new Hi(new Wt(2451179,43232,zn.TAI),32),new Hi(new Wt(2453736,43233,zn.TAI),33),new Hi(new Wt(2454832,43234,zn.TAI),34),new Hi(new Wt(2456109,43235,zn.TAI),35),new Hi(new Wt(2457204,43236,zn.TAI),36),new Hi(new Wt(2457754,43237,zn.TAI),37)];var ee=Wt;var mXt=_(T(),1),u$=_(cd(),1);var hGt=_(T(),1);function NVe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var $L=NVe;var bGt=_(T(),1);function $q(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=$q(o,t)),n[i]=o}return n}var He=$q;var xGt=_(T(),1);function e$(e,t,n){n=n??!1;let i={},o=c(e),r=c(t),s,a,l;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(l=t[s],typeof l=="object"?i[s]=e$(a,l,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(l=t[s],i[s]=l);return i}var St=e$;var TGt=_(T(),1);function kVe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Cl=kVe;var LGt=_(T(),1),t$=_(cd(),1);function b3(e,t){let n;return typeof document<"u"&&(n=document),b3._implementation(e,t,n)}b3._implementation=function(e,t,n){if(!c(e))throw new L("relative uri is required.");if(!c(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new t$.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var th=b3;var EGt=_(T(),1),n$=_(cd(),1);function UVe(e,t){if(!c(e))throw new L("uri is required.");let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new n$.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var eZ=UVe;var wGt=_(T(),1),i$=_(cd(),1);function OVe(e){if(!c(e))throw new L("uri is required.");let t=new i$.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 ox=OVe;var FGt=_(T(),1);var o$={};function DVe(e,t,n){c(t)||(t=e.width),c(n)||(n=e.height);let i=o$[t];c(i)||(i={},o$[t]=i);let o=i[n];if(!c(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 Rm=DVe;var NGt=_(T(),1);var BVe=/^blob:/i;function YVe(e){return C.typeOf.string("uri",e),BVe.test(e)}var rx=YVe;var OGt=_(T(),1);var nh;function HVe(e){c(nh)||(nh=document.createElement("a")),nh.href=window.location.href;let t=nh.host,n=nh.protocol;return nh.href=e,nh.href=nh.href,n!==nh.protocol||t!==nh.host}var F0=HVe;var YGt=_(T(),1);var zVe=/^data:/i;function KVe(e){return C.typeOf.string("uri",e),zVe.test(e)}var Sp=KVe;var zGt=_(T(),1);function JVe(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 sx=JVe;var jGt=_(T(),1);function QVe(e){if(!c(e))throw new L("obj is required.");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 ax=QVe;var tEt=_(T(),1);function jVe(e){if(!c(e))throw new L("queryString is required.");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];c(a)?a=decodeURIComponent(a):a="";let l=t[s];typeof l=="string"?t[s]=[l,a]:Array.isArray(l)?l.push(a):t[s]=a}return t}var ld=jVe;var uEt=_(T(),1);var iEt=_(T(),1),qVe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},jn=Object.freeze(qVe);var rEt=_(T(),1),$Ve={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},us=Object.freeze($Ve);function EN(e){e=e??z.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??us.OTHER,this.serverKey=e.serverKey,this.state=jn.UNISSUED,this.deferred=void 0,this.cancelled=!1}EN.prototype.cancel=function(){this.cancelled=!0};EN.prototype.clone=function(e){return c(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=jn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new EN(this)};var Jo=EN;var yEt=_(T(),1);var fEt=_(T(),1);function eLe(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 tZ=eLe;function r$(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=tZ(this.responseHeaders))}r$.prototype.toString=function(){let e="Request has failed.";return c(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var ih=r$;var vEt=_(T(),1),XN=_(cd(),1);var TEt=_(T(),1);function nZ(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(nZ.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});nZ.prototype.addEventListener=function(e,t){C.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};nZ.prototype.removeEventListener=function(e,t){C.typeOf.func("listener",e);let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function tLe(e,t){return t-e}nZ.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];c(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(tLe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var ye=nZ;var LEt=_(T(),1);function cx(e){C.typeOf.object("options",e),C.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(cx.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){C.typeOf.number.greaterThanOrEquals("maximumLength",e,0);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 y3(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}cx.prototype.reserve=function(e){e=e??this._length,this._array.length=e};cx.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?(y3(i,o,e),e=o):r=!1}};cx.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};cx.prototype.insert=function(e){C.defined("element",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)y3(t,o,s),o=s;else break}let r;return c(i)&&this._length>i&&(r=t[i],this._length=i),r};cx.prototype.pop=function(e){if(e=e??0,this._length===0)return;C.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return y3(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var iZ=cx;function nLe(e,t){return e.priority-t.priority}var eo={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},zS=20,nc=new iZ({comparator:nLe});nc.maximumLength=zS;nc.reserve(zS);var oh=[],Cp={},iLe=typeof document<"u"?new XN.default(document.location.href):new XN.default,IN=new ye;function Qo(){}Qo.maximumRequests=50;Qo.maximumRequestsPerServer=18;Qo.requestsByServer={};Qo.throttleRequests=!0;Qo.debugShowStatistics=!1;Qo.requestCompletedEvent=IN;Object.defineProperties(Qo,{statistics:{get:function(){return eo}},priorityHeapLength:{get:function(){return zS},set:function(e){if(e<zS)for(;nc.length>e;){let t=nc.pop();lx(t)}zS=e,nc.maximumLength=e,nc.reserve(e)}}});function s$(e){c(e.priorityFunction)&&(e.priority=e.priorityFunction())}Qo.serverHasOpenSlots=function(e,t){t=t??1;let n=Qo.requestsByServer[e]??Qo.maximumRequestsPerServer;return Cp[e]+t<=n};Qo.heapHasOpenSlots=function(e){return nc.length+e<=zS};function a$(e){return e.state===jn.UNISSUED&&(e.state=jn.ISSUED,e.deferred=Cl()),e.deferred.promise}function oLe(e){return function(t){if(e.state===jn.CANCELLED)return;let n=e.deferred;--eo.numberOfActiveRequests,--Cp[e.serverKey],IN.raiseEvent(),e.state=jn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function rLe(e){return function(t){e.state!==jn.CANCELLED&&(++eo.numberOfFailedRequests,--eo.numberOfActiveRequests,--Cp[e.serverKey],IN.raiseEvent(t),e.state=jn.FAILED,e.deferred.reject(t))}}function c$(e){let t=a$(e);return e.state=jn.ACTIVE,oh.push(e),++eo.numberOfActiveRequests,++eo.numberOfActiveRequestsEver,++Cp[e.serverKey],e.requestFunction().then(oLe(e)).catch(rLe(e)),t}function lx(e){let t=e.state===jn.ACTIVE;if(e.state=jn.CANCELLED,++eo.numberOfCancelledRequests,c(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--eo.numberOfActiveRequests,--Cp[e.serverKey],++eo.numberOfCancelledActiveRequests),c(e.cancelFunction)&&e.cancelFunction()}Qo.update=function(){let e,t,n=0,i=oh.length;for(e=0;e<i;++e){if(t=oh[e],t.cancelled&&lx(t),t.state!==jn.ACTIVE){++n;continue}n>0&&(oh[e-n]=t)}oh.length-=n;let o=nc.internalArray,r=nc.length;for(e=0;e<r;++e)s$(o[e]);nc.resort();let s=Math.max(Qo.maximumRequests-oh.length,0),a=0;for(;a<s&&nc.length>0;){if(t=nc.pop(),t.cancelled){lx(t);continue}if(t.throttleByServer&&!Qo.serverHasOpenSlots(t.serverKey)){lx(t);continue}c$(t),++a}sLe()};Qo.getServerKey=function(e){C.typeOf.string("url",e);let t=new XN.default(e);t.scheme()===""&&(t=t.absoluteTo(iLe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=Cp[n];return c(i)||(Cp[n]=0),n};Qo.request=function(e){if(C.typeOf.object("request",e),C.typeOf.string("request.url",e.url),C.typeOf.func("request.requestFunction",e.requestFunction),Sp(e.url)||rx(e.url))return IN.raiseEvent(),e.state=jn.RECEIVED,e.requestFunction();if(++eo.numberOfAttemptedRequests,c(e.serverKey)||(e.serverKey=Qo.getServerKey(e.url)),Qo.throttleRequests&&e.throttleByServer&&!Qo.serverHasOpenSlots(e.serverKey))return;if(!Qo.throttleRequests||!e.throttle)return c$(e);if(oh.length>=Qo.maximumRequests)return;s$(e);let t=nc.insert(e);if(c(t)){if(t===e)return;lx(t)}return a$(e)};function sLe(){Qo.debugShowStatistics&&(eo.numberOfActiveRequests===0&&eo.lastNumberOfActiveRequests>0&&(eo.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${eo.numberOfAttemptedRequests}`),eo.numberOfAttemptedRequests=0),eo.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${eo.numberOfCancelledRequests}`),eo.numberOfCancelledRequests=0),eo.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${eo.numberOfCancelledActiveRequests}`),eo.numberOfCancelledActiveRequests=0),eo.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${eo.numberOfFailedRequests}`),eo.numberOfFailedRequests=0)),eo.lastNumberOfActiveRequests=eo.numberOfActiveRequests)}Qo.clearForSpecs=function(){for(;nc.length>0;){let t=nc.pop();lx(t)}let e=oh.length;for(let t=0;t<e;++t)lx(oh[t]);oh.length=0,Cp={},eo.numberOfAttemptedRequests=0,eo.numberOfActiveRequests=0,eo.numberOfCancelledRequests=0,eo.numberOfCancelledActiveRequests=0,eo.numberOfFailedRequests=0,eo.numberOfActiveRequestsEver=0,eo.lastNumberOfActiveRequests=0};Qo.numberOfActiveRequestsByServer=function(e){return Cp[e]};Qo.requestHeap=nc;var ic=Qo;var NEt=_(T(),1),l$=_(cd(),1);var oZ={},KS={};oZ.add=function(e,t){if(!c(e))throw new L("host is required.");if(!c(t)||t<=0)throw new L("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(KS[n])||(KS[n]=!0)};oZ.remove=function(e,t){if(!c(e))throw new L("host is required.");if(!c(t)||t<=0)throw new L("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(KS[n])&&delete KS[n]};function aLe(e){let t=new l$.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}}oZ.contains=function(e){if(!c(e))throw new L("url is required.");let t=aLe(e);return!!(c(t)&&c(KS[t]))};oZ.clear=function(){KS={}};var JS=oZ;var m$=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Et(e){e=e??z.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),C.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=rh(e.templateValues,{}),this._queryParameters=rh(e.queryParameters,{}),this.headers=rh(e.headers,{}),this.request=e.request??new Jo,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 rh(e,t){return c(e)?He(e):t}Et.createIfNeeded=function(e){return e instanceof Et?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Et({url:e})};var QS;Et.supportsImageBitmapOptions=function(){return c(QS)?QS:typeof createImageBitmap!="function"?(QS=Promise.resolve(!1),QS):(QS=Et.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=Rm(t[0]),i=Rm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),QS)};Object.defineProperties(Et,{isBlobSupported:{get:function(){return m$}}});Object.defineProperties(Et.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 ox(this._url)}},isDataUri:{get:function(){return Sp(this._url)}},isBlobUri:{get:function(){return rx(this._url)}},isCrossOriginUrl:{get:function(){return F0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Et.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Et.prototype.parseUrl=function(e,t,n,i){let o=new u$.default(e),r=cLe(o.query());this._queryParameters=t?wN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),c(i)&&o.scheme()===""&&(o=o.absoluteTo(th(i))),this._url=o.toString()};function cLe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:ld(e)}function wN(e,t,n){if(!n)return St(e,t);let i=He(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];c(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Et.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${lLe(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 c(s)?encodeURIComponent(s):o})),t&&c(this.proxy)&&(n=this.proxy.getURL(n)),n};function lLe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!c(e[t[0]])?`?${t[0]}`:`?${ax(e)}`}Et.prototype.setQueryParameters=function(e,t){t?this._queryParameters=wN(this._queryParameters,e,!1):this._queryParameters=wN(e,this._queryParameters,!1)};Et.prototype.appendQueryParameters=function(e){this._queryParameters=wN(e,this._queryParameters,!0)};Et.prototype.setTemplateValues=function(e,t){t?this._templateValues=St(this._templateValues,e):this._templateValues=St(e,this._templateValues)};Et.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,c(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return c(e.queryParameters)&&(t._queryParameters=St(e.queryParameters,t.queryParameters)),c(e.templateValues)&&(t._templateValues=St(e.templateValues,t.templateValues)),c(e.headers)&&(t.headers=St(e.headers,t.headers)),c(e.proxy)&&(t.proxy=e.proxy),c(e.request)&&(t.request=e.request),c(e.retryCallback)&&(t.retryCallback=e.retryCallback),c(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Et.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})};Et.prototype.clone=function(e){return c(e)?(e._url=this._url,e._queryParameters=He(this._queryParameters),e._templateValues=He(this._templateValues),e.headers=He(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Et({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:c(this.credits)?this.credits.slice():void 0})};Et.prototype.getBaseUri=function(e){return eZ(this.getUrlComponent(e),e)};Et.prototype.appendForwardSlash=function(){this._url=$L(this._url)};Et.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Et.fetchArrayBuffer=function(e){return new Et(e).fetchArrayBuffer()};Et.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Et.fetchBlob=function(e){return new Et(e).fetchBlob()};Et.prototype.fetchImage=function(e){e=e??z.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(x3(this.request),!m$||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return g3({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!c(r))return;let s,a,l,d;return Et.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!c(u))return;if(d=u,a)return Et.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let f=window.URL.createObjectURL(u);return l=new Et({url:f}),g3({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(c(u))return u.blob=d,a||window.URL.revokeObjectURL(l.url),u}).catch(function(u){return c(l)&&window.URL.revokeObjectURL(l.url),u.blob=d,Promise.reject(u)})};function g3(e){let t=e.resource,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 l=Cl();return Et._Implementations.createImage(r,a,l,n,i,o),l.promise};let s=ic.request(r);if(c(s))return s.catch(function(a){return r.state!==jn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(l){return l?(r.state=jn.UNISSUED,r.deferred=void 0,g3({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Et.fetchImage=function(e){return new Et(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Et.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Et.fetchText=function(e){return new Et(e).fetchText()};Et.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(c(e))return e.then(function(t){if(c(t))return JSON.parse(t)})};Et.fetchJson=function(e){return new Et(e).fetchJson()};Et.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Et.fetchXML=function(e){return new Et(e).fetchXML()};Et.prototype.fetchJsonp=function(e){e=e??"callback",x3(this.request);let t;do t=`loadJsonp${w.nextRandomNumber().toString().substring(2,8)}`;while(c(window[t]));return f$(this,e,t)};function f$(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=Cl();return window[n]=function(l){a.resolve(l);try{delete window[n]}catch{window[n]=void 0}},Et._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=ic.request(o);if(c(s))return s.catch(function(a){return o.state!==jn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(l){return l?(o.state=jn.UNISSUED,o.deferred=void 0,f$(e,t,n)):Promise.reject(a)})})}Et.fetchJsonp=function(e){return new Et(e).fetchJsonp(e.callbackParameterName)};Et.prototype._makeRequest=function(e){let t=this;x3(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,l=e.method,d=e.data,u=Cl(),f=Et._Implementations.loadWithXhr(i,r,l,d,s,u,a);return c(f)&&c(f.abort)&&(n.cancelFunction=function(){f.abort()}),u.promise};let o=ic.request(n);if(c(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==jn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=jn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function x3(e){if(e.state===jn.ISSUED||e.state===jn.ACTIVE)throw new le("The Resource is already being fetched.");e.state=jn.UNISSUED,e.deferred=void 0}var dLe=/^data:(.*?)(;base64)?,(.*)$/;function WN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function d$(e,t){let n=WN(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 uLe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return WN(i,o);case"arraybuffer":return d$(i,o);case"blob":return r=d$(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(WN(i,o),n);case"json":return JSON.parse(WN(i,o));default:throw new L(`Unhandled responseType: ${t}`)}}Et.prototype.fetch=function(e){return e=rh(e,{}),e.method="GET",this._makeRequest(e)};Et.fetch=function(e){return new Et(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.delete=function(e){return e=rh(e,{}),e.method="DELETE",this._makeRequest(e)};Et.delete=function(e){return new Et(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Et.prototype.head=function(e){return e=rh(e,{}),e.method="HEAD",this._makeRequest(e)};Et.head=function(e){return new Et(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.options=function(e){return e=rh(e,{}),e.method="OPTIONS",this._makeRequest(e)};Et.options=function(e){return new Et(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.post=function(e,t){return C.defined("data",e),t=rh(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Et.post=function(e){return new Et(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.put=function(e,t){return C.defined("data",e),t=rh(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Et.put=function(e){return new Et(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et.prototype.patch=function(e,t){return C.defined("data",e),t=rh(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Et.patch=function(e){return new Et(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Et._Implementations={};Et._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&&(JS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Et._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Et.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Et._Implementations.loadImageElement(s,t,n);return}let l="blob",d="GET",u=Cl(),f=Et._Implementations.loadWithXhr(s,l,d,void 0,void 0,u,void 0,void 0,void 0);return c(f)&&c(f.abort)&&(e.cancelFunction=function(){f.abort()}),u.promise.then(function(p){if(!c(p)){n.reject(new le(`Successfully retrieved ${s} but it contained no content.`));return}return Et.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Et.createImageBitmapFromBlob=function(e,t){return C.defined("options",t),C.typeOf.bool("options.flipY",t.flipY),C.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),C.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function mLe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let l={};a.headers.forEach((d,u)=>{l[u]=d}),r.reject(new ih(a.status,a,l));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 ih)})}var fLe=typeof XMLHttpRequest>"u";Et._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=dLe.exec(e);if(a!==null){r.resolve(uLe(a,t));return}if(fLe){mLe(e,t,n,i,o,r,s);return}let l=new XMLHttpRequest;if(JS.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),c(s)&&c(l.overrideMimeType)&&l.overrideMimeType(s),c(o))for(let u in o)o.hasOwnProperty(u)&&l.setRequestHeader(u,o[u]);c(t)&&(l.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(d&&l.status===0)){r.reject(new ih(l.status,l.response,l.getAllResponseHeaders()));return}let u=l.response,f=l.responseType;if(n==="HEAD"||n==="OPTIONS"){let y=l.getAllResponseHeaders().trim().split(/[\r\n]+/),h={};y.forEach(function(g){let x=g.split(": "),S=x.shift();h[S]=x.join(": ")}),r.resolve(h);return}if(l.status===204)r.resolve(void 0);else if(c(u)&&(!c(t)||f===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(f===""||f==="document")&&c(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(f===""||f==="text")&&c(l.responseText)?r.resolve(l.responseText):r.reject(new le("Invalid XMLHttpRequest response type."))},l.onerror=function(u){r.reject(new ih)},l.send(i),l};Et._Implementations.loadAndExecuteScript=function(e,t,n){return sx(e,t).catch(function(i){n.reject(i)})};Et._DefaultImplementations={};Et._DefaultImplementations.createImage=Et._Implementations.createImage;Et._DefaultImplementations.loadWithXhr=Et._Implementations.loadWithXhr;Et._DefaultImplementations.loadAndExecuteScript=Et._Implementations.loadAndExecuteScript;Et.DEFAULT=Object.freeze(new Et({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ge=Et;function sZ(e){e=e??z.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,c(e.data)?h$(this,e.data):h$(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}sZ.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new le(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new sZ({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};sZ.NONE=Object.freeze({compute:function(e,t){return c(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new P0(0,0,0,0,0),t}});sZ.prototype.compute=function(e,t){if(!c(this._samples))return;if(c(t)||(t=new P0(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(c(i)){let a=n[i],l=n[i+1],d=ee.lessThanOrEquals(a,e),u=!c(l),f=u||ee.greaterThanOrEquals(l,e);if(d&&f)return o=i,!u&&l.equals(e)&&++o,r=o+1,b$(this,n,this._samples,e,o,r,t),t}let s=Wo(n,e,ee.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,b$(this,n,this._samples,e,o,r,t),t};function hLe(e,t){return ee.compare(e.julianDate,t)}function h$(e,t){if(!c(t.columnNames))throw new le("Error in loaded EOP data: The columnNames property is required.");if(!c(t.samples))throw new le("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"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||l<0)throw new le("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let d=e._samples=t.samples,u=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let f,p=e._addNewLeapSeconds;for(let y=0,h=d.length;y<h;y+=e._columnCount){let g=d[y+n],x=d[y+l],S=g+Kn.MODIFIED_JULIAN_DATE_DIFFERENCE,V=new ee(S,x,zn.TAI);if(u.push(V),p){if(x!==f&&c(f)){let Z=ee.leapSeconds,R=Wo(Z,V,hLe);if(R<0){let E=new Hi(V,x);Z.splice(~R,0,E)}}f=x}}}function p$(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 rZ(e,t,n){return t+e*(n-t)}function b$(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 l=t[o],d=t[r];if(l.equals(d)||i.equals(l))return p$(e,n,o,a,s),s;if(i.equals(d))return p$(e,n,r,a,s),s;let u=ee.secondsDifference(i,l)/ee.secondsDifference(d,l),f=o*a,p=r*a,y=n[f+e._ut1MinusUtcSecondsColumn],h=n[p+e._ut1MinusUtcSecondsColumn],g=h-y;if(g>.5||g<-.5){let x=n[f+e._taiMinusUtcSecondsColumn],S=n[p+e._taiMinusUtcSecondsColumn];x!==S&&(d.equals(i)?y=h:h-=S-x)}return s.xPoleWander=rZ(u,n[f+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=rZ(u,n[f+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=rZ(u,n[f+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=rZ(u,n[f+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=rZ(u,y,h),s}var aZ=sZ;var XXt=_(T(),1);function oc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}oc.fromQuaternion=function(e,t){if(!c(e))throw new L("quaternion is required");c(t)||(t=new oc);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=-w.asinClamped(n),t};oc.fromDegrees=function(e,t,n,i){if(!c(e))throw new L("heading is required");if(!c(t))throw new L("pitch is required");if(!c(n))throw new L("roll is required");return c(i)||(i=new oc),i.heading=e*w.RADIANS_PER_DEGREE,i.pitch=t*w.RADIANS_PER_DEGREE,i.roll=n*w.RADIANS_PER_DEGREE,i};oc.clone=function(e,t){if(c(e))return c(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new oc(e.heading,e.pitch,e.roll)};oc.equals=function(e,t){return e===t||c(e)&&c(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};oc.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&w.equalsEpsilon(e.heading,t.heading,n,i)&&w.equalsEpsilon(e.pitch,t.pitch,n,i)&&w.equalsEpsilon(e.roll,t.roll,n,i)};oc.prototype.clone=function(e){return oc.clone(this,e)};oc.prototype.equals=function(e){return oc.equals(this,e)};oc.prototype.equalsEpsilon=function(e,t,n){return oc.equalsEpsilon(this,e,t,n)};oc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ea=oc;var KXt=_(T(),1);var FXt=_(T(),1);var y$={};var g$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function pLe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=g$.exec(i);if(o!==null)return o[1]}}var PN;function x$(e){return typeof document>"u"?e:(c(PN)||(PN=document.createElement("a")),PN.href=e,PN.href)}var dx;function _$(){if(c(dx))return dx;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:c(y$?.url)?e=th(".",y$.url):typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(iN.toUrl)?e=th("..",ux("Core/buildModuleUrl.js")):e=pLe(),!c(e))throw new L("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return dx=new Ge({url:x$(e)}),dx.appendForwardSlash(),dx}function bLe(e){return x$(iN.toUrl(`../${e}`))}function T$(e){return _$().getDerivedResource({url:e}).url}var vN;function ux(e){return c(vN)||(typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(iN.toUrl)?vN=bLe:vN=T$),vN(e)}ux._cesiumScriptRegex=g$;ux._buildModuleUrlFromBaseUrl=T$;ux._clearBaseResource=function(){dx=void 0};ux.setBaseUrl=function(e){dx=Ge.DEFAULT.getDerivedResource({url:e})};ux.getCesiumBaseUrl=_$;var on=ux;var NXt=_(T(),1);function yLe(e,t,n){this.x=e,this.y=t,this.s=n}var mx=yLe;function S3(e){e=e??z.EMPTY_OBJECT,this._xysFileUrlTemplate=Ge.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new ee(this._sampleZeroJulianEphemerisDate,0,zn.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 gLe=new ee(0,0,zn.TAI);function _3(e,t,n){let i=gLe;return i.dayNumber=t,i.secondsOfDay=n,ee.daysDifference(i,e._sampleZeroDateTT)}S3.prototype.preload=function(e,t,n,i){let o=_3(this,e,t),r=_3(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 l=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let f=l;f<=d;++f)u.push(T3(this,f));return Promise.all(u)};S3.prototype.computeXysRadians=function(e,t,n){let i=_3(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 l=!1,d=this._samples;if(c(d[s*3])||(T3(this,s/this._samplesPerXysFile|0),l=!0),c(d[a*3])||(T3(this,a/this._samplesPerXysFile|0),l=!0),l)return;c(n)?(n.x=0,n.y=0,n.s=0):n=new mx(0,0,0);let u=i-s*this._stepSizeDays,f=this._work,p=this._denominators,y=this._coef,h=this._xTable,g,x;for(g=0;g<=r;++g)f[g]=u-h[g];for(g=0;g<=r;++g){for(y[g]=1,x=0;x<=r;++x)x!==g&&(y[g]*=f[x]);y[g]*=p[g];let S=(s+g)*3;n.x+=y[g]*d[S++],n.y+=y[g]*d[S++],n.s+=y[g]*d[S]}return n};function T3(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;c(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ge({url:on(`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,l=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[l+d]=a[d]});return e._chunkDownloadsInProgress[t]=o,o}var cZ=S3;var nIt=_(T(),1);function ot(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var lZ=new m;ot.fromAxisAngle=function(e,t,n){C.typeOf.object("axis",e),C.typeOf.number("angle",t);let i=t/2,o=Math.sin(i);lZ=m.normalize(e,lZ);let r=lZ.x*o,s=lZ.y*o,a=lZ.z*o,l=Math.cos(i);return c(n)?(n.x=r,n.y=s,n.z=a,n.w=l,n):new ot(r,s,a,l)};var xLe=[1,2,0],_Le=new Array(3);ot.fromRotationMatrix=function(e,t){C.typeOf.object("matrix",e);let n,i,o,r,s,a=e[te.COLUMN0ROW0],l=e[te.COLUMN1ROW1],d=e[te.COLUMN2ROW2],u=a+l+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[te.COLUMN1ROW2]-e[te.COLUMN2ROW1])*n,o=(e[te.COLUMN2ROW0]-e[te.COLUMN0ROW2])*n,r=(e[te.COLUMN0ROW1]-e[te.COLUMN1ROW0])*n;else{let f=xLe,p=0;l>a&&(p=1),d>a&&d>l&&(p=2);let y=f[p],h=f[y];n=Math.sqrt(e[te.getElementIndex(p,p)]-e[te.getElementIndex(y,y)]-e[te.getElementIndex(h,h)]+1);let g=_Le;g[p]=.5*n,n=.5/n,s=(e[te.getElementIndex(h,y)]-e[te.getElementIndex(y,h)])*n,g[y]=(e[te.getElementIndex(y,p)]+e[te.getElementIndex(p,y)])*n,g[h]=(e[te.getElementIndex(h,p)]+e[te.getElementIndex(p,h)])*n,i=-g[0],o=-g[1],r=-g[2]}return c(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ot(i,o,r,s)};var S$=new ot,C$=new ot,C3=new ot,V$=new ot;ot.fromHeadingPitchRoll=function(e,t){return C.typeOf.object("headingPitchRoll",e),V$=ot.fromAxisAngle(m.UNIT_X,e.roll,S$),C3=ot.fromAxisAngle(m.UNIT_Y,-e.pitch,t),t=ot.multiply(C3,V$,C3),C$=ot.fromAxisAngle(m.UNIT_Z,-e.heading,S$),ot.multiply(C$,t,t)};var FN=new m,V3=new m,Gm=new ot,L$=new ot,AN=new ot;ot.packedLength=4;ot.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ot.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new ot),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ot.packedInterpolationLength=3;ot.convertPackedArrayForInterpolation=function(e,t,n,i){ot.unpack(e,n*4,AN),ot.conjugate(AN,AN);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;ot.unpack(e,(t+o)*4,Gm),ot.multiply(Gm,AN,Gm),Gm.w<0&&ot.negate(Gm,Gm),ot.computeAxis(Gm,FN);let a=ot.computeAngle(Gm);c(i)||(i=[]),i[s]=FN.x*a,i[s+1]=FN.y*a,i[s+2]=FN.z*a}};ot.unpackInterpolationResult=function(e,t,n,i,o){c(o)||(o=new ot),m.fromArray(e,0,V3);let r=m.magnitude(V3);return ot.unpack(t,i*4,L$),r===0?ot.clone(ot.IDENTITY,Gm):ot.fromAxisAngle(V3,r,Gm),ot.multiply(Gm,L$,o)};ot.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new ot(e.x,e.y,e.z,e.w)};ot.conjugate=function(e,t){return C.typeOf.object("quaternion",e),C.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};ot.magnitudeSquared=function(e){return C.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};ot.magnitude=function(e){return Math.sqrt(ot.magnitudeSquared(e))};ot.normalize=function(e,t){C.typeOf.object("result",t);let n=1/ot.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};ot.inverse=function(e,t){C.typeOf.object("result",t);let n=ot.magnitudeSquared(e);return t=ot.conjugate(e,t),ot.multiplyByScalar(t,1/n,t)};ot.add=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};ot.subtract=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};ot.negate=function(e,t){return C.typeOf.object("quaternion",e),C.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};ot.dot=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};ot.multiply=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,l=t.y,d=t.z,u=t.w,f=s*a+i*u+o*d-r*l,p=s*l-i*d+o*u+r*a,y=s*d+i*l-o*a+r*u,h=s*u-i*a-o*l-r*d;return n.x=f,n.y=p,n.z=y,n.w=h,n};ot.multiplyByScalar=function(e,t,n){return C.typeOf.object("quaternion",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};ot.divideByScalar=function(e,t,n){return C.typeOf.object("quaternion",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};ot.computeAxis=function(e,t){C.typeOf.object("quaternion",e),C.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<w.EPSILON6||Math.abs(n+1)<w.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};ot.computeAngle=function(e){return C.typeOf.object("quaternion",e),Math.abs(e.w-1)<w.EPSILON6?0:2*Math.acos(e.w)};var L3=new ot;ot.lerp=function(e,t,n,i){return C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i),L3=ot.multiplyByScalar(t,n,L3),i=ot.multiplyByScalar(e,1-n,i),ot.add(L3,i,i)};var Z$=new ot,Z3=new ot,R3=new ot;ot.slerp=function(e,t,n,i){C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i);let o=ot.dot(e,t),r=t;if(o<0&&(o=-o,r=Z$=ot.negate(t,Z$)),1-o<w.EPSILON6)return ot.lerp(e,r,n,i);let s=Math.acos(o);return Z3=ot.multiplyByScalar(e,Math.sin((1-n)*s),Z3),R3=ot.multiplyByScalar(r,Math.sin(n*s),R3),i=ot.add(Z3,R3,i),ot.multiplyByScalar(i,1/Math.sin(s),i)};ot.log=function(e,t){C.typeOf.object("quaternion",e),C.typeOf.object("result",t);let n=w.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),m.multiplyByScalar(e,i,t)};ot.exp=function(e,t){C.typeOf.object("cartesian",e),C.typeOf.object("result",t);let n=m.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var TLe=new m,SLe=new m,dZ=new ot,jS=new ot;ot.computeInnerQuadrangle=function(e,t,n,i){C.typeOf.object("q0",e),C.typeOf.object("q1",t),C.typeOf.object("q2",n),C.typeOf.object("result",i);let o=ot.conjugate(t,dZ);ot.multiply(o,n,jS);let r=ot.log(jS,TLe);ot.multiply(o,e,jS);let s=ot.log(jS,SLe);return m.add(r,s,r),m.multiplyByScalar(r,.25,r),m.negate(r,r),ot.exp(r,dZ),ot.multiply(t,dZ,i)};ot.squad=function(e,t,n,i,o,r){C.typeOf.object("q0",e),C.typeOf.object("q1",t),C.typeOf.object("s0",n),C.typeOf.object("s1",i),C.typeOf.number("t",o),C.typeOf.object("result",r);let s=ot.slerp(e,t,o,dZ),a=ot.slerp(n,i,o,jS);return ot.slerp(s,a,2*o*(1-o),r)};var CLe=new ot,R$=1.9011074535173003,MN=Ot.supportsTypedArrays()?new Float32Array(8):[],NN=Ot.supportsTypedArrays()?new Float32Array(8):[],Vp=Ot.supportsTypedArrays()?new Float32Array(8):[],Lp=Ot.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;MN[e]=1/(t*n),NN[e]=t/n}MN[7]=R$/(8*17);NN[7]=R$*8/17;ot.fastSlerp=function(e,t,n,i){C.typeOf.object("start",e),C.typeOf.object("end",t),C.typeOf.number("t",n),C.typeOf.object("result",i);let o=ot.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,l=n*n,d=a*a;for(let y=7;y>=0;--y)Vp[y]=(MN[y]*l-NN[y])*s,Lp[y]=(MN[y]*d-NN[y])*s;let u=r*n*(1+Vp[0]*(1+Vp[1]*(1+Vp[2]*(1+Vp[3]*(1+Vp[4]*(1+Vp[5]*(1+Vp[6]*(1+Vp[7])))))))),f=a*(1+Lp[0]*(1+Lp[1]*(1+Lp[2]*(1+Lp[3]*(1+Lp[4]*(1+Lp[5]*(1+Lp[6]*(1+Lp[7])))))))),p=ot.multiplyByScalar(e,f,CLe);return ot.multiplyByScalar(t,u,i),ot.add(p,i,i)};ot.fastSquad=function(e,t,n,i,o,r){C.typeOf.object("q0",e),C.typeOf.object("q1",t),C.typeOf.object("s0",n),C.typeOf.object("s1",i),C.typeOf.number("t",o),C.typeOf.object("result",r);let s=ot.fastSlerp(e,t,o,dZ),a=ot.fastSlerp(n,i,o,jS);return ot.fastSlerp(s,a,2*o*(1-o),r)};ot.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ot.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};ot.ZERO=Object.freeze(new ot(0,0,0,0));ot.IDENTITY=Object.freeze(new ot(0,0,0,1));ot.prototype.clone=function(e){return ot.clone(this,e)};ot.prototype.equals=function(e){return ot.equals(this,e)};ot.prototype.equalsEpsilon=function(e,t){return ot.equalsEpsilon(this,e,t)};ot.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Fe=ot;var mi={},G3={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"}},qS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},E3={},Vl={east:new m,north:new m,up:new m,west:new m,south:new m,down:new m},A0=new m,M0=new m,N0=new m;mi.localFrameToFixedFrameGenerator=function(e,t){if(!G3.hasOwnProperty(e)||!G3[e].hasOwnProperty(t))throw new L("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=G3[e][t],i,o=e+t;return c(E3[o])?i=E3[o]:(i=function(r,s,a){if(!c(r))throw new L("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new L("origin has a NaN component");if(c(a)||(a=new M),m.equalsEpsilon(r,m.ZERO,w.EPSILON14))m.unpack(qS[e],0,A0),m.unpack(qS[t],0,M0),m.unpack(qS[n],0,N0);else if(w.equalsEpsilon(r.x,0,w.EPSILON14)&&w.equalsEpsilon(r.y,0,w.EPSILON14)){let l=w.sign(r.z);m.unpack(qS[e],0,A0),e!=="east"&&e!=="west"&&m.multiplyByScalar(A0,l,A0),m.unpack(qS[t],0,M0),t!=="east"&&t!=="west"&&m.multiplyByScalar(M0,l,M0),m.unpack(qS[n],0,N0),n!=="east"&&n!=="west"&&m.multiplyByScalar(N0,l,N0)}else{s=s??re.default,s.geodeticSurfaceNormal(r,Vl.up);let l=Vl.up,d=Vl.east;d.x=-r.y,d.y=r.x,d.z=0,m.normalize(d,Vl.east),m.cross(l,d,Vl.north),m.multiplyByScalar(Vl.up,-1,Vl.down),m.multiplyByScalar(Vl.east,-1,Vl.west),m.multiplyByScalar(Vl.north,-1,Vl.south),A0=Vl[e],M0=Vl[t],N0=Vl[n]}return a[0]=A0.x,a[1]=A0.y,a[2]=A0.z,a[3]=0,a[4]=M0.x,a[5]=M0.y,a[6]=M0.z,a[7]=0,a[8]=N0.x,a[9]=N0.y,a[10]=N0.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},E3[o]=i),i};mi.eastNorthUpToFixedFrame=mi.localFrameToFixedFrameGenerator("east","north");mi.northEastDownToFixedFrame=mi.localFrameToFixedFrameGenerator("north","east");mi.northUpEastToFixedFrame=mi.localFrameToFixedFrameGenerator("north","up");mi.northWestUpToFixedFrame=mi.localFrameToFixedFrameGenerator("north","west");var VLe=new Fe,LLe=new m(1,1,1),ZLe=new M;mi.headingPitchRollToFixedFrame=function(e,t,n,i,o){C.typeOf.object("HeadingPitchRoll",t),i=i??mi.eastNorthUpToFixedFrame;let r=Fe.fromHeadingPitchRoll(t,VLe),s=M.fromTranslationQuaternionRotationScale(m.ZERO,r,LLe,ZLe);return o=i(e,n,o),M.multiply(o,s,o)};var RLe=new M,GLe=new te;mi.headingPitchRollQuaternion=function(e,t,n,i,o){C.typeOf.object("HeadingPitchRoll",t);let r=mi.headingPitchRollToFixedFrame(e,t,n,i,RLe),s=M.getMatrix3(r,GLe);return Fe.fromRotationMatrix(s,o)};var ELe=new m(1,1,1),XLe=new m,G$=new M,ILe=new M,WLe=new te,wLe=new Fe;mi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){C.defined("transform",e),t=t??re.default,n=n??mi.eastNorthUpToFixedFrame,c(i)||(i=new Ea);let o=M.getTranslation(e,XLe);if(m.equals(o,m.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,G$),G$),s=M.setScale(e,ELe,ILe);s=M.setTranslation(s,m.ZERO,s),r=M.multiply(r,s,r);let a=Fe.fromRotationMatrix(M.getMatrix3(r,WLe),wLe);return a=Fe.normalize(a,a),Ea.fromQuaternion(a,i)};var PLe=6*3600+41*60+50.54841,vLe=8640184812866e-6,FLe=.093104,ALe=-62e-7,MLe=11772758384668e-32,NLe=72921158553e-15,kLe=w.TWO_PI/86400,kN=new ee;mi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=mi.computeIcrfToFixedMatrix(e,t);return c(n)||(n=mi.computeTemeToPseudoFixedMatrix(e,t)),n};mi.computeTemeToPseudoFixedMatrix=function(e,t){if(!c(e))throw new L("date is required.");kN=ee.addSeconds(e,-ee.computeTaiMinusUtc(e),kN);let n=kN.dayNumber,i=kN.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/Kn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Kn.DAYS_PER_JULIAN_CENTURY;let a=(PLe+o*(vLe+o*(FLe+o*ALe)))*kLe%w.TWO_PI,l=NLe+MLe*(n-24515455e-1),d=(i+Kn.SECONDS_PER_DAY*.5)%Kn.SECONDS_PER_DAY,u=a+l*d,f=Math.cos(u),p=Math.sin(u);return c(t)?(t[0]=f,t[1]=-p,t[2]=0,t[3]=p,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new te(f,p,0,-p,f,0,0,0,1)};mi.iau2006XysData=new cZ;mi.earthOrientationParameters=aZ.NONE;var W3=32.184,ULe=2451545;mi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+W3,i=e.stop.dayNumber,o=e.stop.secondsOfDay+W3;return mi.iau2006XysData.preload(t,n,i,o)};mi.computeIcrfToFixedMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=mi.computeFixedToIcrfMatrix(e,t);if(c(n))return te.transpose(n,t)};var OLe=32.184,DLe=2451545,UN=new Ea,BLe=new te,YLe=new ee;mi.computeMoonFixedToIcrfMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=ee.addSeconds(e,OLe,YLe),i=ee.totalDays(n)-DLe,o=w.toRadians(12.112)-w.toRadians(.052992)*i,r=w.toRadians(24.224)-w.toRadians(.105984)*i,s=w.toRadians(227.645)+w.toRadians(13.012)*i,a=w.toRadians(261.105)+w.toRadians(13.340716)*i,l=w.toRadians(358)+w.toRadians(.9856)*i;return UN.pitch=w.toRadians(180)-w.toRadians(3.878)*Math.sin(o)-w.toRadians(.12)*Math.sin(r)+w.toRadians(.07)*Math.sin(s)-w.toRadians(.017)*Math.sin(a),UN.roll=w.toRadians(66.53-90)+w.toRadians(1.543)*Math.cos(o)+w.toRadians(.24)*Math.cos(r)-w.toRadians(.028)*Math.cos(s)+w.toRadians(.007)*Math.cos(a),UN.heading=w.toRadians(244.375-90)+w.toRadians(13.17635831)*i+w.toRadians(3.558)*Math.sin(o)+w.toRadians(.121)*Math.sin(r)-w.toRadians(.064)*Math.sin(s)+w.toRadians(.016)*Math.sin(a)+w.toRadians(.025)*Math.sin(l),te.fromHeadingPitchRoll(UN,BLe)};mi.computeIcrfToMoonFixedMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=mi.computeMoonFixedToIcrfMatrix(e,t);if(c(n))return te.transpose(n,t)};var HLe=new mx(0,0,0),zLe=new P0(0,0,0,0,0,0),X3=new te,I3=new te;mi.computeFixedToIcrfMatrix=function(e,t){if(!c(e))throw new L("date is required.");c(t)||(t=new te);let n=mi.earthOrientationParameters.compute(e,zLe);if(!c(n))return;let i=e.dayNumber,o=e.secondsOfDay+W3,r=mi.iau2006XysData.computeXysRadians(i,o,HLe);if(!c(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-s*s-a*a)),d=X3;d[0]=1-l*s*s,d[3]=-l*s*a,d[6]=s,d[1]=-l*s*a,d[4]=1-l*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-l*(s*s+a*a);let u=te.fromRotationZ(-r.s,I3),f=te.multiply(d,u,X3),p=e.dayNumber,y=e.secondsOfDay-ee.computeTaiMinusUtc(e)+n.ut1MinusUtc,h=p-2451545,g=y/Kn.SECONDS_PER_DAY,x=.779057273264+g+.00273781191135448*(h+g);x=x%1*w.TWO_PI;let S=te.fromRotationZ(x,I3),V=te.multiply(f,S,X3),Z=Math.cos(n.xPoleWander),R=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),v=i-ULe+o/Kn.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*w.RADIANS_PER_DEGREE/3600,F=Math.cos(P),N=Math.sin(P),b=I3;return b[0]=Z*F,b[1]=Z*N,b[2]=E,b[3]=-R*N+I*E*F,b[4]=R*F+I*E*N,b[5]=-I*Z,b[6]=-I*N-R*E*F,b[7]=I*F-R*E*N,b[8]=R*Z,te.multiply(V,b,t)};var KLe=new ce;mi.pointToWindowCoordinates=function(e,t,n,i){return i=mi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};mi.pointToGLWindowCoordinates=function(e,t,n,i){if(!c(e))throw new L("modelViewProjectionMatrix is required.");if(!c(t))throw new L("viewportTransformation is required.");if(!c(n))throw new L("point is required.");c(i)||(i=new D);let o=KLe;return M.multiplyByVector(e,ce.fromElements(n.x,n.y,n.z,1,o),o),ce.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var JLe=new m,QLe=new m,jLe=new m;mi.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!c(e))throw new L("position is required.");if(!c(t))throw new L("velocity is required.");let o=(n??re.default).geodeticSurfaceNormal(e,JLe),r=m.cross(t,o,QLe);m.equalsEpsilon(r,m.ZERO,w.EPSILON6)&&(r=m.clone(m.UNIT_X,r));let s=m.cross(r,t,jLe);return m.normalize(s,s),m.cross(t,s,r),m.negate(r,r),m.normalize(r,r),c(i)||(i=new te),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};var E$=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),X$=new pe,w3=new m,qLe=new m,$Le=new te,P3=new M,I$=new M;mi.basisTo2D=function(e,t,n){if(!c(e))throw new L("projection is required.");if(!c(t))throw new L("matrix is required.");if(!c(n))throw new L("result is required.");let i=M.getTranslation(t,qLe),o=e.ellipsoid,r;if(m.equals(i,m.ZERO))r=m.clone(m.ZERO,w3);else{let u=o.cartesianToCartographic(i,X$);r=e.project(u,w3),m.fromElements(r.z,r.x,r.y,r)}let s=mi.eastNorthUpToFixedFrame(i,o,P3),a=M.inverseTransformation(s,I$),l=M.getMatrix3(t,$Le),d=M.multiplyByMatrix3(a,l,n);return M.multiply(E$,d,n),M.setTranslation(n,r,n),n};mi.ellipsoidTo2DModelMatrix=function(e,t,n){if(!c(e))throw new L("projection is required.");if(!c(t))throw new L("center is required.");if(!c(n))throw new L("result is required.");let i=e.ellipsoid,o=mi.eastNorthUpToFixedFrame(t,i,P3),r=M.inverseTransformation(o,I$),s=i.cartesianToCartographic(t,X$),a=e.project(s,w3);m.fromElements(a.z,a.x,a.y,a);let l=M.fromTranslation(a,P3);return M.multiply(E$,r,n),M.multiply(l,n,n),n};var wt=mi;function En(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(En.prototype,{width:{get:function(){return En.computeWidth(this)}},height:{get:function(){return En.computeHeight(this)}}});En.packedLength=4;En.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};En.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new En),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};En.computeWidth=function(e){C.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=w.TWO_PI),t-n};En.computeHeight=function(e){return C.typeOf.object("rectangle",e),e.north-e.south};En.fromDegrees=function(e,t,n,i,o){return e=w.toRadians(e??0),t=w.toRadians(t??0),n=w.toRadians(n??0),i=w.toRadians(i??0),c(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new En(e,t,n,i)};En.fromRadians=function(e,t,n,i,o){return c(o)?(o.west=e??0,o.south=t??0,o.east=n??0,o.north=i??0,o):new En(e,t,n,i)};En.fromCartographicArray=function(e,t){C.defined("cartographics",e);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 l=0,d=e.length;l<d;l++){let u=e[l];n=Math.min(n,u.longitude),i=Math.max(i,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);let f=u.longitude>=0?u.longitude:u.longitude+w.TWO_PI;o=Math.min(o,f),r=Math.max(r,f)}return i-n>r-o&&(n=o,i=r,i>w.PI&&(i=i-w.TWO_PI),n>w.PI&&(n=n-w.TWO_PI)),c(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new En(n,s,i,a)};En.fromCartesianArray=function(e,t,n){C.defined("cartesians",e),t=t??re.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let d=0,u=e.length;d<u;d++){let f=t.cartesianToCartographic(e[d]);i=Math.min(i,f.longitude),o=Math.max(o,f.longitude),a=Math.min(a,f.latitude),l=Math.max(l,f.latitude);let p=f.longitude>=0?f.longitude:f.longitude+w.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>w.PI&&(o=o-w.TWO_PI),i>w.PI&&(i=i-w.TWO_PI)),c(n)?(n.west=i,n.south=a,n.east=o,n.north=l,n):new En(i,a,o,l)};var eZe=new m,tZe=new m,nZe=new m,iZe=new m,oZe=new m,v3=new Array(5);for(let e=0;e<v3.length;++e)v3[e]=new m;En.fromBoundingSphere=function(e,t,n){C.typeOf.object("boundingSphere",e);let i=e.center,o=e.radius;if(c(t)||(t=re.default),c(n)||(n=new En),m.equals(i,m.ZERO))return En.clone(En.MAX_VALUE,n),n;let r=wt.eastNorthUpToFixedFrame(i,t,eZe),s=M.multiplyByPointAsVector(r,m.UNIT_X,tZe);m.normalize(s,s);let a=M.multiplyByPointAsVector(r,m.UNIT_Y,nZe);m.normalize(a,a),m.multiplyByScalar(a,o,a),m.multiplyByScalar(s,o,s);let l=m.negate(a,oZe),d=m.negate(s,iZe),u=v3,f=u[0];return m.add(i,a,f),f=u[1],m.add(i,d,f),f=u[2],m.add(i,l,f),f=u[3],m.add(i,s,f),u[4]=i,En.fromCartesianArray(u,t,n)};En.clone=function(e,t){if(c(e))return c(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new En(e.west,e.south,e.east,e.north)};En.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};En.prototype.clone=function(e){return En.clone(this,e)};En.prototype.equals=function(e){return En.equals(this,e)};En.equals=function(e,t){return e===t||c(e)&&c(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};En.prototype.equalsEpsilon=function(e,t){return En.equalsEpsilon(this,e,t)};En._validate=function(e){C.typeOf.object("rectangle",e);let t=e.north;C.typeOf.number.greaterThanOrEquals("north",t,-w.PI_OVER_TWO),C.typeOf.number.lessThanOrEquals("north",t,w.PI_OVER_TWO);let n=e.south;C.typeOf.number.greaterThanOrEquals("south",n,-w.PI_OVER_TWO),C.typeOf.number.lessThanOrEquals("south",n,w.PI_OVER_TWO);let i=e.west;C.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),C.typeOf.number.lessThanOrEquals("west",i,Math.PI);let o=e.east;C.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),C.typeOf.number.lessThanOrEquals("east",o,Math.PI)};En.southwest=function(e,t){return C.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new pe(e.west,e.south)};En.northwest=function(e,t){return C.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new pe(e.west,e.north)};En.northeast=function(e,t){return C.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new pe(e.east,e.north)};En.southeast=function(e,t){return C.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new pe(e.east,e.south)};En.center=function(e,t){C.typeOf.object("rectangle",e);let n=e.east,i=e.west;n<i&&(n+=w.TWO_PI);let o=w.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return c(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new pe(o,r)};En.intersection=function(e,t,n){C.typeOf.object("rectangle",e),C.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=w.TWO_PI:r<s&&i>0&&(r+=w.TWO_PI),i<o&&s<0?s+=w.TWO_PI:r<s&&o<0&&(o+=w.TWO_PI);let a=w.negativePiToPi(Math.max(o,s)),l=w.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&l<=a)return;let d=Math.max(e.south,t.south),u=Math.min(e.north,t.north);if(!(d>=u))return c(n)?(n.west=a,n.south=d,n.east=l,n.north=u,n):new En(a,d,l,u)};En.simpleIntersection=function(e,t,n){C.typeOf.object("rectangle",e),C.typeOf.object("otherRectangle",t);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 c(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new En(i,o,r,s)};En.union=function(e,t,n){C.typeOf.object("rectangle",e),C.typeOf.object("otherRectangle",t),c(n)||(n=new En);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=w.TWO_PI:r<s&&i>0&&(r+=w.TWO_PI),i<o&&s<0?s+=w.TWO_PI:r<s&&o<0&&(o+=w.TWO_PI);let a=w.negativePiToPi(Math.min(o,s)),l=w.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=l,n.north=Math.max(e.north,t.north),n};En.expand=function(e,t,n){return C.typeOf.object("rectangle",e),C.typeOf.object("cartographic",t),c(n)||(n=new En),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};En.contains=function(e,t){C.typeOf.object("rectangle",e),C.typeOf.object("cartographic",t);let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=w.TWO_PI,n<0&&(n+=w.TWO_PI)),(n>o||w.equalsEpsilon(n,o,w.EPSILON14))&&(n<r||w.equalsEpsilon(n,r,w.EPSILON14))&&i>=e.south&&i<=e.north};var rZe=new pe;En.subsample=function(e,t,n,i){C.typeOf.object("rectangle",e),t=t??re.default,n=n??0,c(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,l=e.west,d=rZe;d.height=n,d.longitude=l,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=l,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*w.PI_OVER_TWO,En.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=l,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};En.subsection=function(e,t,n,i,o,r){if(C.typeOf.object("rectangle",e),C.typeOf.number.greaterThanOrEquals("westLerp",t,0),C.typeOf.number.lessThanOrEquals("westLerp",t,1),C.typeOf.number.greaterThanOrEquals("southLerp",n,0),C.typeOf.number.lessThanOrEquals("southLerp",n,1),C.typeOf.number.greaterThanOrEquals("eastLerp",i,0),C.typeOf.number.lessThanOrEquals("eastLerp",i,1),C.typeOf.number.greaterThanOrEquals("northLerp",o,0),C.typeOf.number.lessThanOrEquals("northLerp",o,1),C.typeOf.number.lessThanOrEquals("westLerp",t,i),C.typeOf.number.lessThanOrEquals("southLerp",n,o),c(r)||(r=new En),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=w.TWO_PI+e.east-e.west;r.west=w.negativePiToPi(e.west+t*a),r.east=w.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};En.MAX_VALUE=Object.freeze(new En(-Math.PI,-w.PI_OVER_TWO,Math.PI,w.PI_OVER_TWO));var de=En;function vr(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}vr.packedLength=4;vr.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};vr.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new vr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};vr.fromPoints=function(e,t){if(c(t)||(t=new vr),!c(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 l=e[a],d=l.x,u=l.y;i=Math.min(d,i),r=Math.max(d,r),o=Math.min(u,o),s=Math.max(u,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var W$=new Xi,sZe=new pe,aZe=new pe;vr.fromRectangle=function(e,t,n){if(c(n)||(n=new vr),!c(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;W$._ellipsoid=re.default,t=t??W$;let i=t.project(de.southwest(e,sZe)),o=t.project(de.northeast(e,aZe));return D.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};vr.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new vr(e.x,e.y,e.width,e.height)};vr.union=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),c(n)||(n=new vr);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};vr.expand=function(e,t,n){C.typeOf.object("rectangle",e),C.typeOf.object("point",t),n=vr.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};vr.intersect=function(e,t){C.typeOf.object("left",e),C.typeOf.object("right",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?zt.OUTSIDE:zt.INTERSECTING};vr.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};vr.prototype.clone=function(e){return vr.clone(this,e)};vr.prototype.intersect=function(e){return vr.intersect(this,e)};vr.prototype.equals=function(e){return vr.equals(this,e)};var je=vr;var HIt=_(T(),1);var Xa={POINTS:oe.POINTS,LINES:oe.LINES,LINE_LOOP:oe.LINE_LOOP,LINE_STRIP:oe.LINE_STRIP,TRIANGLES:oe.TRIANGLES,TRIANGLE_STRIP:oe.TRIANGLE_STRIP,TRIANGLE_FAN:oe.TRIANGLE_FAN};Xa.isLines=function(e){return e===Xa.LINES||e===Xa.LINE_LOOP||e===Xa.LINE_STRIP};Xa.isTriangles=function(e){return e===Xa.TRIANGLES||e===Xa.TRIANGLE_STRIP||e===Xa.TRIANGLE_FAN};Xa.validate=function(e){return e===Xa.POINTS||e===Xa.LINES||e===Xa.LINE_LOOP||e===Xa.LINE_STRIP||e===Xa.TRIANGLES||e===Xa.TRIANGLE_STRIP||e===Xa.TRIANGLE_FAN};var ve=Object.freeze(Xa);var KIt=_(T(),1),fx=`in vec4 position;
in vec2 textureCoordinates;
out vec2 v_textureCoordinates;
void main()
{
gl_Position = position;
v_textureCoordinates = textureCoordinates;
}
`;var $It=_(T(),1);var Tr={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 uZ(e){e=e??z.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??ve.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 rc(e,t){return(e._flags&t)===t}function k0(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(uZ.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 rc(this,Tr.CULL)},set:function(e){rc(this,Tr.CULL)!==e&&(k0(this,Tr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return rc(this,Tr.OCCLUDE)},set:function(e){rc(this,Tr.OCCLUDE)!==e&&(k0(this,Tr.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 rc(this,Tr.CAST_SHADOWS)},set:function(e){rc(this,Tr.CAST_SHADOWS)!==e&&(k0(this,Tr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return rc(this,Tr.RECEIVE_SHADOWS)},set:function(e){rc(this,Tr.RECEIVE_SHADOWS)!==e&&(k0(this,Tr.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 rc(this,Tr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){rc(this,Tr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(k0(this,Tr.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 rc(this,Tr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){rc(this,Tr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(k0(this,Tr.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 rc(this,Tr.PICK_ONLY)},set:function(e){rc(this,Tr.PICK_ONLY)!==e&&(k0(this,Tr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return rc(this,Tr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){rc(this,Tr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(k0(this,Tr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});uZ.shallowClone=function(e,t){if(c(e))return c(t)||(t=new uZ),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};uZ.prototype.execute=function(e,t){e.draw(this,t)};var et=uZ;var gWt=_(T(),1);var sWt=_(T(),1);var nWt=_(T(),1);var fi={UNSIGNED_BYTE:oe.UNSIGNED_BYTE,UNSIGNED_SHORT:oe.UNSIGNED_SHORT,UNSIGNED_INT:oe.UNSIGNED_INT,FLOAT:oe.FLOAT,HALF_FLOAT:oe.HALF_FLOAT_OES,UNSIGNED_INT_24_8:oe.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:oe.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:oe.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:oe.UNSIGNED_SHORT_5_6_5};fi.toWebGLConstant=function(e,t){switch(e){case fi.UNSIGNED_BYTE:return oe.UNSIGNED_BYTE;case fi.UNSIGNED_SHORT:return oe.UNSIGNED_SHORT;case fi.UNSIGNED_INT:return oe.UNSIGNED_INT;case fi.FLOAT:return oe.FLOAT;case fi.HALF_FLOAT:return t.webgl2?oe.HALF_FLOAT:oe.HALF_FLOAT_OES;case fi.UNSIGNED_INT_24_8:return oe.UNSIGNED_INT_24_8;case fi.UNSIGNED_SHORT_4_4_4_4:return oe.UNSIGNED_SHORT_4_4_4_4;case fi.UNSIGNED_SHORT_5_5_5_1:return oe.UNSIGNED_SHORT_5_5_5_1;case fi.UNSIGNED_SHORT_5_6_5:return fi.UNSIGNED_SHORT_5_6_5}};fi.isPacked=function(e){return e===fi.UNSIGNED_INT_24_8||e===fi.UNSIGNED_SHORT_4_4_4_4||e===fi.UNSIGNED_SHORT_5_5_5_1||e===fi.UNSIGNED_SHORT_5_6_5};fi.sizeInBytes=function(e){switch(e){case fi.UNSIGNED_BYTE:return 1;case fi.UNSIGNED_SHORT:case fi.UNSIGNED_SHORT_4_4_4_4:case fi.UNSIGNED_SHORT_5_5_5_1:case fi.UNSIGNED_SHORT_5_6_5:case fi.HALF_FLOAT:return 2;case fi.UNSIGNED_INT:case fi.FLOAT:case fi.UNSIGNED_INT_24_8:return 4}};fi.validate=function(e){return e===fi.UNSIGNED_BYTE||e===fi.UNSIGNED_SHORT||e===fi.UNSIGNED_INT||e===fi.FLOAT||e===fi.HALF_FLOAT||e===fi.UNSIGNED_INT_24_8||e===fi.UNSIGNED_SHORT_4_4_4_4||e===fi.UNSIGNED_SHORT_5_5_5_1||e===fi.UNSIGNED_SHORT_5_6_5};fi.getTypedArrayConstructor=function(e){let t=fi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===fi.FLOAT?Float32Array:Uint32Array};var Ue=Object.freeze(fi);var at={DEPTH_COMPONENT:oe.DEPTH_COMPONENT,DEPTH_STENCIL:oe.DEPTH_STENCIL,ALPHA:oe.ALPHA,RED:oe.RED,RG:oe.RG,RGB:oe.RGB,RGBA:oe.RGBA,LUMINANCE:oe.LUMINANCE,LUMINANCE_ALPHA:oe.LUMINANCE_ALPHA,RGB_DXT1:oe.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:oe.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:oe.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:oe.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:oe.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:oe.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:oe.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:oe.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:oe.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:oe.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:oe.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:oe.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:oe.COMPRESSED_RGBA_BPTC_UNORM};at.componentsLength=function(e){switch(e){case at.RGB:return 3;case at.RGBA:return 4;case at.LUMINANCE_ALPHA:case at.RG:return 2;case at.ALPHA:case at.RED:case at.LUMINANCE:return 1;default:return 1}};at.validate=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL||e===at.ALPHA||e===at.RED||e===at.RG||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA||e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isColorFormat=function(e){return e===at.RED||e===at.ALPHA||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA};at.isDepthFormat=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL};at.isCompressedFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isDXTFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5};at.isPVRTCFormat=function(e){return e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1};at.isASTCFormat=function(e){return e===at.RGBA_ASTC};at.isETC1Format=function(e){return e===at.RGB_ETC1};at.isETC2Format=function(e){return e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC};at.isBC7Format=function(e){return e===at.RGBA_BC7};at.compressedTextureSizeInBytes=function(e,t,n){switch(e){case at.RGB_DXT1:case at.RGBA_DXT1:case at.RGB_ETC1:case at.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case at.RGBA_DXT3:case at.RGBA_DXT5:case at.RGBA_ASTC:case at.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case at.RGB_PVRTC_4BPPV1:case at.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case at.RGB_PVRTC_2BPPV1:case at.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case at.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};at.textureSizeInBytes=function(e,t,n,i){let o=at.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};at.alignmentInBytes=function(e,t,n){let i=at.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};at.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=at.componentsLength(e)*n*i;return new o(r)};at.flipY=function(e,t,n,i,o){if(o===1)return e;let r=at.createTypedArray(t,n,i,o),s=at.componentsLength(t),a=i*s;for(let l=0;l<o;++l){let d=l*i*s,u=(o-l-1)*i*s;for(let f=0;f<a;++f)r[u+f]=e[d+f]}return r};at.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===at.DEPTH_STENCIL)return oe.DEPTH24_STENCIL8;if(e===at.DEPTH_COMPONENT){if(t===Ue.UNSIGNED_SHORT)return oe.DEPTH_COMPONENT16;if(t===Ue.UNSIGNED_INT)return oe.DEPTH_COMPONENT24}if(t===Ue.FLOAT)switch(e){case at.RGBA:return oe.RGBA32F;case at.RGB:return oe.RGB32F;case at.RG:return oe.RG32F;case at.RED:return oe.R32F}if(t===Ue.HALF_FLOAT)switch(e){case at.RGBA:return oe.RGBA16F;case at.RGB:return oe.RGB16F;case at.RG:return oe.RG16F;case at.RED:return oe.R16F}return e};var ke=Object.freeze(at);var cWt=_(T(),1),Sr={_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(Sr,{maximumCombinedTextureImageUnits:{get:function(){return Sr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Sr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Sr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Sr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Sr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Sr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return Sr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Sr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Sr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Sr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Sr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Sr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Sr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Sr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Sr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Sr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Sr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Sr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Sr._maximumColorAttachments}},maximumSamples:{get:function(){return Sr._maximumSamples}},highpFloatSupported:{get:function(){return Sr._highpFloatSupported}},highpIntSupported:{get:function(){return Sr._highpIntSupported}}});var mt=Sr;function F3(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function ON(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Em(e){e=e??z.EMPTY_OBJECT;let t=e.context;C.defined("options.context",t);let n=t._gl,i=mt.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,c(e.colorTextures)&&c(e.colorRenderbuffers))throw new L("Cannot have both color texture and color renderbuffer attachments.");if(c(e.depthTexture)&&c(e.depthRenderbuffer))throw new L("Cannot have both a depth texture and depth renderbuffer attachment.");if(c(e.depthStencilTexture)&&c(e.depthStencilRenderbuffer))throw new L("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");let o=c(e.depthTexture)||c(e.depthRenderbuffer),r=c(e.depthStencilTexture)||c(e.depthStencilRenderbuffer);if(o&&r)throw new L("Cannot have both a depth and depth-stencil attachment.");if(c(e.stencilRenderbuffer)&&r)throw new L("Cannot have both a stencil and depth-stencil attachment.");if(o&&c(e.stencilRenderbuffer))throw new L("Cannot have both a depth and stencil attachment.");if(this._bind(),c(e.colorTextures)){let s=e.colorTextures,a=this._colorTextures.length=this._activeColorAttachments.length=s.length;if(a>i)throw new L("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let d=s[l];if(!ke.isColorFormat(d.pixelFormat))throw new L("The color-texture pixel-format must be a color format.");if(d.pixelDatatype===Ue.FLOAT&&!t.colorBufferFloat)throw new L("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(d.pixelDatatype===Ue.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new L("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");let u=this._gl.COLOR_ATTACHMENT0+l;F3(this,u,d),this._activeColorAttachments[l]=u,this._colorTextures[l]=d}}if(c(e.colorRenderbuffers)){let s=e.colorRenderbuffers,a=this._colorRenderbuffers.length=this._activeColorAttachments.length=s.length;if(a>i)throw new L("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let d=s[l],u=this._gl.COLOR_ATTACHMENT0+l;ON(this,u,d),this._activeColorAttachments[l]=u,this._colorRenderbuffers[l]=d}}if(c(e.depthTexture)){let s=e.depthTexture;if(s.pixelFormat!==ke.DEPTH_COMPONENT)throw new L("The depth-texture pixel-format must be DEPTH_COMPONENT.");F3(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s}if(c(e.depthRenderbuffer)){let s=e.depthRenderbuffer;ON(this,this._gl.DEPTH_ATTACHMENT,s),this._depthRenderbuffer=s}if(c(e.stencilRenderbuffer)){let s=e.stencilRenderbuffer;ON(this,this._gl.STENCIL_ATTACHMENT,s),this._stencilRenderbuffer=s}if(c(e.depthStencilTexture)){let s=e.depthStencilTexture;if(s.pixelFormat!==ke.DEPTH_STENCIL)throw new L("The depth-stencil pixel-format must be DEPTH_STENCIL.");F3(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s}if(c(e.depthStencilRenderbuffer)){let s=e.depthStencilRenderbuffer;ON(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilRenderbuffer=s}this._unBind()}Object.defineProperties(Em.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)}}});Em.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Em.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Em.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Em.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Em.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Em.prototype.getColorTexture=function(e){if(!c(e)||e<0||e>=this._colorTextures.length)throw new L("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]};Em.prototype.getColorRenderbuffer=function(e){if(!c(e)||e<0||e>=this._colorRenderbuffers.length)throw new L("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]};Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];c(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];c(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),he(this)};var Fr=Em;var PWt=_(T(),1);var TWt=_(T(),1);var DN={CLOCKWISE:oe.CW,COUNTER_CLOCKWISE:oe.CCW};DN.validate=function(e){return e===DN.CLOCKWISE||e===DN.COUNTER_CLOCKWISE};var qr=Object.freeze(DN);var CWt=_(T(),1);function w$(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]=w$(e[t]));return Object.freeze(e)}var mZ=w$;function P$(e){return e===oe.FUNC_ADD||e===oe.FUNC_SUBTRACT||e===oe.FUNC_REVERSE_SUBTRACT||e===oe.MIN||e===oe.MAX}function BN(e){return e===oe.ZERO||e===oe.ONE||e===oe.SRC_COLOR||e===oe.ONE_MINUS_SRC_COLOR||e===oe.DST_COLOR||e===oe.ONE_MINUS_DST_COLOR||e===oe.SRC_ALPHA||e===oe.ONE_MINUS_SRC_ALPHA||e===oe.DST_ALPHA||e===oe.ONE_MINUS_DST_ALPHA||e===oe.CONSTANT_COLOR||e===oe.ONE_MINUS_CONSTANT_COLOR||e===oe.CONSTANT_ALPHA||e===oe.ONE_MINUS_CONSTANT_ALPHA||e===oe.SRC_ALPHA_SATURATE}function cZe(e){return e===oe.FRONT||e===oe.BACK||e===oe.FRONT_AND_BACK}function lZe(e){return e===oe.NEVER||e===oe.LESS||e===oe.EQUAL||e===oe.LEQUAL||e===oe.GREATER||e===oe.NOTEQUAL||e===oe.GEQUAL||e===oe.ALWAYS}function v$(e){return e===oe.NEVER||e===oe.LESS||e===oe.EQUAL||e===oe.LEQUAL||e===oe.GREATER||e===oe.NOTEQUAL||e===oe.GEQUAL||e===oe.ALWAYS}function $S(e){return e===oe.ZERO||e===oe.KEEP||e===oe.REPLACE||e===oe.INCR||e===oe.DECR||e===oe.INVERT||e===oe.INCR_WRAP||e===oe.DECR_WRAP}function ah(e){let t=e??z.EMPTY_OBJECT,n=t.cull??z.EMPTY_OBJECT,i=t.polygonOffset??z.EMPTY_OBJECT,o=t.scissorTest??z.EMPTY_OBJECT,r=o.rectangle??z.EMPTY_OBJECT,s=t.depthRange??z.EMPTY_OBJECT,a=t.depthTest??z.EMPTY_OBJECT,l=t.colorMask??z.EMPTY_OBJECT,d=t.blending??z.EMPTY_OBJECT,u=d.color??z.EMPTY_OBJECT,f=t.stencilTest??z.EMPTY_OBJECT,p=f.frontOperation??z.EMPTY_OBJECT,y=f.backOperation??z.EMPTY_OBJECT,h=t.sampleCoverage??z.EMPTY_OBJECT,g=t.viewport;if(this.frontFace=t.frontFace??qr.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??oe.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:je.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??oe.LESS},this.colorMask={red:l.red??!0,green:l.green??!0,blue:l.blue??!0,alpha:l.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:d.enabled??!1,color:new Y(u.red??0,u.green??0,u.blue??0,u.alpha??0),equationRgb:d.equationRgb??oe.FUNC_ADD,equationAlpha:d.equationAlpha??oe.FUNC_ADD,functionSourceRgb:d.functionSourceRgb??oe.ONE,functionSourceAlpha:d.functionSourceAlpha??oe.ONE,functionDestinationRgb:d.functionDestinationRgb??oe.ZERO,functionDestinationAlpha:d.functionDestinationAlpha??oe.ZERO},this.stencilTest={enabled:f.enabled??!1,frontFunction:f.frontFunction??oe.ALWAYS,backFunction:f.backFunction??oe.ALWAYS,reference:f.reference??0,mask:f.mask??-1,frontOperation:{fail:p.fail??oe.KEEP,zFail:p.zFail??oe.KEEP,zPass:p.zPass??oe.KEEP},backOperation:{fail:y.fail??oe.KEEP,zFail:y.zFail??oe.KEEP,zPass:y.zPass??oe.KEEP}},this.sampleCoverage={enabled:h.enabled??!1,value:h.value??1,invert:h.invert??!1},this.viewport=c(g)?new je(g.x,g.y,g.width,g.height):void 0,this.lineWidth<mt.minimumAliasedLineWidth||this.lineWidth>mt.maximumAliasedLineWidth)throw new L("renderState.lineWidth is out of range.  Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!qr.validate(this.frontFace))throw new L("Invalid renderState.frontFace.");if(!cZe(this.cull.face))throw new L("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new L("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new L("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new L("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new L("renderState.depthRange.far must be less than or equal to one.");if(!lZe(this.depthTest.func))throw new L("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new L("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!P$(this.blending.equationRgb))throw new L("Invalid renderState.blending.equationRgb.");if(!P$(this.blending.equationAlpha))throw new L("Invalid renderState.blending.equationAlpha.");if(!BN(this.blending.functionSourceRgb))throw new L("Invalid renderState.blending.functionSourceRgb.");if(!BN(this.blending.functionSourceAlpha))throw new L("Invalid renderState.blending.functionSourceAlpha.");if(!BN(this.blending.functionDestinationRgb))throw new L("Invalid renderState.blending.functionDestinationRgb.");if(!BN(this.blending.functionDestinationAlpha))throw new L("Invalid renderState.blending.functionDestinationAlpha.");if(!v$(this.stencilTest.frontFunction))throw new L("Invalid renderState.stencilTest.frontFunction.");if(!v$(this.stencilTest.backFunction))throw new L("Invalid renderState.stencilTest.backFunction.");if(!$S(this.stencilTest.frontOperation.fail))throw new L("Invalid renderState.stencilTest.frontOperation.fail.");if(!$S(this.stencilTest.frontOperation.zFail))throw new L("Invalid renderState.stencilTest.frontOperation.zFail.");if(!$S(this.stencilTest.frontOperation.zPass))throw new L("Invalid renderState.stencilTest.frontOperation.zPass.");if(!$S(this.stencilTest.backOperation.fail))throw new L("Invalid renderState.stencilTest.backOperation.fail.");if(!$S(this.stencilTest.backOperation.zFail))throw new L("Invalid renderState.stencilTest.backOperation.zFail.");if(!$S(this.stencilTest.backOperation.zPass))throw new L("Invalid renderState.stencilTest.backOperation.zPass.");if(c(this.viewport)){if(this.viewport.width<0)throw new L("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new L("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>mt.maximumViewportWidth)throw new L(`renderState.viewport.width must be less than or equal to the maximum viewport width (${mt.maximumViewportWidth.toString()}).  Check maximumViewportWidth.`);if(this.viewport.height>mt.maximumViewportHeight)throw new L(`renderState.viewport.height must be less than or equal to the maximum viewport height (${mt.maximumViewportHeight.toString()}).  Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}var dZe=0,sh={};ah.fromCache=function(e){let t=JSON.stringify(e),n=sh[t];if(c(n))return++n.referenceCount,n.state;let i=new ah(e),o=JSON.stringify(i);return n=sh[o],c(n)||(i.id=dZe++,i=mZ(i),n={referenceCount:0,state:i},sh[o]=n),++n.referenceCount,sh[t]={referenceCount:1,state:n.state},n.state};ah.removeFromCache=function(e){let t=new ah(e),n=JSON.stringify(t),i=sh[n],o=JSON.stringify(e),r=sh[o];c(r)&&(--r.referenceCount,r.referenceCount===0&&(delete sh[o],c(i)&&--i.referenceCount)),c(i)&&i.referenceCount===0&&delete sh[n]};ah.getCache=function(){return sh};ah.clearCache=function(){sh={}};function hx(e,t,n){n?e.enable(t):e.disable(t)}function F$(e,t){e.frontFace(t.frontFace)}function A$(e,t){let n=t.cull,i=n.enabled;hx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function M$(e,t){e.lineWidth(t.lineWidth)}function N$(e,t){let n=t.polygonOffset,i=n.enabled;hx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function k$(e,t,n){let i=t.scissorTest,o=c(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(hx(e,e.SCISSOR_TEST,o),o){let r=c(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function U$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function O$(e,t){let n=t.depthTest,i=n.enabled;hx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function D$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function B$(e,t){e.depthMask(t.depthMask)}function Y$(e,t){e.stencilMask(t.stencilMask)}function uZe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function H$(e,t,n){let i=t.blending,o=c(n.blendingEnabled)?n.blendingEnabled:i.enabled;hx(e,e.BLEND,o),o&&(uZe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function z$(e,t){let n=t.stencilTest,i=n.enabled;if(hx(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 l=n.frontOperation,d=l.fail,u=l.zFail,f=l.zPass;e.stencilOpSeparate(e.FRONT,d,u,f);let p=n.backOperation,y=p.fail,h=p.zFail,g=p.zPass;e.stencilOpSeparate(e.BACK,y,h,g)}}function K$(e,t){let n=t.sampleCoverage,i=n.enabled;hx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var mZe=new je;function J$(e,t,n){let i=t.viewport??n.viewport;c(i)||(i=mZe,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)}ah.apply=function(e,t,n){F$(e,t),A$(e,t),M$(e,t),N$(e,t),U$(e,t),O$(e,t),D$(e,t),B$(e,t),Y$(e,t),z$(e,t),K$(e,t),k$(e,t,n),H$(e,t,n),J$(e,t,n)};function fZe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(F$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(A$),e.lineWidth!==t.lineWidth&&n.push(M$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(N$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(U$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(O$),(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(D$),e.depthMask!==t.depthMask&&n.push(B$),e.stencilMask!==t.stencilMask&&n.push(Y$),(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(z$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(K$),n}ah.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];c(u)||(u=fZe(t,n),n._applyFunctions[t.id]=u);let f=u.length;for(let p=0;p<f;++p)u[p](e,n)}let s=c(i.scissorTest)?i.scissorTest:t.scissorTest,a=c(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&k$(e,n,o);let l=c(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,d=c(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(l!==d||d&&t.blending!==n.blending)&&H$(e,n,o),(t!==n||i!==o||i.context!==o.context)&&J$(e,n,o)};ah.getState=function(e){if(!c(e))throw new L("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:je.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:Y.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:c(e.viewport)?je.clone(e.viewport):void 0}};var Oe=ah;var Swt=_(T(),1);var qWt=_(T(),1);var kWt=_(T(),1);function jt(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}jt.packedLength=4;jt.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};jt.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new jt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};jt.packArray=function(e,t){C.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new L("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)jt.pack(e[o],t,o*4);return t};jt.unpackArray=function(e,t){if(C.defined("array",e),C.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new L("array length must be a multiple of 4.");let n=e.length;c(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=jt.unpack(e,i,t[o])}return t};jt.clone=function(e,t){if(c(e))return c(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new jt(e[0],e[2],e[1],e[3])};jt.fromArray=jt.unpack;jt.fromColumnMajorArray=function(e,t){return C.defined("values",e),jt.clone(e,t)};jt.fromRowMajorArray=function(e,t){return C.defined("values",e),c(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new jt(e[0],e[1],e[2],e[3])};jt.fromScale=function(e,t){return C.typeOf.object("scale",e),c(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new jt(e.x,0,0,e.y)};jt.fromUniformScale=function(e,t){return C.typeOf.number("scale",e),c(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new jt(e,0,0,e)};jt.fromRotation=function(e,t){C.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new jt(n,-i,i,n)};jt.toArray=function(e,t){return C.typeOf.object("matrix",e),c(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]]};jt.getElementIndex=function(e,t){return C.typeOf.number.greaterThanOrEquals("row",t,0),C.typeOf.number.lessThanOrEquals("row",t,1),C.typeOf.number.greaterThanOrEquals("column",e,0),C.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};jt.getColumn=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,1),C.typeOf.object("result",n);let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};jt.setColumn=function(e,t,n,i){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,1),C.typeOf.object("cartesian",n),C.typeOf.object("result",i),i=jt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};jt.getRow=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,1),C.typeOf.object("result",n);let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};jt.setRow=function(e,t,n,i){return C.typeOf.object("matrix",e),C.typeOf.number.greaterThanOrEquals("index",t,0),C.typeOf.number.lessThanOrEquals("index",t,1),C.typeOf.object("cartesian",n),C.typeOf.object("result",i),i=jt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var hZe=new D;jt.setScale=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("scale",t),C.typeOf.object("result",n);let i=jt.getScale(e,hZe),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 pZe=new D;jt.setUniformScale=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.number("scale",t),C.typeOf.object("result",n);let i=jt.getScale(e,pZe),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 Q$=new D;jt.getScale=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t.x=D.magnitude(D.fromElements(e[0],e[1],Q$)),t.y=D.magnitude(D.fromElements(e[2],e[3],Q$)),t};var j$=new D;jt.getMaximumScale=function(e){return jt.getScale(e,j$),D.maximumComponent(j$)};var bZe=new D;jt.setRotation=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("result",n);let i=jt.getScale(e,bZe);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 yZe=new D;jt.getRotation=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",t);let n=jt.getScale(e,yZe);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};jt.multiply=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",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};jt.add=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};jt.subtract=function(e,t,n){return C.typeOf.object("left",e),C.typeOf.object("right",t),C.typeOf.object("result",n),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};jt.multiplyByVector=function(e,t,n){C.typeOf.object("matrix",e),C.typeOf.object("cartesian",t),C.typeOf.object("result",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};jt.multiplyByScalar=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.number("scalar",t),C.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};jt.multiplyByScale=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.object("scale",t),C.typeOf.object("result",n),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};jt.multiplyByUniformScale=function(e,t,n){return C.typeOf.object("matrix",e),C.typeOf.number("scale",t),C.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};jt.negate=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};jt.transpose=function(e,t){C.typeOf.object("matrix",e),C.typeOf.object("result",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};jt.abs=function(e,t){return C.typeOf.object("matrix",e),C.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};jt.equals=function(e,t){return e===t||c(e)&&c(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};jt.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]};jt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(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};jt.IDENTITY=Object.freeze(new jt(1,0,0,1));jt.ZERO=Object.freeze(new jt(0,0,0,0));jt.COLUMN0ROW0=0;jt.COLUMN0ROW1=1;jt.COLUMN1ROW0=2;jt.COLUMN1ROW1=3;Object.defineProperties(jt.prototype,{length:{get:function(){return jt.packedLength}}});jt.prototype.clone=function(e){return jt.clone(this,e)};jt.prototype.equals=function(e){return jt.equals(this,e)};jt.prototype.equalsEpsilon=function(e,t){return jt.equalsEpsilon(this,e,t)};jt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var Ii=jt;function gZe(e,t,n,i){switch(t.type){case e.FLOAT:return new q$(e,t,n,i);case e.FLOAT_VEC2:return new $$(e,t,n,i);case e.FLOAT_VEC3:return new eee(e,t,n,i);case e.FLOAT_VEC4:return new tee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new A3(e,t,n,i);case e.INT:case e.BOOL:return new nee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new iee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new oee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new ree(e,t,n,i);case e.FLOAT_MAT2:return new see(e,t,n,i);case e.FLOAT_MAT3:return new aee(e,t,n,i);case e.FLOAT_MAT4:return new cee(e,t,n,i);default:throw new le(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function q$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}q$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function $$(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}$$.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function eee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}eee.prototype.set=function(){let e=this.value;if(c(e.red))Y.equals(e,this._value)||(this._value=Y.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if(c(e.x))m.equals(e,this._value)||(this._value=m.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new L(`Invalid vec3 value for uniform "${this.name}".`)};function tee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}tee.prototype.set=function(){let e=this.value;if(c(e.red))Y.equals(e,this._value)||(this._value=Y.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if(c(e.x))ce.equals(e,this._value)||(this._value=ce.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w));else throw new L(`Invalid vec4 value for uniform "${this.name}".`)};function A3(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}A3.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};A3.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function nee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}nee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function iee(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}iee.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function oee(e,t,n,i){this.name=n,this.value=void 0,this._value=new m,this._gl=e,this._location=i}oee.prototype.set=function(){let e=this.value;m.equals(e,this._value)||(m.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function ree(e,t,n,i){this.name=n,this.value=void 0,this._value=new ce,this._gl=e,this._location=i}ree.prototype.set=function(){let e=this.value;ce.equals(e,this._value)||(ce.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var xZe=new Float32Array(4);function see(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ii,this._gl=e,this._location=i}see.prototype.set=function(){if(!Ii.equalsArray(this.value,this._value,0)){Ii.clone(this.value,this._value);let e=Ii.toArray(this.value,xZe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var _Ze=new Float32Array(9);function aee(e,t,n,i){this.name=n,this.value=void 0,this._value=new te,this._gl=e,this._location=i}aee.prototype.set=function(){if(!te.equalsArray(this.value,this._value,0)){te.clone(this.value,this._value);let e=te.toArray(this.value,_Ze);this._gl.uniformMatrix3fv(this._location,!1,e)}};var TZe=new Float32Array(16);function cee(e,t,n,i){this.name=n,this.value=void 0,this._value=new M,this._gl=e,this._location=i}cee.prototype.set=function(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let e=M.toArray(this.value,TZe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var fZ=gZe;var dwt=_(T(),1);function SZe(e,t,n,i){switch(t.type){case e.FLOAT:return new lee(e,t,n,i);case e.FLOAT_VEC2:return new dee(e,t,n,i);case e.FLOAT_VEC3:return new uee(e,t,n,i);case e.FLOAT_VEC4:return new mee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new M3(e,t,n,i);case e.INT:case e.BOOL:return new fee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new hee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new pee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new bee(e,t,n,i);case e.FLOAT_MAT2:return new yee(e,t,n,i);case e.FLOAT_MAT3:return new gee(e,t,n,i);case e.FLOAT_MAT4:return new xee(e,t,n,i);default:throw new le(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function lee(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]}lee.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 dee(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]}dee.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+=2}i&&this._gl.uniform2fv(this._location,n)};function uee(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]}uee.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];if(c(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);else if(c(s.x))m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0);else throw new L("Invalid vec3 value.");o+=3}i&&this._gl.uniform3fv(this._location,n)};function mee(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]}mee.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];if(c(s.red))Y.equalsArray(s,n,o)||(Y.pack(s,n,o),i=!0);else if(c(s.x))ce.equalsArray(s,n,o)||(ce.pack(s,n,o),i=!0);else throw new L("Invalid vec4 value.");o+=4}i&&this._gl.uniform4fv(this._location,n)};function M3(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}M3.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)}};M3.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 fee(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]}fee.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 hee(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]}hee.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+=2}i&&this._gl.uniform2iv(this._location,n)};function pee(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]}pee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];m.equalsArray(s,n,o)||(m.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function bee(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]}bee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];ce.equalsArray(s,n,o)||(ce.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function yee(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]}yee.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];Ii.equalsArray(s,n,o)||(Ii.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function gee(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]}gee.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];te.equalsArray(s,n,o)||(te.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function xee(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]}xee.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 hZ=SZe;var CZe=0;function Zp(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=VZe(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=CZe++}Zp.fromCache=function(e){return e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)};Zp.replaceCache=function(e){return e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(Zp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return YN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return YN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return YN(this),this._uniformsByName}}});function _ee(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(c(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 VZe(e,t){let n={};if(!mt.highpFloatSupported||!mt.highpIntSupported){let i,o,r,s,a=_ee(e),l=_ee(t),d=a.length,u=l.length;for(i=0;i<d;i++)for(o=0;o<u;o++)if(a[i]===l[o]){r=a[i],s=`czm_mediump_${r}`;let f=new RegExp(`${r}\\b`,"g");t=t.replace(f,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var ch="[Cesium WebGL] ";function LZe(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(c(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let l;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(l=e.getShaderInfoLog(o),c(l)&&l.length>0&&console.log(`${ch}Vertex shader compile log: ${l}`),l=e.getShaderInfoLog(r),c(l)&&l.length>0&&console.log(`${ch}Fragment shader compile log: ${l}`),l=e.getProgramInfoLog(s),c(l)&&l.length>0&&console.log(`${ch}Shader program link log: ${l}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(l=e.getProgramInfoLog(s),console.error(`${ch}Shader program link log: ${l}`),f(o,"vertex"),f(r,"fragment"),d=`Program failed to link.  Link log: ${l}`):(l=e.getShaderInfoLog(o),console.error(`${ch}Vertex shader compile log: ${l}`),console.error(`${ch} Vertex shader source:
${n}`),d=`Vertex shader failed to compile.  Compile log: ${l}`):(l=e.getShaderInfoLog(r),console.error(`${ch}Fragment shader compile log: ${l}`),console.error(`${ch} Fragment shader source:
${i}`),d=`Fragment shader failed to compile.  Compile log: ${l}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new le(d);function f(p,y){if(!c(u))return;let h=u.getTranslatedShaderSource(p);if(h===""){console.error(`${ch}${y} shader translation failed.`);return}console.error(`${ch}Translated ${y} shaderSource:
${h}`)}}function ZZe(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 RZe(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),l="[0]",d=a.name.indexOf(l,a.name.length-l.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(d.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let u=e.getUniformLocation(t,d);if(u!==null){let f=fZ(e,a,d,u);n[d]=f,i.push(f),f._setSampler&&o.push(f)}}else{let u,f,p,y,h=d.indexOf("[");if(h>=0){if(u=n[d.slice(0,h)],!c(u))continue;f=u._locations,f.length<=1&&(p=u.value,y=e.getUniformLocation(t,d),y!==null&&(f.push(y),p.push(e.getUniform(t,y))))}else{f=[];for(let g=0;g<a.size;++g)y=e.getUniformLocation(t,`${d}[${g}]`),y!==null&&f.push(y);u=hZ(e,a,d,f),n[d]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function GZe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];c(a)&&(r.name=a,s=a);let l=_p[s];c(l)?n.push({uniform:r,automaticUniform:l}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function EZe(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 YN(e){c(e._program)||Tee(e)}function Tee(e){let t=e._program,n=e._gl,i=LZe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=RZe(n,i),s=GZe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=ZZe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=EZe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,l,d,u){let f=e._vertexShaderText,p=e._fragmentShaderText,y=/ ! = /g;e._vertexShaderText=a.replace(y," != "),e._fragmentShaderText=l.replace(y," != ");try{Tee(e),d(e._program)}catch(h){e._vertexShaderText=f,e._fragmentShaderText=p;let x=/(?:Compile|Link) error: ([^]*)/.exec(h.message);u(x?x[1]:h.message)}})}Zp.prototype._bind=function(){YN(this),this._gl.useProgram(this._program)};Zp.prototype._setUniforms=function(e,t,n){let i,o;if(c(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let l=a[o];if(!c(e[l.name]))throw new L(`Unknown uniform: ${l.name}`);l.value=e[l.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,l=this._program;if(a.validateProgram(l),!a.getProgramParameter(l,a.VALIDATE_STATUS))throw new L(`Program validation failed.  Program info log: ${a.getProgramInfoLog(l)}`)}};Zp.prototype.isDestroyed=function(){return!1};Zp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};Zp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),he(this)};var tn=Zp;function HN(e){this._context=e}var pZ,XZe=new et({primitiveType:ve.TRIANGLES}),IZe=new ti({color:new Y(0,0,0,0)});function WZe(e,t){return new Fr({context:e,colorTextures:[t],destroyAttachments:!1})}function wZe(e,t){return tn.fromCache({context:e,vertexShaderSource:fx,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function PZe(e,t){return(!c(pZ)||pZ.viewport.width!==e||pZ.viewport.height!==t)&&(pZ=Oe.fromCache({viewport:new je(0,0,e,t)})),pZ}HN.prototype.execute=function(e){if(C.defined("computeCommand",e),c(e.preExecute)&&e.preExecute(e),!c(e.fragmentShaderSource)&&!c(e.shaderProgram))throw new L("computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.");C.defined("computeCommand.outputTexture",e.outputTexture);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=c(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=c(e.shaderProgram)?e.shaderProgram:wZe(o,e.fragmentShaderSource),a=WZe(o,t),l=PZe(n,i),d=e.uniformMap,u=IZe;u.framebuffer=a,u.renderState=l,u.execute(o);let f=XZe;f.vertexArray=r,f.renderState=l,f.shaderProgram=s,f.uniformMap=d,f.framebuffer=a,f.execute(o),a.destroy(),e.persists||(s.destroy(),c(e.vertexArray)&&r.destroy()),c(e.postExecute)&&e.postExecute(t)};HN.prototype.isDestroyed=function(){return!1};HN.prototype.destroy=function(){return he(this)};var bZ=HN;var v3t=_(T(),1);var Owt=_(T(),1);var Gn={BYTE:oe.BYTE,UNSIGNED_BYTE:oe.UNSIGNED_BYTE,SHORT:oe.SHORT,UNSIGNED_SHORT:oe.UNSIGNED_SHORT,INT:oe.INT,UNSIGNED_INT:oe.UNSIGNED_INT,FLOAT:oe.FLOAT,DOUBLE:oe.DOUBLE};Gn.getSizeInBytes=function(e){if(!c(e))throw new L("value is required.");switch(e){case Gn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Gn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Gn.INT:return Int32Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Gn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Gn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new L("componentDatatype is not a valid value.")}};Gn.fromTypedArray=function(e){if(e instanceof Int8Array)return Gn.BYTE;if(e instanceof Uint8Array)return Gn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Gn.SHORT;if(e instanceof Uint16Array)return Gn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Gn.INT;if(e instanceof Uint32Array)return Gn.UNSIGNED_INT;if(e instanceof Float32Array)return Gn.FLOAT;if(e instanceof Float64Array)return Gn.DOUBLE;throw new L("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};Gn.validate=function(e){return c(e)&&(e===Gn.BYTE||e===Gn.UNSIGNED_BYTE||e===Gn.SHORT||e===Gn.UNSIGNED_SHORT||e===Gn.INT||e===Gn.UNSIGNED_INT||e===Gn.FLOAT||e===Gn.DOUBLE)};Gn.createTypedArray=function(e,t){if(!c(e))throw new L("componentDatatype is required.");if(!c(t))throw new L("valuesOrLength is required.");switch(e){case Gn.BYTE:return new Int8Array(t);case Gn.UNSIGNED_BYTE:return new Uint8Array(t);case Gn.SHORT:return new Int16Array(t);case Gn.UNSIGNED_SHORT:return new Uint16Array(t);case Gn.INT:return new Int32Array(t);case Gn.UNSIGNED_INT:return new Uint32Array(t);case Gn.FLOAT:return new Float32Array(t);case Gn.DOUBLE:return new Float64Array(t);default:throw new L("componentDatatype is not a valid value.")}};Gn.createArrayBufferView=function(e,t,n,i){if(!c(e))throw new L("componentDatatype is required.");if(!c(t))throw new L("buffer is required.");switch(n=n??0,i=i??(t.byteLength-n)/Gn.getSizeInBytes(e),e){case Gn.BYTE:return new Int8Array(t,n,i);case Gn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Gn.SHORT:return new Int16Array(t,n,i);case Gn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Gn.INT:return new Int32Array(t,n,i);case Gn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Gn.FLOAT:return new Float32Array(t,n,i);case Gn.DOUBLE:return new Float64Array(t,n,i);default:throw new L("componentDatatype is not a valid value.")}};Gn.fromName=function(e){switch(e){case"BYTE":return Gn.BYTE;case"UNSIGNED_BYTE":return Gn.UNSIGNED_BYTE;case"SHORT":return Gn.SHORT;case"UNSIGNED_SHORT":return Gn.UNSIGNED_SHORT;case"INT":return Gn.INT;case"UNSIGNED_INT":return Gn.UNSIGNED_INT;case"FLOAT":return Gn.FLOAT;case"DOUBLE":return Gn.DOUBLE;default:throw new L("name is not a valid value.")}};var q=Object.freeze(Gn);var aPt=_(T(),1);var Bwt=_(T(),1),vZe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},yu=Object.freeze(vZe);function N3(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??ve.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??yu.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}N3.computeNumberOfVertices=function(e){C.typeOf.object("geometry",e);let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&c(e.attributes[n])&&c(e.attributes[n].values)){let i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new L("All attribute lists must have the same number of attributes.");t=o}return t};var FZe=new pe,AZe=new m,See=new M,MZe=[new pe,new pe,new pe],NZe=[new D,new D,new D],kZe=[new D,new D,new D],UZe=new m,OZe=new Fe,DZe=new M,BZe=new Ii;N3._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=de.center(i,FZe),s=pe.toCartesian(r,n,AZe),a=wt.eastNorthUpToFixedFrame(s,n,See),l=M.inverse(a,See),d=NZe,u=MZe;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let f=UZe;for(o=0;o<3;o++)pe.toCartesian(u[o],n,f),f=M.multiplyByPointAsVector(l,f,f),d[o].x=f.x,d[o].y=f.y;let p=Fe.fromAxisAngle(m.UNIT_Z,-t,OZe),y=te.fromQuaternion(p,DZe),h=e.length,g=Number.POSITIVE_INFINITY,x=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY,V=Number.NEGATIVE_INFINITY;for(o=0;o<h;o++)f=M.multiplyByPointAsVector(l,e[o],f),f=te.multiplyByVector(y,f,f),g=Math.min(g,f.x),x=Math.min(x,f.y),S=Math.max(S,f.x),V=Math.max(V,f.y);let Z=Ii.fromRotation(t,BZe),R=kZe;R[0].x=g,R[0].y=x,R[1].x=g,R[1].y=V,R[2].x=S,R[2].y=x;let E=d[0],I=d[2].x-E.x,v=d[1].y-E.y;for(o=0;o<3;o++){let G=R[o];Ii.multiplyByVector(Z,G,G),G.x=(G.x-E.x)/I,G.y=(G.y-E.y)/v}let P=R[0],F=R[1],N=R[2],b=new Array(6);return D.pack(P,b),D.pack(F,b,2),D.pack(N,b,4),b};var dt=N3;var mPt=_(T(),1);function YZe(e){if(e=e??z.EMPTY_OBJECT,!c(e.componentDatatype))throw new L("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new L("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new L("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.values))throw new L("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ee=YZe;var MPt=_(T(),1);var wPt=_(T(),1);var pPt=_(T(),1);function eC(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(eC.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}}});eC.clone=function(e){if(c(e))return new eC(e._format,e._datatype,e._width,e._height,e._buffer)};eC.prototype.clone=function(){return eC.clone(this)};var yZ=eC;var ZPt=_(T(),1),Cee=_(cd(),1);function Vee(){if(!c(la._canTransferArrayBuffer)){let e=O3("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return la._canTransferArrayBuffer=!1,la._canTransferArrayBuffer}la._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=c(r)&&r[0]===t;i(s),e.terminate(),la._canTransferArrayBuffer=s}})}return la._canTransferArrayBuffer}var U3=new ye;function k3(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 O3(e){let t=new Cee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(F0(e))s=e;else if(!n){let a=on(`${la._workerModulePrefix}/${i}.js`);F0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=k3(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
      importScripts("${k3(CESIUM_WORKERS)}");
      CesiumWorkers["${i}"]();
    `;return r=k3(a),new Worker(r,o)}if(r=e,n||(r=on(`${la._workerModulePrefix+i}.js`)),!Ot.supportsEsmWebWorkers())throw new le("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function HZe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!Ot.supportsWebAssembly()){if(!c(t.fallbackModulePath))throw new le(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=on(t.fallbackModulePath),n}n.wasmBinaryFile=on(t.wasmBinaryFile);let i=await Ge.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function la(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var zZe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(c(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new le(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new L(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),U3.raiseEvent(s),i(s)}else U3.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},KZe=[];async function JZe(e,t,n){let i=await Promise.resolve(Vee());c(n)?i||(n.length=0):n=KZe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",zZe(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:on.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function QZe(e,t,n){++e._activeTasks;try{let i=await JZe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}la.prototype.scheduleTask=function(e,t){if(c(this._worker)||(this._worker=O3(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return QZe(this,e,t)};la.prototype.initWebAssemblyModule=async function(e){if(c(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=O3(this._workerPath),i=await HZe(this,e),o=await Promise.resolve(Vee()),r,s=i.wasmBinary;c(s)&&o&&(r=[s]);let a=new Promise((l,d)=>{n.onmessage=function({data:u}){c(u)?l(u.result):d(new le("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};la.prototype.isDestroyed=function(){return!1};la.prototype.destroy=function(){return c(this._worker)&&this._worker.terminate(),he(this)};la.taskCompletedEvent=U3;la._defaultWorkerModulePrefix="Workers/";la._workerModulePrefix=la._defaultWorkerModulePrefix;la._canTransferArrayBuffer=void 0;var gi=la;function Rp(){}Rp._transcodeTaskProcessor=new gi("transcodeKTX2",Number.POSITIVE_INFINITY);Rp._readyPromise=void 0;function jZe(){let e=Rp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return Rp._transcodeTaskProcessor;throw new le("KTX2 transcoder could not be initialized.")});Rp._readyPromise=e}Rp.transcode=function(e,t){return C.defined("supportedTargetFormats",t),c(Rp._readyPromise)||jZe(),Rp._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 l=s[o[a]];s[o[a]]=new yZ(l.internalFormat,l.datatype,l.width,l.height,l.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 gZ=Rp;var Lee;Zee.setKTX2SupportedFormats=function(e,t,n,i,o,r){Lee={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Zee(e){C.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ge.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return gZ.transcode(n,Lee)})}var Ll=Zee;var WAt=_(T(),1);var L2t=_(T(),1);var e2t=_(T(),1);var kPt=_(T(),1);function qZe(e,t){this.start=e??0,this.stop=t??0}var Ia=qZe;function pn(e,t){this.center=m.clone(e??m.ZERO),this.radius=t??0}var Y3=new m,H3=new m,z3=new m,K3=new m,J3=new m,Q3=new m,j3=new m,da=new m,q3=new m,$3=new m,eY=new m,tY=new m,$Ze=4/3*w.PI;pn.fromPoints=function(e,t){if(c(t)||(t=new pn),!c(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=m.clone(e[0],j3),i=m.clone(n,Y3),o=m.clone(n,H3),r=m.clone(n,z3),s=m.clone(n,K3),a=m.clone(n,J3),l=m.clone(n,Q3),d=e.length,u;for(u=1;u<d;u++){m.clone(e[u],n);let P=n.x,F=n.y,N=n.z;P<i.x&&m.clone(n,i),P>s.x&&m.clone(n,s),F<o.y&&m.clone(n,o),F>a.y&&m.clone(n,a),N<r.z&&m.clone(n,r),N>l.z&&m.clone(n,l)}let f=m.magnitudeSquared(m.subtract(s,i,da)),p=m.magnitudeSquared(m.subtract(a,o,da)),y=m.magnitudeSquared(m.subtract(l,r,da)),h=i,g=s,x=f;p>x&&(x=p,h=o,g=a),y>x&&(x=y,h=r,g=l);let S=q3;S.x=(h.x+g.x)*.5,S.y=(h.y+g.y)*.5,S.z=(h.z+g.z)*.5;let V=m.magnitudeSquared(m.subtract(g,S,da)),Z=Math.sqrt(V),R=$3;R.x=i.x,R.y=o.y,R.z=r.z;let E=eY;E.x=s.x,E.y=a.y,E.z=l.z;let I=m.midpoint(R,E,tY),v=0;for(u=0;u<d;u++){m.clone(e[u],n);let P=m.magnitude(m.subtract(n,I,da));P>v&&(v=P);let F=m.magnitudeSquared(m.subtract(n,S,da));if(F>V){let N=Math.sqrt(F);Z=(Z+N)*.5,V=Z*Z;let b=N-Z;S.x=(Z*S.x+b*n.x)/N,S.y=(Z*S.y+b*n.y)/N,S.z=(Z*S.z+b*n.z)/N}}return Z<v?(m.clone(S,t.center),t.radius=Z):(m.clone(I,t.center),t.radius=v),t};var Ree=new Xi,eRe=new m,tRe=new m,D3=new pe,B3=new pe;pn.fromRectangle2D=function(e,t,n){return pn.fromRectangleWithHeights2D(e,t,0,0,n)};pn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(c(o)||(o=new pn),!c(e))return o.center=m.clone(m.ZERO,o.center),o.radius=0,o;Ree._ellipsoid=re.default,t=t??Ree,de.southwest(e,D3),D3.height=n,de.northeast(e,B3),B3.height=i;let r=t.project(D3,eRe),s=t.project(B3,tRe),a=s.x-r.x,l=s.y-r.y,d=s.z-r.z;o.radius=Math.sqrt(a*a+l*l+d*d)*.5;let u=o.center;return u.x=r.x+a*.5,u.y=r.y+l*.5,u.z=r.z+d*.5,o};var nRe=[];pn.fromRectangle3D=function(e,t,n,i){if(t=t??re.default,n=n??0,c(i)||(i=new pn),!c(e))return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;let o=de.subsample(e,t,n,nRe);return pn.fromPoints(o,i)};pn.fromVertices=function(e,t,n,i){if(c(i)||(i=new pn),!c(e)||e.length===0)return i.center=m.clone(m.ZERO,i.center),i.radius=0,i;t=t??m.ZERO,n=n??3,C.typeOf.number.greaterThanOrEquals("stride",n,3);let o=j3;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=m.clone(o,Y3),s=m.clone(o,H3),a=m.clone(o,z3),l=m.clone(o,K3),d=m.clone(o,J3),u=m.clone(o,Q3),f=e.length,p;for(p=0;p<f;p+=n){let N=e[p]+t.x,b=e[p+1]+t.y,G=e[p+2]+t.z;o.x=N,o.y=b,o.z=G,N<r.x&&m.clone(o,r),N>l.x&&m.clone(o,l),b<s.y&&m.clone(o,s),b>d.y&&m.clone(o,d),G<a.z&&m.clone(o,a),G>u.z&&m.clone(o,u)}let y=m.magnitudeSquared(m.subtract(l,r,da)),h=m.magnitudeSquared(m.subtract(d,s,da)),g=m.magnitudeSquared(m.subtract(u,a,da)),x=r,S=l,V=y;h>V&&(V=h,x=s,S=d),g>V&&(V=g,x=a,S=u);let Z=q3;Z.x=(x.x+S.x)*.5,Z.y=(x.y+S.y)*.5,Z.z=(x.z+S.z)*.5;let R=m.magnitudeSquared(m.subtract(S,Z,da)),E=Math.sqrt(R),I=$3;I.x=r.x,I.y=s.y,I.z=a.z;let v=eY;v.x=l.x,v.y=d.y,v.z=u.z;let P=m.midpoint(I,v,tY),F=0;for(p=0;p<f;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let N=m.magnitude(m.subtract(o,P,da));N>F&&(F=N);let b=m.magnitudeSquared(m.subtract(o,Z,da));if(b>R){let G=Math.sqrt(b);E=(E+G)*.5,R=E*E;let X=G-E;Z.x=(E*Z.x+X*o.x)/G,Z.y=(E*Z.y+X*o.y)/G,Z.z=(E*Z.z+X*o.z)/G}}return E<F?(m.clone(Z,i.center),i.radius=E):(m.clone(P,i.center),i.radius=F),i};pn.fromEncodedCartesianVertices=function(e,t,n){if(c(n)||(n=new pn),!c(e)||!c(t)||e.length!==t.length||e.length===0)return n.center=m.clone(m.ZERO,n.center),n.radius=0,n;let i=j3;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=m.clone(i,Y3),r=m.clone(i,H3),s=m.clone(i,z3),a=m.clone(i,K3),l=m.clone(i,J3),d=m.clone(i,Q3),u=e.length,f;for(f=0;f<u;f+=3){let F=e[f]+t[f],N=e[f+1]+t[f+1],b=e[f+2]+t[f+2];i.x=F,i.y=N,i.z=b,F<o.x&&m.clone(i,o),F>a.x&&m.clone(i,a),N<r.y&&m.clone(i,r),N>l.y&&m.clone(i,l),b<s.z&&m.clone(i,s),b>d.z&&m.clone(i,d)}let p=m.magnitudeSquared(m.subtract(a,o,da)),y=m.magnitudeSquared(m.subtract(l,r,da)),h=m.magnitudeSquared(m.subtract(d,s,da)),g=o,x=a,S=p;y>S&&(S=y,g=r,x=l),h>S&&(S=h,g=s,x=d);let V=q3;V.x=(g.x+x.x)*.5,V.y=(g.y+x.y)*.5,V.z=(g.z+x.z)*.5;let Z=m.magnitudeSquared(m.subtract(x,V,da)),R=Math.sqrt(Z),E=$3;E.x=o.x,E.y=r.y,E.z=s.z;let I=eY;I.x=a.x,I.y=l.y,I.z=d.z;let v=m.midpoint(E,I,tY),P=0;for(f=0;f<u;f+=3){i.x=e[f]+t[f],i.y=e[f+1]+t[f+1],i.z=e[f+2]+t[f+2];let F=m.magnitude(m.subtract(i,v,da));F>P&&(P=F);let N=m.magnitudeSquared(m.subtract(i,V,da));if(N>Z){let b=Math.sqrt(N);R=(R+b)*.5,Z=R*R;let G=b-R;V.x=(R*V.x+G*i.x)/b,V.y=(R*V.y+G*i.y)/b,V.z=(R*V.z+G*i.z)/b}}return R<P?(m.clone(V,n.center),n.radius=R):(m.clone(v,n.center),n.radius=P),n};pn.fromCornerPoints=function(e,t,n){C.typeOf.object("corner",e),C.typeOf.object("oppositeCorner",t),c(n)||(n=new pn);let i=m.midpoint(e,t,n.center);return n.radius=m.distance(i,t),n};pn.fromEllipsoid=function(e,t){return C.typeOf.object("ellipsoid",e),c(t)||(t=new pn),m.clone(m.ZERO,t.center),t.radius=e.maximumRadius,t};var iRe=new m;pn.fromBoundingSpheres=function(e,t){if(c(t)||(t=new pn),!c(e)||e.length===0)return t.center=m.clone(m.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return pn.clone(e[0],t);if(n===2)return pn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=pn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,m.distance(r,a.center,iRe)+a.radius)}return t.radius=s,t};var oRe=new m,rRe=new m,sRe=new m;pn.fromOrientedBoundingBox=function(e,t){C.defined("orientedBoundingBox",e),c(t)||(t=new pn);let n=e.halfAxes,i=te.getColumn(n,0,oRe),o=te.getColumn(n,1,rRe),r=te.getColumn(n,2,sRe);return m.add(i,o,i),m.add(i,r,i),t.center=m.clone(e.center,t.center),t.radius=m.magnitude(i),t};var aRe=new m,cRe=new m;pn.fromTransformation=function(e,t){C.typeOf.object("transformation",e),c(t)||(t=new pn);let n=M.getTranslation(e,aRe),i=M.getScale(e,cRe),o=.5*m.magnitude(i);return t.center=m.clone(n,t.center),t.radius=o,t};pn.clone=function(e,t){if(c(e))return c(t)?(t.center=m.clone(e.center,t.center),t.radius=e.radius,t):new pn(e.center,e.radius)};pn.packedLength=4;pn.pack=function(e,t,n){C.typeOf.object("value",e),C.defined("array",t),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};pn.unpack=function(e,t,n){C.defined("array",e),t=t??0,c(n)||(n=new pn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var lRe=new m,dRe=new m;pn.union=function(e,t,n){C.typeOf.object("left",e),C.typeOf.object("right",t),c(n)||(n=new pn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=m.subtract(r,i,lRe),l=m.magnitude(a);if(o>=l+s)return e.clone(n),n;if(s>=l+o)return t.clone(n),n;let d=(o+l+s)*.5,u=m.multiplyByScalar(a,(-o+d)/l,dRe);return m.add(u,i,u),m.clone(u,n.center),n.radius=d,n};var uRe=new m;pn.expand=function(e,t,n){C.typeOf.object("sphere",e),C.typeOf.object("point",t),n=pn.clone(e,n);let i=m.magnitude(m.subtract(t,n.center,uRe));return i>n.radius&&(n.radius=i),n};pn.intersectPlane=function(e,t){C.typeOf.object("sphere",e),C.typeOf.object("plane",t);let n=e.center,i=e.radius,o=t.normal,r=m.dot(o,n)+t.distance;return r<-i?zt.OUTSIDE:r<i?zt.INTERSECTING:zt.INSIDE};pn.transform=function(e,t,n){return C.typeOf.object("sphere",e),C.typeOf.object("transform",t),c(n)||(n=new pn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=M.getMaximumScale(t)*e.radius,n};var mRe=new m;pn.distanceSquaredTo=function(e,t){C.typeOf.object("sphere",e),C.typeOf.object("cartesian",t);let n=m.subtract(e.center,t,mRe),i=m.magnitude(n)-e.radius;return i<=0?0:i*i};pn.transformWithoutScale=function(e,t,n){return C.typeOf.object("sphere",e),C.typeOf.object("transform",t),c(n)||(n=new pn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var fRe=new m;pn.computePlaneDistances=function(e,t,n,i){C.typeOf.object("sphere",e),C.typeOf.object("position",t),C.typeOf.object("direction",n),c(i)||(i=new Ia);let o=m.subtract(e.center,t,fRe),r=m.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Gee=new m,hRe=new m,pRe=new m,bRe=new m,yRe=new m,gRe=new pe,Xee=new Array(8);for(let e=0;e<8;++e)Xee[e]=new m;var Eee=new Xi;pn.projectTo2D=function(e,t,n){C.typeOf.object("sphere",e),Eee._ellipsoid=re.default,t=t??Eee;let i=t.ellipsoid,o=e.center,r=e.radius,s;m.equals(o,m.ZERO)?s=m.clone(m.UNIT_X,Gee):s=i.geodeticSurfaceNormal(o,Gee);let a=m.cross(m.UNIT_Z,s,hRe);m.normalize(a,a);let l=m.cross(s,a,pRe);m.normalize(l,l),m.multiplyByScalar(s,r,s),m.multiplyByScalar(l,r,l),m.multiplyByScalar(a,r,a);let d=m.negate(l,yRe),u=m.negate(a,bRe),f=Xee,p=f[0];m.add(s,l,p),m.add(p,a,p),p=f[1],m.add(s,l,p),m.add(p,u,p),p=f[2],m.add(s,d,p),m.add(p,u,p),p=f[3],m.add(s,d,p),m.add(p,a,p),m.negate(s,s),p=f[4],m.add(s,l,p),m.add(p,a,p),p=f[5],m.add(s,l,p),m.add(p,u,p),p=f[6],m.add(s,d,p),m.add(p,u,p),p=f[7],m.add(s,d,p),m.add(p,a,p);let y=f.length;for(let S=0;S<y;++S){let V=f[S];m.add(o,V,V);let Z=i.cartesianToCartographic(V,gRe);t.project(Z,V)}n=pn.fromPoints(f,n),o=n.center;let h=o.x,g=o.y,x=o.z;return o.x=x,o.y=h,o.z=g,n};pn.isOccluded=function(e,t){return C.typeOf.object("sphere",e),C.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};pn.equals=function(e,t){return e===t||c(e)&&c(t)&&m.equals(e.center,t.center)&&e.radius===t.radius};pn.prototype.intersectPlane=function(e){return pn.intersectPlane(this,e)};pn.prototype.distanceSquaredTo=function(e){return pn.distanceSquaredTo(this,e)};pn.prototype.computePlaneDistances=function(e,t,n){return pn.computePlaneDistances(this,e,t,n)};pn.prototype.isOccluded=function(e){return pn.isOccluded(this,e)};pn.prototype.equals=function(e){return pn.equals(this,e)};pn.prototype.clone=function(e){return pn.clone(this,e)};pn.prototype.volume=function(){let e=this.radius;return $Ze*e*e*e};var ue=pn;var i2t=_(T(),1);function xRe(e){e=e??z.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 fn=xRe;var r2t=_(T(),1),_Re={NONE:0,TOP:1,ALL:2},$t=Object.freeze(_Re);var d2t=_(T(),1);function ms(e){e=e??z.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}ms.POSITION_ONLY=Object.freeze(new ms({position:!0}));ms.POSITION_AND_NORMAL=Object.freeze(new ms({position:!0,normal:!0}));ms.POSITION_NORMAL_AND_ST=Object.freeze(new ms({position:!0,normal:!0,st:!0}));ms.POSITION_AND_ST=Object.freeze(new ms({position:!0,st:!0}));ms.POSITION_AND_COLOR=Object.freeze(new ms({position:!0,color:!0}));ms.ALL=Object.freeze(new ms({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ms.DEFAULT=ms.POSITION_NORMAL_AND_ST;ms.packedLength=6;ms.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");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};ms.unpack=function(e,t,n){if(!c(e))throw new L("array is required");return t=t??0,c(n)||(n=new ms),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};ms.clone=function(e,t){if(c(e))return c(t)||(t=new ms),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var We=ms;var TRe=new m;function dd(e){e=e??z.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(C.typeOf.object("min",t),C.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let i=e.vertexFormat??We.DEFAULT;this._minimum=m.clone(t),this._maximum=m.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}dd.fromDimensions=function(e){e=e??z.EMPTY_OBJECT;let t=e.dimensions;C.typeOf.object("dimensions",t),C.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),C.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),C.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=m.multiplyByScalar(t,.5,new m);return new dd({minimum:m.negate(n,new m),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};dd.fromAxisAlignedBoundingBox=function(e){return C.typeOf.object("boundingBox",e),new dd({minimum:e.minimum,maximum:e.maximum})};dd.packedLength=2*m.packedLength+We.packedLength+1;dd.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,m.pack(e._minimum,t,n),m.pack(e._maximum,t,n+m.packedLength),We.pack(e._vertexFormat,t,n+2*m.packedLength),t[n+2*m.packedLength+We.packedLength]=e._offsetAttribute??-1,t};var Wee=new m,wee=new m,Pee=new We,Iee={minimum:Wee,maximum:wee,vertexFormat:Pee,offsetAttribute:void 0};dd.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=m.unpack(e,t,Wee),o=m.unpack(e,t+m.packedLength,wee),r=We.unpack(e,t+2*m.packedLength,Pee),s=e[t+2*m.packedLength+We.packedLength];return c(n)?(n._minimum=m.clone(i,n._minimum),n._maximum=m.clone(o,n._maximum),n._vertexFormat=We.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Iee.offsetAttribute=s===-1?void 0:s,new dd(Iee))};dd.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(m.equals(t,n))return;let o=new fn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),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 Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let d=new Float32Array(72);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=1,d[9]=0,d[10]=0,d[11]=1,d[12]=0,d[13]=0,d[14]=-1,d[15]=0,d[16]=0,d[17]=-1,d[18]=0,d[19]=0,d[20]=-1,d[21]=0,d[22]=0,d[23]=-1,d[24]=1,d[25]=0,d[26]=0,d[27]=1,d[28]=0,d[29]=0,d[30]=1,d[31]=0,d[32]=0,d[33]=1,d[34]=0,d[35]=0,d[36]=-1,d[37]=0,d[38]=0,d[39]=-1,d[40]=0,d[41]=0,d[42]=-1,d[43]=0,d[44]=0,d[45]=-1,d[46]=0,d[47]=0,d[48]=0,d[49]=1,d[50]=0,d[51]=0,d[52]=1,d[53]=0,d[54]=0,d[55]=1,d[56]=0,d[57]=0,d[58]=1,d[59]=0,d[60]=0,d[61]=-1,d[62]=0,d[63]=0,d[64]=-1,d[65]=0,d[66]=0,d[67]=-1,d[68]=0,d[69]=0,d[70]=-1,d[71]=0,o.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:d})}if(i.st){let d=new Float32Array(48);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=1,d[5]=1,d[6]=0,d[7]=1,d[8]=1,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=1,d[14]=1,d[15]=1,d[16]=0,d[17]=0,d[18]=1,d[19]=0,d[20]=1,d[21]=1,d[22]=0,d[23]=1,d[24]=1,d[25]=0,d[26]=0,d[27]=0,d[28]=0,d[29]=1,d[30]=1,d[31]=1,d[32]=1,d[33]=0,d[34]=0,d[35]=0,d[36]=0,d[37]=1,d[38]=1,d[39]=1,d[40]=0,d[41]=0,d[42]=1,d[43]=0,d[44]=1,d[45]=1,d[46]=0,d[47]=1,o.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:d})}if(i.tangent){let d=new Float32Array(72);d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d[6]=1,d[7]=0,d[8]=0,d[9]=1,d[10]=0,d[11]=0,d[12]=-1,d[13]=0,d[14]=0,d[15]=-1,d[16]=0,d[17]=0,d[18]=-1,d[19]=0,d[20]=0,d[21]=-1,d[22]=0,d[23]=0,d[24]=0,d[25]=1,d[26]=0,d[27]=0,d[28]=1,d[29]=0,d[30]=0,d[31]=1,d[32]=0,d[33]=0,d[34]=1,d[35]=0,d[36]=0,d[37]=-1,d[38]=0,d[39]=0,d[40]=-1,d[41]=0,d[42]=0,d[43]=-1,d[44]=0,d[45]=0,d[46]=-1,d[47]=0,d[48]=-1,d[49]=0,d[50]=0,d[51]=-1,d[52]=0,d[53]=0,d[54]=-1,d[55]=0,d[56]=0,d[57]=-1,d[58]=0,d[59]=0,d[60]=1,d[61]=0,d[62]=0,d[63]=1,d[64]=0,d[65]=0,d[66]=1,d[67]=0,d[68]=0,d[69]=1,d[70]=0,d[71]=0,o.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:d})}if(i.bitangent){let d=new Float32Array(72);d[0]=0,d[1]=1,d[2]=0,d[3]=0,d[4]=1,d[5]=0,d[6]=0,d[7]=1,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=1,d[14]=0,d[15]=0,d[16]=1,d[17]=0,d[18]=0,d[19]=1,d[20]=0,d[21]=0,d[22]=1,d[23]=0,d[24]=0,d[25]=0,d[26]=1,d[27]=0,d[28]=0,d[29]=1,d[30]=0,d[31]=0,d[32]=1,d[33]=0,d[34]=0,d[35]=1,d[36]=0,d[37]=0,d[38]=1,d[39]=0,d[40]=0,d[41]=1,d[42]=0,d[43]=0,d[44]=1,d[45]=0,d[46]=0,d[47]=1,d[48]=0,d[49]=0,d[50]=1,d[51]=0,d[52]=0,d[53]=1,d[54]=0,d[55]=0,d[56]=1,d[57]=0,d[58]=0,d[59]=1,d[60]=0,d[61]=0,d[62]=1,d[63]=0,d[64]=0,d[65]=1,d[66]=0,d[67]=0,d[68]=1,d[69]=0,d[70]=0,d[71]=1,o.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:d})}r=new Uint16Array(6*2*3),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(8*3),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 Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=m.subtract(n,t,TRe),l=m.magnitude(a)*.5;if(c(e._offsetAttribute)){let d=s.length,u=e._offsetAttribute===$t.NONE?0:1,f=new Uint8Array(d/3).fill(u);o.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new dt({attributes:o,indices:r,primitiveType:ve.TRIANGLES,boundingSphere:new ue(m.ZERO,l),offsetAttribute:e._offsetAttribute})};var nY;dd.getUnitBox=function(){return c(nY)||(nY=dd.createGeometry(dd.fromDimensions({dimensions:new m(1,1,1),vertexFormat:We.POSITION_ONLY}))),nY};var Wa=dd;var _Ft=_(T(),1);var Y2t=_(T(),1);var v2t=_(T(),1);var to={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};to.getMathType=function(e){switch(e){case to.SCALAR:return Number;case to.VEC2:return D;case to.VEC3:return m;case to.VEC4:return ce;case to.MAT2:return Ii;case to.MAT3:return te;case to.MAT4:return M;default:throw new L("attributeType is not a valid value.")}};to.getNumberOfComponents=function(e){switch(e){case to.SCALAR:return 1;case to.VEC2:return 2;case to.VEC3:return 3;case to.VEC4:case to.MAT2:return 4;case to.MAT3:return 9;case to.MAT4:return 16;default:throw new L("attributeType is not a valid value.")}};to.getAttributeLocationCount=function(e){switch(e){case to.SCALAR:case to.VEC2:case to.VEC3:case to.VEC4:return 1;case to.MAT2:return 2;case to.MAT3:return 3;case to.MAT4:return 4;default:throw new L("attributeType is not a valid value.")}};to.getGlslType=function(e){switch(C.typeOf.string("attributeType",e),e){case to.SCALAR:return"float";case to.VEC2:return"vec2";case to.VEC3:return"vec3";case to.VEC4:return"vec4";case to.MAT2:return"mat2";case to.MAT3:return"mat3";case to.MAT4:return"mat4";default:throw new L("attributeType is not a valid value.")}};var rn=Object.freeze(to);var vee=1/256,Fee=256,go={};go.octEncodeInRange=function(e,t,n){C.defined("vector",e),C.defined("result",n);let i=m.magnitudeSquared(e);if(Math.abs(i-1)>w.EPSILON6)throw new L("vector must be normalized.");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 o=n.x,r=n.y;n.x=(1-Math.abs(r))*w.signNotZero(o),n.y=(1-Math.abs(o))*w.signNotZero(r)}return n.x=w.toSNorm(n.x,t),n.y=w.toSNorm(n.y,t),n};go.octEncode=function(e,t){return go.octEncodeInRange(e,255,t)};var xZ=new D,Aee=new Uint8Array(1);function zN(e){return Aee[0]=e,Aee[0]}go.octEncodeToCartesian4=function(e,t){return go.octEncodeInRange(e,65535,xZ),t.x=zN(xZ.x*vee),t.y=zN(xZ.x),t.z=zN(xZ.y*vee),t.w=zN(xZ.y),t};go.octDecodeInRange=function(e,t,n,i){if(C.defined("result",i),e<0||e>n||t<0||t>n)throw new L(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=w.fromSNorm(e,n),i.y=w.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))*w.signNotZero(o),i.y=(1-Math.abs(o))*w.signNotZero(i.y)}return m.normalize(i,i)};go.octDecode=function(e,t,n){return go.octDecodeInRange(e,t,255,n)};go.octDecodeFromCartesian4=function(e,t){C.typeOf.object("encoded",e),C.typeOf.object("result",t);let n=e.x,i=e.y,o=e.z,r=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||r<0||r>255)throw new L("x, y, z, and w must be unsigned normalized integers between 0 and 255");let s=n*Fee+i,a=o*Fee+r;return go.octDecodeInRange(s,a,65535,t)};go.octPackFloat=function(e){return C.defined("encoded",e),256*e.x+e.y};var oY=new D;go.octEncodeFloat=function(e){return go.octEncode(e,oY),go.octPackFloat(oY)};go.octDecodeFloat=function(e,t){C.defined("value",e);let n=e/256,i=Math.floor(n),o=(n-i)*256;return go.octDecode(i,o,t)};go.octPack=function(e,t,n,i){C.defined("v1",e),C.defined("v2",t),C.defined("v3",n),C.defined("result",i);let o=go.octEncodeFloat(e),r=go.octEncodeFloat(t),s=go.octEncode(n,oY);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};go.octUnpack=function(e,t,n,i){C.defined("packed",e),C.defined("v1",t),C.defined("v2",n),C.defined("v3",i);let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),l=(o-a)*65536;go.octDecodeFloat(s,t),go.octDecodeFloat(l,n),go.octDecode(r,a,i)};go.compressTextureCoordinates=function(e){C.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};go.decompressTextureCoordinates=function(e,t){C.defined("compressed",e),C.defined("result",t);let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function iY(e){return e>>1^-(e&1)}go.zigZagDeltaDecode=function(e,t,n){C.defined("uBuffer",e),C.defined("vBuffer",t),C.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),c(n)&&C.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=iY(e[a]),r+=iY(t[a]),e[a]=o,t[a]=r,c(n)&&(s+=iY(n[a]),n[a]=s)};go.dequantize=function(e,t,n,i){C.defined("typedArray",e),C.defined("componentDatatype",t),C.defined("type",n),C.defined("count",i);let o=rn.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;default:throw new L(`Cannot dequantize component datatype: ${t}`)}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let l=0;l<o;l++){let d=a*o+l;s[d]=Math.max(e[d]/r,-1)}return s};go.decodeRGB565=function(e,t){C.defined("typedArray",e);let n=e.length*3;c(t)&&C.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let i=e.length;c(t)||(t=new Float32Array(i*3));let o=31,r=63,s=1/31,a=1/63;for(let l=0;l<i;l++){let d=e[l],u=d>>11,f=d>>5&r,p=d&o,y=3*l;t[y]=u*s,t[y+1]=f*a,t[y+2]=p*s}return t};var Fn=go;var q2t=_(T(),1);var Mee=new m,Nee=new m,kee=new m;function SRe(e,t,n,i,o){C.defined("point",e),C.defined("p0",t),C.defined("p1",n),C.defined("p2",i),c(o)||(o=new m);let r,s,a,l,d,u,f,p;if(c(t.z)){if(m.equalsEpsilon(e,t,w.EPSILON14))return m.clone(m.UNIT_X,o);if(m.equalsEpsilon(e,n,w.EPSILON14))return m.clone(m.UNIT_Y,o);if(m.equalsEpsilon(e,i,w.EPSILON14))return m.clone(m.UNIT_Z,o);r=m.subtract(n,t,Mee),s=m.subtract(i,t,Nee),a=m.subtract(e,t,kee),l=m.dot(r,r),d=m.dot(r,s),u=m.dot(r,a),f=m.dot(s,s),p=m.dot(s,a)}else{if(D.equalsEpsilon(e,t,w.EPSILON14))return m.clone(m.UNIT_X,o);if(D.equalsEpsilon(e,n,w.EPSILON14))return m.clone(m.UNIT_Y,o);if(D.equalsEpsilon(e,i,w.EPSILON14))return m.clone(m.UNIT_Z,o);r=D.subtract(n,t,Mee),s=D.subtract(i,t,Nee),a=D.subtract(e,t,kee),l=D.dot(r,r),d=D.dot(r,s),u=D.dot(r,a),f=D.dot(s,s),p=D.dot(s,a)}o.y=f*u-d*p,o.z=l*p-d*u;let y=l*f-d*d;if(y!==0)return o.y/=y,o.z/=y,o.x=1-o.y-o.z,o}var px=SRe;var ivt=_(T(),1);function lh(){this.high=m.clone(m.ZERO),this.low=m.clone(m.ZERO)}lh.encode=function(e,t){C.typeOf.number("value",e),c(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 Gp={high:0,low:0};lh.fromCartesian=function(e,t){C.typeOf.object("cartesian",e),c(t)||(t=new lh);let n=t.high,i=t.low;return lh.encode(e.x,Gp),n.x=Gp.high,i.x=Gp.low,lh.encode(e.y,Gp),n.y=Gp.high,i.y=Gp.low,lh.encode(e.z,Gp),n.z=Gp.high,i.z=Gp.low,t};var rY=new lh;lh.writeElements=function(e,t,n){C.defined("cartesianArray",t),C.typeOf.number("index",n),C.typeOf.number.greaterThanOrEquals("index",n,0),lh.fromCartesian(e,rY);let i=rY.high,o=rY.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 Bn=lh;var Pvt=_(T(),1);var avt=_(T(),1);var sY={};sY.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");return t*t-4*e*n};function Uee(e,t,n){let i=e+t;return w.sign(e)!==w.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}sY.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let l=Math.abs(n),d=Math.abs(e);if(l<d&&l/d<w.EPSILON14)return[0,0];if(l>d&&d/l<w.EPSILON14)return[];if(i=-n/e,i<0)return[];let u=Math.sqrt(i);return[-u,u]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Uee(o,-r,w.EPSILON14);if(s<0)return[];let a=-.5*Uee(t,w.sign(t)*Math.sqrt(s),w.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Fc=sY;var yvt=_(T(),1);var uvt=_(T(),1);var cY={};cY.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");if(typeof i!="number")throw new L("d is a required number.");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 aY(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,l=o*s,d=r*a,u=r*r,f=s*s,p=o*s-u,y=o*a-r*s,h=r*a-f,g=4*p*h-y*y,x,S;if(g<0){let K,Q,ie;u*d>=l*f?(K=o,Q=p,ie=-2*r*p+o*y):(K=a,Q=h,ie=-a*y+2*s*h);let $=-(ie<0?-1:1)*Math.abs(K)*Math.sqrt(-g);S=-ie+$;let ne=S/2,be=ne<0?-Math.pow(-ne,1/3):Math.pow(ne,1/3),Ce=S===$?-be:-Q/be;return x=Q<=0?be+Ce:-ie/(be*be+Ce*Ce+Q),u*d>=l*f?[(x-r)/o]:[-a/(x+s)]}let V=p,Z=-2*r*p+o*y,R=h,E=-a*y+2*s*h,I=Math.sqrt(g),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-Z)/3);x=2*Math.sqrt(-V);let F=Math.cos(P);S=x*F;let N=x*(-F/2-v*Math.sin(P)),b=S+N>2*r?S-r:N-r,G=o,X=b/G;P=Math.abs(Math.atan2(a*I,-E)/3),x=2*Math.sqrt(-R),F=Math.cos(P),S=x*F,N=x*(-F/2-v*Math.sin(P));let W=-a,A=S+N<2*s?S+s:N+s,k=W/A,B=G*A,O=-b*A-G*W,H=b*W,U=(s*O-r*H)/(-r*O+s*B);return X<=U?X<=k?U<=k?[X,U,k]:[X,k,U]:[k,X,U]:X<=k?[U,X,k]:U<=k?[U,k,X]:[k,U,X]}cY.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");if(typeof i!="number")throw new L("d is a required number.");let o,r;if(e===0)return Fc.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=Fc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return aY(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):aY(e,t,0,i);if(i===0)return o=Fc.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 aY(e,t,n,i)};var bx=cY;var lY={};lY.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");if(typeof i!="number")throw new L("d is a required number.");if(typeof o!="number")throw new L("e is a required number.");let r=e*e,s=r*e,a=t*t,l=a*t,d=n*n,u=d*n,f=i*i,p=f*i,y=o*o,h=y*o;return a*d*f-4*l*p-4*e*u*f+18*e*t*n*p-27*r*f*f+256*s*h+o*(18*l*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*f+144*r*n*f)+y*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Xm(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,l=bx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(l.length>0){let d=-e/4,u=l[l.length-1];if(Math.abs(u)<w.EPSILON14){let f=Fc.computeRealRoots(1,r,a);if(f.length===2){let p=f[0],y=f[1],h;if(p>=0&&y>=0){let g=Math.sqrt(p),x=Math.sqrt(y);return[d-x,d-g,d+g,d+x]}else{if(p>=0&&y<0)return h=Math.sqrt(p),[d-h,d+h];if(p<0&&y>=0)return h=Math.sqrt(y),[d-h,d+h]}}return[]}else if(u>0){let f=Math.sqrt(u),p=(r+u-s/f)/2,y=(r+u+s/f)/2,h=Fc.computeRealRoots(1,f,p),g=Fc.computeRealRoots(1,-f,y);return h.length!==0?(h[0]+=d,h[1]+=d,g.length!==0?(g[0]+=d,g[1]+=d,h[1]<=g[0]?[h[0],h[1],g[0],g[1]]:g[1]<=h[0]?[g[0],g[1],h[0],h[1]]:h[0]>=g[0]&&h[1]<=g[1]?[g[0],h[0],h[1],g[1]]:g[0]>=h[0]&&g[1]<=h[1]?[h[0],g[0],g[1],h[1]]:h[0]>g[0]&&h[0]<g[1]?[g[0],h[0],g[1],h[1]]:[h[0],g[0],h[1],g[1]]):h):g.length!==0?(g[0]+=d,g[1]+=d,g):[]}}return[]}function _Z(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,l=n*e+r-4*i,d=s*i-n*t*e+o,u=bx.computeRealRoots(1,a,l,d);if(u.length>0){let f=u[0],p=t-f,y=p*p,h=e/2,g=p/2,x=y-4*i,S=y+4*Math.abs(i),V=s-4*f,Z=s+4*Math.abs(f),R,E;if(f<0||x*Z<V*S){let G=Math.sqrt(V);R=G/2,E=G===0?0:(e*g-n)/G}else{let G=Math.sqrt(x);R=G===0?0:(e*g-n)/G,E=G/2}let I,v;h===0&&R===0?(I=0,v=0):w.sign(h)===w.sign(R)?(I=h+R,v=f/I):(v=h-R,I=f/v);let P,F;g===0&&E===0?(P=0,F=0):w.sign(g)===w.sign(E)?(P=g+E,F=i/P):(F=g-E,P=i/F);let N=Fc.computeRealRoots(1,I,P),b=Fc.computeRealRoots(1,v,F);if(N.length!==0)return b.length!==0?N[1]<=b[0]?[N[0],N[1],b[0],b[1]]:b[1]<=N[0]?[b[0],b[1],N[0],N[1]]:N[0]>=b[0]&&N[1]<=b[1]?[b[0],N[0],N[1],b[1]]:b[0]>=N[0]&&b[1]<=N[1]?[N[0],b[0],b[1],N[1]]:N[0]>b[0]&&N[0]<b[1]?[b[0],N[0],b[1],N[1]]:[N[0],b[0],N[1],b[1]]:N;if(b.length!==0)return b}return[]}lY.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new L("a is a required number.");if(typeof t!="number")throw new L("b is a required number.");if(typeof n!="number")throw new L("c is a required number.");if(typeof i!="number")throw new L("d is a required number.");if(typeof o!="number")throw new L("e is a required number.");if(Math.abs(e)<w.EPSILON15)return bx.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,l=o/e,d=r<0?1:0;switch(d+=s<0?d+1:d,d+=a<0?d+1:d,d+=l<0?d+1:d,d){case 0:return Xm(r,s,a,l);case 1:return _Z(r,s,a,l);case 2:return _Z(r,s,a,l);case 3:return Xm(r,s,a,l);case 4:return Xm(r,s,a,l);case 5:return _Z(r,s,a,l);case 6:return Xm(r,s,a,l);case 7:return Xm(r,s,a,l);case 8:return _Z(r,s,a,l);case 9:return Xm(r,s,a,l);case 10:return Xm(r,s,a,l);case 11:return _Z(r,s,a,l);case 12:return Xm(r,s,a,l);case 13:return Xm(r,s,a,l);case 14:return Xm(r,s,a,l);case 15:return Xm(r,s,a,l);default:return}};var TZ=lY;var Svt=_(T(),1);function KN(e,t){t=m.clone(t??m.ZERO),m.equals(t,m.ZERO)||m.normalize(t,t),this.origin=m.clone(e??m.ZERO),this.direction=t}KN.clone=function(e,t){if(c(e))return c(t)?(t.origin=m.clone(e.origin),t.direction=m.clone(e.direction),t):new KN(e.origin,e.direction)};KN.getPoint=function(e,t,n){return C.typeOf.object("ray",e),C.typeOf.number("t",t),c(n)||(n=new m),n=m.multiplyByScalar(e.direction,t,n),m.add(e.origin,n,n)};var bn=KN;var No={};No.rayPlane=function(e,t,n){if(!c(e))throw new L("ray is required.");if(!c(t))throw new L("plane is required.");c(n)||(n=new m);let i=e.origin,o=e.direction,r=t.normal,s=m.dot(r,o);if(Math.abs(s)<w.EPSILON15)return;let a=(-t.distance-m.dot(r,i))/s;if(!(a<0))return n=m.multiplyByScalar(o,a,n),m.add(i,n,n)};var CRe=new m,VRe=new m,Jee=new m,Oee=new m,Dee=new m;No.rayTriangleParametric=function(e,t,n,i,o){if(!c(e))throw new L("ray is required.");if(!c(t))throw new L("p0 is required.");if(!c(n))throw new L("p1 is required.");if(!c(i))throw new L("p2 is required.");o=o??!1;let r=e.origin,s=e.direction,a=m.subtract(n,t,CRe),l=m.subtract(i,t,VRe),d=m.cross(s,l,Jee),u=m.dot(a,d),f,p,y,h,g;if(o){if(u<w.EPSILON6||(f=m.subtract(r,t,Oee),y=m.dot(f,d),y<0||y>u)||(p=m.cross(f,a,Dee),h=m.dot(s,p),h<0||y+h>u))return;g=m.dot(l,p)/u}else{if(Math.abs(u)<w.EPSILON6)return;let x=1/u;if(f=m.subtract(r,t,Oee),y=m.dot(f,d)*x,y<0||y>1||(p=m.cross(f,a,Dee),h=m.dot(s,p)*x,h<0||y+h>1))return;g=m.dot(l,p)*x}return g};No.rayTriangle=function(e,t,n,i,o,r){let s=No.rayTriangleParametric(e,t,n,i,o);if(!(!c(s)||s<0))return c(r)||(r=new m),m.multiplyByScalar(e.direction,s,r),m.add(e.origin,r,r)};var LRe=new bn;No.lineSegmentTriangle=function(e,t,n,i,o,r,s){if(!c(e))throw new L("v0 is required.");if(!c(t))throw new L("v1 is required.");if(!c(n))throw new L("p0 is required.");if(!c(i))throw new L("p1 is required.");if(!c(o))throw new L("p2 is required.");let a=LRe;m.clone(e,a.origin),m.subtract(t,e,a.direction),m.normalize(a.direction,a.direction);let l=No.rayTriangleParametric(a,n,i,o,r);if(!(!c(l)||l<0||l>m.distance(e,t)))return c(s)||(s=new m),m.multiplyByScalar(a.direction,l,s),m.add(a.origin,s,s)};function ZRe(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),l=(-t+a)*s,d=(-t-a)*s;return l<d?(i.root0=l,i.root1=d):(i.root0=d,i.root1=l),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var RRe={root0:0,root1:0};function Qee(e,t,n){c(n)||(n=new Ia);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=m.subtract(i,r,Jee),l=m.dot(o,o),d=2*m.dot(o,a),u=m.magnitudeSquared(a)-s,f=ZRe(l,d,u,RRe);if(c(f))return n.start=f.root0,n.stop=f.root1,n}No.raySphere=function(e,t,n){if(!c(e))throw new L("ray is required.");if(!c(t))throw new L("sphere is required.");if(n=Qee(e,t,n),!(!c(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var GRe=new bn;No.lineSegmentSphere=function(e,t,n,i){if(!c(e))throw new L("p0 is required.");if(!c(t))throw new L("p1 is required.");if(!c(n))throw new L("sphere is required.");let o=GRe;m.clone(e,o.origin);let r=m.subtract(t,e,o.direction),s=m.magnitude(r);if(m.normalize(r,r),i=Qee(o,n,i),!(!c(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var ERe=new m,XRe=new m;No.rayEllipsoid=function(e,t){if(!c(e))throw new L("ray is required.");if(!c(t))throw new L("ellipsoid is required.");let n=t.oneOverRadii,i=m.multiplyComponents(n,e.origin,ERe),o=m.multiplyComponents(n,e.direction,XRe),r=m.magnitudeSquared(i),s=m.dot(i,o),a,l,d,u,f;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,l=m.magnitudeSquared(o),d=l*a,p<d)return;if(p>d){u=s*s-d,f=-s+Math.sqrt(u);let h=f/l,g=a/f;return h<g?new Ia(h,g):{start:g,stop:h}}let y=Math.sqrt(a/l);return new Ia(y,y)}else if(r<1)return a=r-1,l=m.magnitudeSquared(o),d=l*a,u=s*s-d,f=-s+Math.sqrt(u),new Ia(0,f/l);if(s<0)return l=m.magnitudeSquared(o),new Ia(0,-s/l)};function yx(e,t,n){let i=e+t;return w.sign(e)!==w.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}No.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[te.COLUMN1ROW1]-e[te.COLUMN2ROW2])*s,l=o*(i*yx(e[te.COLUMN1ROW0],e[te.COLUMN0ROW1],w.EPSILON15)+t.y),d=e[te.COLUMN0ROW0]*r+e[te.COLUMN2ROW2]*s+i*t.x+n,u=s*yx(e[te.COLUMN2ROW1],e[te.COLUMN1ROW2],w.EPSILON15),f=o*(i*yx(e[te.COLUMN2ROW0],e[te.COLUMN0ROW2])+t.z),p,y=[];if(f===0&&u===0){if(p=Fc.computeRealRoots(a,l,d),p.length===0)return y;let P=p[0],F=Math.sqrt(Math.max(1-P*P,0));if(y.push(new m(i,o*P,o*-F)),y.push(new m(i,o*P,o*F)),p.length===2){let N=p[1],b=Math.sqrt(Math.max(1-N*N,0));y.push(new m(i,o*N,o*-b)),y.push(new m(i,o*N,o*b))}return y}let h=f*f,g=u*u,x=a*a,S=f*u,V=x+g,Z=2*(l*a+S),R=2*d*a+l*l-g+h,E=2*(d*l-S),I=d*d-h;if(V===0&&Z===0&&R===0&&E===0)return y;p=TZ.computeRealRoots(V,Z,R,E,I);let v=p.length;if(v===0)return y;for(let P=0;P<v;++P){let F=p[P],N=F*F,b=Math.max(1-N,0),G=Math.sqrt(b),X;w.sign(a)===w.sign(d)?X=yx(a*N+d,l*F,w.EPSILON12):w.sign(d)===w.sign(l*F)?X=yx(a*N,l*F+d,w.EPSILON12):X=yx(a*N+l*F,d,w.EPSILON12);let W=yx(u*F,f,w.EPSILON15),A=X*W;A<0?y.push(new m(i,o*F,o*G)):A>0?y.push(new m(i,o*F,o*-G)):G!==0?(y.push(new m(i,o*F,o*-G)),y.push(new m(i,o*F,o*G)),++P):y.push(new m(i,o*F,o*G))}return y};var dY=new m,Bee=new m,Yee=new m,JN=new m,IRe=new m,WRe=new te,wRe=new te,PRe=new te,vRe=new te,FRe=new te,Hee=new te,zee=new te,Kee=new m,ARe=new m,MRe=new pe;No.grazingAltitudeLocation=function(e,t){if(!c(e))throw new L("ray is required.");if(!c(t))throw new L("ellipsoid is required.");let n=e.origin,i=e.direction;if(!m.equals(n,m.ZERO)){let I=t.geodeticSurfaceNormal(n,dY);if(m.dot(i,I)>=0)return n}let o=c(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,dY),s=m.normalize(r,r),a=m.mostOrthogonalAxis(r,JN),l=m.normalize(m.cross(a,s,Bee),Bee),d=m.normalize(m.cross(s,l,Yee),Yee),u=WRe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=l.x,u[4]=l.y,u[5]=l.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let f=te.transpose(u,wRe),p=te.fromScale(t.radii,PRe),y=te.fromScale(t.oneOverRadii,vRe),h=FRe;h[0]=0,h[1]=-i.z,h[2]=i.y,h[3]=i.z,h[4]=0,h[5]=-i.x,h[6]=-i.y,h[7]=i.x,h[8]=0;let g=te.multiply(te.multiply(f,y,Hee),h,Hee),x=te.multiply(te.multiply(g,p,zee),u,zee),S=te.multiplyByVector(g,n,IRe),V=No.quadraticVectorExpression(x,m.negate(S,dY),0,0,1),Z,R,E=V.length;if(E>0){let I=m.clone(m.ZERO,ARe),v=Number.NEGATIVE_INFINITY;for(let F=0;F<E;++F){Z=te.multiplyByVector(p,te.multiplyByVector(u,V[F],Kee),Kee);let N=m.normalize(m.subtract(Z,n,JN),JN),b=m.dot(N,i);b>v&&(v=b,I=m.clone(Z,I))}let P=t.cartesianToCartographic(I,MRe);return v=w.clamp(v,0,1),R=m.magnitude(m.subtract(I,n,JN))*Math.sqrt(1-v*v),R=o?-R:R,P.height=R,t.cartographicToCartesian(P,new m)}};var NRe=new m;No.lineSegmentPlane=function(e,t,n,i){if(!c(e))throw new L("endPoint0 is required.");if(!c(t))throw new L("endPoint1 is required.");if(!c(n))throw new L("plane is required.");c(i)||(i=new m);let o=m.subtract(t,e,NRe),r=n.normal,s=m.dot(r,o);if(Math.abs(s)<w.EPSILON6)return;let a=m.dot(r,e),l=-(n.distance+a)/s;if(!(l<0||l>1))return m.multiplyByScalar(o,l,i),m.add(e,i,i),i};No.trianglePlaneIntersection=function(e,t,n,i){if(!c(e)||!c(t)||!c(n)||!c(i))throw new L("p0, p1, p2, and plane are required.");let o=i.normal,r=i.distance,s=m.dot(o,e)+r<0,a=m.dot(o,t)+r<0,l=m.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=l?1:0;let u,f;if((d===1||d===2)&&(u=new m,f=new m),d===1){if(s)return No.lineSegmentPlane(e,t,i,u),No.lineSegmentPlane(e,n,i,f),{positions:[e,t,n,u,f],indices:[0,3,4,1,2,4,1,4,3]};if(a)return No.lineSegmentPlane(t,n,i,u),No.lineSegmentPlane(t,e,i,f),{positions:[e,t,n,u,f],indices:[1,3,4,2,0,4,2,4,3]};if(l)return No.lineSegmentPlane(n,e,i,u),No.lineSegmentPlane(n,t,i,f),{positions:[e,t,n,u,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!l)return No.lineSegmentPlane(e,n,i,u),No.lineSegmentPlane(t,n,i,f),{positions:[e,t,n,u,f],indices:[0,1,4,0,4,3,2,3,4]}}else return No.lineSegmentPlane(n,t,i,u),No.lineSegmentPlane(e,t,i,f),{positions:[e,t,n,u,f],indices:[2,0,4,2,4,3,1,3,4]};else return No.lineSegmentPlane(t,e,i,u),No.lineSegmentPlane(n,e,i,f),{positions:[e,t,n,u,f],indices:[1,2,4,1,4,3,0,3,4]}};var qn=No;var Dvt=_(T(),1);function As(e,t){if(C.typeOf.object("normal",e),!w.equalsEpsilon(m.magnitude(e),1,w.EPSILON6))throw new L("normal must be normalized.");C.typeOf.number("distance",t),this.normal=m.clone(e),this.distance=t}As.fromPointNormal=function(e,t,n){if(C.typeOf.object("point",e),C.typeOf.object("normal",t),!w.equalsEpsilon(m.magnitude(t),1,w.EPSILON6))throw new L("normal must be normalized.");let i=-m.dot(t,e);return c(n)?(m.clone(t,n.normal),n.distance=i,n):new As(t,i)};var kRe=new m;As.fromCartesian4=function(e,t){C.typeOf.object("coefficients",e);let n=m.fromCartesian4(e,kRe),i=e.w;if(!w.equalsEpsilon(m.magnitude(n),1,w.EPSILON6))throw new L("normal must be normalized.");return c(t)?(m.clone(n,t.normal),t.distance=i,t):new As(n,i)};As.getPointDistance=function(e,t){return C.typeOf.object("plane",e),C.typeOf.object("point",t),m.dot(e.normal,t)+e.distance};var URe=new m;As.projectPointOntoPlane=function(e,t,n){C.typeOf.object("plane",e),C.typeOf.object("point",t),c(n)||(n=new m);let i=As.getPointDistance(e,t),o=m.multiplyByScalar(e.normal,i,URe);return m.subtract(t,o,n)};var ORe=new M,DRe=new ce,BRe=new m;As.transform=function(e,t,n){C.typeOf.object("plane",e),C.typeOf.object("transform",t);let i=e.normal,o=e.distance,r=M.inverseTranspose(t,ORe),s=ce.fromElements(i.x,i.y,i.z,o,DRe);s=M.multiplyByVector(r,s,s);let a=m.fromCartesian4(s,BRe);return s=ce.divideByScalar(s,m.magnitude(a),s),As.fromCartesian4(s,n)};As.clone=function(e,t){return C.typeOf.object("plane",e),c(t)?(m.clone(e.normal,t.normal),t.distance=e.distance,t):new As(e.normal,e.distance)};As.equals=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),e.distance===t.distance&&m.equals(e.normal,t.normal)};As.ORIGIN_XY_PLANE=Object.freeze(new As(m.UNIT_Z,0));As.ORIGIN_YZ_PLANE=Object.freeze(new As(m.UNIT_X,0));As.ORIGIN_ZX_PLANE=Object.freeze(new As(m.UNIT_Y,0));var cn=As;var Kvt=_(T(),1);var uY={};uY.calculateACMR=function(e){e=e??z.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24;if(!c(t))throw new L("indices is required.");let o=t.length;if(o<3||o%3!==0)throw new L("indices length must be a multiple of three.");if(n<=0)throw new L("maximumIndex must be greater than zero.");if(i<3)throw new L("cacheSize must be greater than two.");if(!c(n)){n=0;let a=0,l=t[a];for(;a<o;)l>n&&(n=l),++a,l=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)};uY.tipsify=function(e){e=e??z.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(b,G,X,W){for(;G.length>=1;){let A=G[G.length-1];if(G.splice(G.length-1,1),b[A].numLiveTriangles>0)return A}for(;o<W;){if(b[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(b,G,X,W,A,k,B){let O=-1,H,U=-1,K=0;for(;K<X.length;){let Q=X[K];W[Q].numLiveTriangles&&(H=0,A-W[Q].timeStamp+2*W[Q].numLiveTriangles<=G&&(H=A-W[Q].timeStamp),(H>U||U===-1)&&(U=H,O=Q)),++K}return O===-1?r(W,k,b,B):O}if(!c(t))throw new L("indices is required.");let a=t.length;if(a<3||a%3!==0)throw new L("indices length must be a multiple of three.");if(n<=0)throw new L("maximumIndex must be greater than zero.");if(i<3)throw new L("cacheSize must be greater than two.");let l=0,d=0,u=t[d],f=a;if(c(n))l=n+1;else{for(;d<f;)u>l&&(l=u),++d,u=t[d];if(l===-1)return 0;++l}let p=[],y;for(y=0;y<l;y++)p[y]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;let h=0;for(;d<f;)p[t[d]].vertexTriangles.push(h),++p[t[d]].numLiveTriangles,p[t[d+1]].vertexTriangles.push(h),++p[t[d+1]].numLiveTriangles,p[t[d+2]].vertexTriangles.push(h),++p[t[d+2]].numLiveTriangles,++h,d+=3;let g=0,x=i+1;o=1;let S=[],V=[],Z,R,E=0,I=[],v=a/3,P=[];for(y=0;y<v;y++)P[y]=!1;let F,N;for(;g!==-1;){S=[],R=p[g],N=R.vertexTriangles.length;for(let b=0;b<N;++b)if(h=R.vertexTriangles[b],!P[h]){P[h]=!0,d=h+h+h;for(let G=0;G<3;++G)F=t[d],S.push(F),V.push(F),I[E]=F,++E,Z=p[F],--Z.numLiveTriangles,x-Z.timeStamp>i&&(Z.timeStamp=x,++x),++d}g=s(t,i,S,p,x,V,l)}return I};var SZ=uY;var Ac={};function n5(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function YRe(e){let t=e.length,n=t/3*6,i=Me.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)n5(i,o,e[r],e[r+1],e[r+2]);return i}function HRe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Me.createTypedArray(t,n);n5(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)n5(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function zRe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Me.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)n5(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Ac.toWireframe=function(e){if(!c(e))throw new L("geometry is required.");let t=e.indices;if(c(t)){switch(e.primitiveType){case ve.TRIANGLES:e.indices=YRe(t);break;case ve.TRIANGLE_STRIP:e.indices=HRe(t);break;case ve.TRIANGLE_FAN:e.indices=zRe(t);break;default:throw new L("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=ve.LINES}return e};Ac.createLineSegmentsForVectors=function(e,t,n){if(t=t??"normal",!c(e))throw new L("geometry is required.");if(!c(e.attributes.position))throw new L("geometry.attributes.position is required.");if(!c(e.attributes[t]))throw new L(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let u=0;u<r;u+=3)s[a++]=i[u],s[a++]=i[u+1],s[a++]=i[u+2],s[a++]=i[u]+o[u]*n,s[a++]=i[u+1]+o[u+1]*n,s[a++]=i[u+2]+o[u+2]*n;let l,d=e.boundingSphere;return c(d)&&(l=new ue(d.center,d.radius+n)),new dt({attributes:{position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:ve.LINES,boundingSphere:l})};Ac.createAttributeLocations=function(e){if(!c(e))throw new L("geometry is required.");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];c(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!c(i[a])&&(i[a]=o++);return i};Ac.reorderForPreVertexCache=function(e){if(!c(e))throw new L("geometry is required.");let t=dt.computeNumberOfVertices(e),n=e.indices;if(c(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Me.createTypedArray(t,r),a=0,l=0,d=0,u;for(;a<r;)u=i[o[a]],u!==-1?s[l]=u:(u=o[a],i[u]=d,s[l]=d,++d),++a,++l;e.indices=s;let f=e.attributes;for(let p in f)if(f.hasOwnProperty(p)&&c(f[p])&&c(f[p].values)){let y=f[p],h=y.values,g=0,x=y.componentsPerAttribute,S=q.createTypedArray(y.componentDatatype,d*x);for(;g<t;){let V=i[g];if(V!==-1)for(let Z=0;Z<x;Z++)S[x*V+Z]=h[x*g+Z];++g}y.values=S}}return e};Ac.reorderForPostVertexCache=function(e,t){if(!c(e))throw new L("geometry is required.");let n=e.indices;if(e.primitiveType===ve.TRIANGLES&&c(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=SZ.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function jee(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){let i=e[n];t[n]=new Ee({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function KRe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(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])}}Ac.fitToUnsignedShortIndices=function(e){if(!c(e))throw new L("geometry is required.");if(c(e.indices)&&e.primitiveType!==ve.TRIANGLES&&e.primitiveType!==ve.LINES&&e.primitiveType!==ve.POINTS)throw new L("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let t=[],n=dt.computeNumberOfVertices(e);if(c(e.indices)&&n>=w.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=jee(e.attributes),a=e.indices,l=a.length,d;e.primitiveType===ve.TRIANGLES?d=3:e.primitiveType===ve.LINES?d=2:e.primitiveType===ve.POINTS&&(d=1);for(let u=0;u<l;u+=d){for(let f=0;f<d;++f){let p=a[u+f],y=i[p];c(y)||(y=r++,i[p]=y,KRe(s,e.attributes,p)),o.push(y)}r+d>=w.SIXTY_FOUR_KILOBYTES&&(t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=jee(e.attributes))}o.length!==0&&t.push(new dt({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var qee=new m,JRe=new pe;Ac.projectTo2D=function(e,t,n,i,o){if(!c(e))throw new L("geometry is required.");if(!c(t))throw new L("attributeName is required.");if(!c(n))throw new L("attributeName3D is required.");if(!c(i))throw new L("attributeName2D is required.");if(!c(e.attributes[t]))throw new L(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==q.DOUBLE)throw new L("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let r=e.attributes[t];o=c(o)?o:new Xi;let s=o.ellipsoid,a=r.values,l=new Float64Array(a.length),d=0;for(let u=0;u<a.length;u+=3){let f=m.fromArray(a,u,qee),p=s.cartesianToCartographic(f,JRe);if(!c(p))throw new L(`Could not project point (${f.x}, ${f.y}, ${f.z}) to 2D.`);let y=o.project(p,qee);l[d++]=y.x,l[d++]=y.y,l[d++]=y.z}return e.attributes[n]=r,e.attributes[i]=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};var mY={high:0,low:0};Ac.encodeAttribute=function(e,t,n,i){if(!c(e))throw new L("geometry is required.");if(!c(t))throw new L("attributeName is required.");if(!c(n))throw new L("attributeHighName is required.");if(!c(i))throw new L("attributeLowName is required.");if(!c(e.attributes[t]))throw new L(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==q.DOUBLE)throw new L("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),l=new Float32Array(s);for(let u=0;u<s;++u)Bn.encode(r[u],mY),a[u]=mY.high,l[u]=mY.low;let d=o.componentsPerAttribute;return e.attributes[n]=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:d,values:a}),e.attributes[i]=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:d,values:l}),delete e.attributes[t],e};var Wm=new m;function fY(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Wm),M.multiplyByPoint(e,Wm,Wm),m.pack(Wm,n,o)}}function hY(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)m.unpack(n,o,Wm),te.multiplyByVector(e,Wm,Wm),Wm=m.normalize(Wm,Wm),m.pack(Wm,n,o)}}var QN=new M,jN=new te;Ac.transformToWorldCoordinates=function(e){if(!c(e))throw new L("instance is required.");let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;fY(t,n.position),fY(t,n.prevPosition),fY(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(M.inverse(t,QN),M.transpose(QN,QN),M.getMatrix3(QN,jN),hY(jN,n.normal),hY(jN,n.tangent),hY(jN,n.bitangent));let i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function QRe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&c(o[r])&&c(o[r].values)){let s=o[r],a=s.values.length,l=!0;for(let d=1;d<n;++d){let u=e[d][t].attributes[r];if(!c(u)||s.componentDatatype!==u.componentDatatype||s.componentsPerAttribute!==u.componentsPerAttribute||s.normalize!==u.normalize){l=!1;break}a+=u.values.length}l&&(i[r]=new Ee({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:q.createTypedArray(s.componentDatatype,a)}))}return i}var jRe=new m;function pY(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,l=c(e[0][t].indices),d=e[0][t].primitiveType;for(o=1;o<n;++o){if(!M.equals(e[o].modelMatrix,a))throw new L("All instances must have the same modelMatrix.");if(c(e[o][t].indices)!==l)throw new L("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==d)throw new L("All instance geometries must have the same primitiveType.")}let u=QRe(e,t),f,p,y;for(i in u)if(u.hasOwnProperty(i))for(f=u[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,y=p.length,r=0;r<y;++r)f[s++]=p[r];let h;if(l){let V=0;for(o=0;o<n;++o)V+=e[o][t].indices.length;let Z=dt.computeNumberOfVertices(new dt({attributes:u,primitiveType:ve.POINTS})),R=Me.createTypedArray(Z,V),E=0,I=0;for(o=0;o<n;++o){let v=e[o][t].indices,P=v.length;for(s=0;s<P;++s)R[E++]=I+v[s];I+=dt.computeNumberOfVertices(e[o][t])}h=R}let g=new m,x=0,S;for(o=0;o<n;++o){if(S=e[o][t].boundingSphere,!c(S)){g=void 0;break}m.add(S.center,g,g)}if(c(g))for(m.divideByScalar(g,n,g),o=0;o<n;++o){S=e[o][t].boundingSphere;let V=m.magnitude(m.subtract(S.center,g,jRe))+S.radius;V>x&&(x=V)}return new dt({attributes:u,indices:h,primitiveType:d,boundingSphere:c(g)?new ue(g,x):void 0})}Ac.combineInstances=function(e){if(!c(e)||e.length<1)throw new L("instances is required and must have length greater than zero.");let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];c(s.geometry)?t.push(s):c(s.westHemisphereGeometry)&&c(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(pY(t,"geometry")),n.length>0&&(o.push(pY(n,"westHemisphereGeometry")),o.push(pY(n,"eastHemisphereGeometry"))),o};var gu=new m,CZ=new m,tC=new m,nC=new m;Ac.computeNormal=function(e){if(!c(e))throw new L("geometry is required.");if(!c(e.attributes.position)||!c(e.attributes.position.values))throw new L("geometry.attributes.position.values is required.");if(!c(e.indices))throw new L("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new L("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==ve.TRIANGLES)throw new L("geometry.primitiveType must be PrimitiveType.TRIANGLES.");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),l=new Array(r),d;for(d=0;d<o;d++)s[d]={indexOffset:0,count:0,currentCount:0};let u=0;for(d=0;d<r;d+=3){let h=t[d],g=t[d+1],x=t[d+2],S=h*3,V=g*3,Z=x*3;CZ.x=i[S],CZ.y=i[S+1],CZ.z=i[S+2],tC.x=i[V],tC.y=i[V+1],tC.z=i[V+2],nC.x=i[Z],nC.y=i[Z+1],nC.z=i[Z+2],s[h].count++,s[g].count++,s[x].count++,m.subtract(tC,CZ,tC),m.subtract(nC,CZ,nC),a[u]=m.cross(tC,nC,new m),u++}let f=0;for(d=0;d<o;d++)s[d].indexOffset+=f,f+=s[d].count;u=0;let p;for(d=0;d<r;d+=3){p=s[t[d]];let h=p.indexOffset+p.currentCount;l[h]=u,p.currentCount++,p=s[t[d+1]],h=p.indexOffset+p.currentCount,l[h]=u,p.currentCount++,p=s[t[d+2]],h=p.indexOffset+p.currentCount,l[h]=u,p.currentCount++,u++}let y=new Float32Array(o*3);for(d=0;d<o;d++){let h=d*3;if(p=s[d],m.clone(m.ZERO,gu),p.count>0){for(u=0;u<p.count;u++)m.add(gu,a[l[p.indexOffset+u]],gu);m.equalsEpsilon(m.ZERO,gu,w.EPSILON10)&&m.clone(a[l[p.indexOffset]],gu)}m.equalsEpsilon(m.ZERO,gu,w.EPSILON10)&&(gu.z=1),m.normalize(gu,gu),y[h]=gu.x,y[h+1]=gu.y,y[h+2]=gu.z}return e.attributes.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y}),e};var qRe=new m,$ee=new m,$Re=new m;Ac.computeTangentAndBitangent=function(e){if(!c(e))throw new L("geometry is required.");let t=e.attributes,n=e.indices;if(!c(t.position)||!c(t.position.values))throw new L("geometry.attributes.position.values is required.");if(!c(t.normal)||!c(t.normal.values))throw new L("geometry.attributes.normal.values is required.");if(!c(t.st)||!c(t.st.values))throw new L("geometry.attributes.st.values is required.");if(!c(n))throw new L("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new L("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==ve.TRIANGLES)throw new L("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let 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,l=new Array(s*3),d;for(d=0;d<l.length;d++)l[d]=0;let u,f,p;for(d=0;d<a;d+=3){let g=n[d],x=n[d+1],S=n[d+2];u=g*3,f=x*3,p=S*3;let V=g*2,Z=x*2,R=S*2,E=i[u],I=i[u+1],v=i[u+2],P=r[V],F=r[V+1],N=r[Z+1]-F,b=r[R+1]-F,G=1/((r[Z]-P)*b-(r[R]-P)*N),X=(b*(i[f]-E)-N*(i[p]-E))*G,W=(b*(i[f+1]-I)-N*(i[p+1]-I))*G,A=(b*(i[f+2]-v)-N*(i[p+2]-v))*G;l[u]+=X,l[u+1]+=W,l[u+2]+=A,l[f]+=X,l[f+1]+=W,l[f+2]+=A,l[p]+=X,l[p+1]+=W,l[p+2]+=A}let y=new Float32Array(s*3),h=new Float32Array(s*3);for(d=0;d<s;d++){u=d*3,f=u+1,p=u+2;let g=m.fromArray(o,u,qRe),x=m.fromArray(l,u,$Re),S=m.dot(g,x);m.multiplyByScalar(g,S,$ee),m.normalize(m.subtract(x,$ee,x),x),y[u]=x.x,y[f]=x.y,y[p]=x.z,m.normalize(m.cross(g,x,x),x),h[u]=x.x,h[f]=x.y,h[p]=x.z}return e.attributes.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y}),e.attributes.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h}),e};var VZ=new D,Im=new m,ete=new m,tte=new m,qN=new D;Ac.compressVertices=function(e){if(!c(e))throw new L("geometry is required.");let t=e.attributes.extrudeDirection,n,i;if(c(t)){let I=t.values;i=I.length/3;let v=new Float32Array(i*2),P=0;for(n=0;n<i;++n){if(m.fromArray(I,n*3,Im),m.equals(Im,m.ZERO)){P+=2;continue}qN=Fn.octEncodeInRange(Im,65535,qN),v[P++]=qN.x,v[P++]=qN.y}return e.attributes.compressedAttributes=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:v}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=c(o),a=c(r);if(!s&&!a)return e;let l=e.attributes.tangent,d=e.attributes.bitangent,u=c(l),f=c(d),p,y,h,g;s&&(p=o.values),a&&(y=r.values),u&&(h=l.values),f&&(g=d.values),i=(s?p.length:y.length)/(s?3:2);let V=i,Z=a&&s?2:1;Z+=u||f?1:0,V*=Z;let R=new Float32Array(V),E=0;for(n=0;n<i;++n){a&&(D.fromArray(y,n*2,VZ),R[E++]=Fn.compressTextureCoordinates(VZ));let I=n*3;s&&c(h)&&c(g)?(m.fromArray(p,I,Im),m.fromArray(h,I,ete),m.fromArray(g,I,tte),Fn.octPack(Im,ete,tte,VZ),R[E++]=VZ.x,R[E++]=VZ.y):(s&&(m.fromArray(p,I,Im),R[E++]=Fn.octEncodeFloat(Im)),u&&(m.fromArray(h,I,Im),R[E++]=Fn.octEncodeFloat(Im)),f&&(m.fromArray(g,I,Im),R[E++]=Fn.octEncodeFloat(Im)))}return e.attributes.compressedAttributes=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:Z,values:R}),s&&delete e.attributes.normal,a&&delete e.attributes.st,f&&delete e.attributes.bitangent,u&&delete e.attributes.tangent,e};function eGe(e){if(c(e.indices))return e;let t=dt.computeNumberOfVertices(e);if(t<3)throw new L("The number of vertices must be at least three.");if(t%3!==0)throw new L("The number of vertices must be a multiple of three.");let n=Me.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function tGe(e){let t=dt.computeNumberOfVertices(e);if(t<3)throw new L("The number of vertices must be at least three.");let n=Me.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=ve.TRIANGLES,e}function nGe(e){let t=dt.computeNumberOfVertices(e);if(t<3)throw new L("The number of vertices must be at least 3.");let n=Me.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=ve.TRIANGLES,e}function iGe(e){if(c(e.indices))return e;let t=dt.computeNumberOfVertices(e);if(t<2)throw new L("The number of vertices must be at least two.");if(t%2!==0)throw new L("The number of vertices must be a multiple of 2.");let n=Me.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function oGe(e){let t=dt.computeNumberOfVertices(e);if(t<2)throw new L("The number of vertices must be at least two.");let n=Me.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=ve.LINES,e}function rGe(e){let t=dt.computeNumberOfVertices(e);if(t<2)throw new L("The number of vertices must be at least two.");let n=Me.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=ve.LINES,e}function sGe(e){switch(e.primitiveType){case ve.TRIANGLE_FAN:return tGe(e);case ve.TRIANGLE_STRIP:return nGe(e);case ve.TRIANGLES:return eGe(e);case ve.LINE_STRIP:return oGe(e);case ve.LINE_LOOP:return rGe(e);case ve.LINES:return iGe(e)}return e}function U0(e,t){Math.abs(e.y)<w.EPSILON6&&(t?e.y=-w.EPSILON6:e.y=w.EPSILON6)}function aGe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){U0(e,e.y<0),U0(t,t.y<0),U0(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=w.sign(e.y):s=w.sign(n.y):o>r?s=w.sign(t.y):s=w.sign(n.y);let a=s<0;U0(e,a),U0(t,a),U0(n,a)}var nte=new m;function xu(e,t,n,i){m.add(e,m.multiplyByScalar(m.subtract(t,e,nte),e.y/(e.y-t.y),nte),n),m.clone(n,i),U0(n,!0),U0(i,!1)}var gx=new m,xx=new m,_x=new m,Tx=new m,bY={positions:new Array(7),indices:new Array(3*3)};function cGe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;aGe(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=bY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(xu(e,t,gx,_x),xu(e,n,xx,Tx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(xu(t,n,gx,_x),xu(t,e,xx,Tx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(xu(n,e,gx,_x),xu(n,t,xx,Tx),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||(xu(n,e,gx,_x),xu(n,t,xx,Tx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(xu(t,n,gx,_x),xu(t,e,xx,Tx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(xu(e,t,gx,_x),xu(e,n,xx,Tx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let l=bY.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(s===1||s===2)&&(l[3]=gx,l[4]=xx,l[5]=_x,l[6]=Tx,l.length=7),bY}function ite(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){let r=n[o];r.values=q.createTypedArray(r.componentDatatype,r.values)}let i=dt.computeNumberOfVertices(e);return e.indices=Me.createTypedArray(i,e.indices),t&&(e.boundingSphere=ue.fromVertices(n.position.values)),e}function oC(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];n[i]=new Ee({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new dt({attributes:n,indices:[],primitiveType:e.primitiveType})}function _Y(e,t,n){let i=c(e.geometry.boundingSphere);t=ite(t,i),n=ite(n,i),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function TY(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,l,d,u,f,p){let y=e.fromArray(d,r*t,n),h=e.fromArray(d,s*t,i),g=e.fromArray(d,a*t,o);e.multiplyByScalar(y,l.x,y),e.multiplyByScalar(h,l.y,h),e.multiplyByScalar(g,l.z,g);let x=e.add(y,h,y);e.add(x,g,x),p&&e.normalize(x,x),e.pack(x,u,f*t)}}var lGe=TY(ce,4),t5=TY(m,3),lte=TY(D,2),dGe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,l=o[t]*i.y,d=o[n]*i.z;r[s]=a+l+d>w.EPSILON6?1:0},LZ=new m,yY=new m,gY=new m,uGe=new m;function $N(e,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g){if(!c(r)&&!c(s)&&!c(a)&&!c(l)&&!c(d)&&y===0)return;let x=m.fromArray(o,e*3,LZ),S=m.fromArray(o,t*3,yY),V=m.fromArray(o,n*3,gY),Z=px(i,x,S,V,uGe);if(c(Z)){if(c(r)&&t5(e,t,n,Z,r,f.normal.values,g,!0),c(d)){let R=m.fromArray(d,e*3,LZ),E=m.fromArray(d,t*3,yY),I=m.fromArray(d,n*3,gY);m.multiplyByScalar(R,Z.x,R),m.multiplyByScalar(E,Z.y,E),m.multiplyByScalar(I,Z.z,I);let v;!m.equals(R,m.ZERO)||!m.equals(E,m.ZERO)||!m.equals(I,m.ZERO)?(v=m.add(R,E,R),m.add(v,I,v),m.normalize(v,v)):(v=LZ,v.x=0,v.y=0,v.z=0),m.pack(v,f.extrudeDirection.values,g*3)}if(c(u)&&dGe(e,t,n,Z,u,f.applyOffset.values,g),c(s)&&t5(e,t,n,Z,s,f.tangent.values,g,!0),c(a)&&t5(e,t,n,Z,a,f.bitangent.values,g,!0),c(l)&&lte(e,t,n,Z,l,f.st.values,g),y>0)for(let R=0;R<y;R++){let E=p[R];mGe(e,t,n,Z,g,h[E],f[E])}}}function mGe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,l=r.values,d=s.values;switch(a){case 4:lGe(e,t,n,i,l,d,o,!1);break;case 3:t5(e,t,n,i,l,d,o,!1);break;case 2:lte(e,t,n,i,l,d,o,!1);break;default:d[o]=l[e]*i.x+l[t]*i.y+l[n]*i.z}}function dh(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],l=n[a];return l===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(l),l)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var fGe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ote(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.normal)?n.normal.values:void 0,r=c(n.bitangent)?n.bitangent.values:void 0,s=c(n.tangent)?n.tangent.values:void 0,a=c(n.st)?n.st.values:void 0,l=c(n.extrudeDirection)?n.extrudeDirection.values:void 0,d=c(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,f=[];for(let v in n)n.hasOwnProperty(v)&&!fGe[v]&&c(n[v])&&f.push(v);let p=f.length,y=oC(t),h=oC(t),g,x,S,V,Z,R=[];R.length=i.length/3;let E=[];for(E.length=i.length/3,Z=0;Z<R.length;++Z)R[Z]=-1,E[Z]=-1;let I=u.length;for(Z=0;Z<I;Z+=3){let v=u[Z],P=u[Z+1],F=u[Z+2],N=m.fromArray(i,v*3),b=m.fromArray(i,P*3),G=m.fromArray(i,F*3),X=cGe(N,b,G);if(c(X)&&X.positions.length>3){let W=X.positions,A=X.indices,k=A.length;for(let B=0;B<k;++B){let O=A[B],H=W[O];H.y<0?(g=h.attributes,x=h.indices,S=R):(g=y.attributes,x=y.indices,S=E),V=dh(g,x,S,u,O<3?Z+O:-1,H),$N(v,P,F,H,i,o,s,r,a,l,d,g,f,p,n,V)}}else c(X)&&(N=X.positions[0],b=X.positions[1],G=X.positions[2]),N.y<0?(g=h.attributes,x=h.indices,S=R):(g=y.attributes,x=y.indices,S=E),V=dh(g,x,S,u,Z,N),$N(v,P,F,N,i,o,s,r,a,l,d,g,f,p,n,V),V=dh(g,x,S,u,Z+1,b),$N(v,P,F,b,i,o,s,r,a,l,d,g,f,p,n,V),V=dh(g,x,S,u,Z+2,G),$N(v,P,F,G,i,o,s,r,a,l,d,g,f,p,n,V)}_Y(e,h,y)}var dte=cn.fromPointNormal(m.ZERO,m.UNIT_Y),hGe=new m,pGe=new m;function iC(e,t,n,i,o,r,s){if(!c(s))return;let a=m.fromArray(i,e*3,LZ);m.equalsEpsilon(a,n,w.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function rte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=oC(t),a=oC(t),l,d=r.length,u=[];u.length=i.length/3;let f=[];for(f.length=i.length/3,l=0;l<u.length;++l)u[l]=-1,f[l]=-1;for(l=0;l<d;l+=2){let p=r[l],y=r[l+1],h=m.fromArray(i,p*3,LZ),g=m.fromArray(i,y*3,yY),x;Math.abs(h.y)<w.EPSILON6&&(h.y<0?h.y=-w.EPSILON6:h.y=w.EPSILON6),Math.abs(g.y)<w.EPSILON6&&(g.y<0?g.y=-w.EPSILON6:g.y=w.EPSILON6);let S=s.attributes,V=s.indices,Z=f,R=a.attributes,E=a.indices,I=u,v=qn.lineSegmentPlane(h,g,dte,gY);if(c(v)){let P=m.multiplyByScalar(m.UNIT_Y,5*w.EPSILON9,hGe);h.y<0&&(m.negate(P,P),S=a.attributes,V=a.indices,Z=u,R=s.attributes,E=s.indices,I=f);let F=m.add(v,P,pGe);x=dh(S,V,Z,r,l,h),iC(p,y,h,i,x,S,o),x=dh(S,V,Z,r,-1,F),iC(p,y,F,i,x,S,o),m.negate(P,P),m.add(v,P,F),x=dh(R,E,I,r,-1,F),iC(p,y,F,i,x,R,o),x=dh(R,E,I,r,l+1,g),iC(p,y,g,i,x,R,o)}else{let P,F,N;h.y<0?(P=a.attributes,F=a.indices,N=u):(P=s.attributes,F=s.indices,N=f),x=dh(P,F,N,r,l,h),iC(p,y,h,i,x,P,o),x=dh(P,F,N,r,l+1,g),iC(p,y,g,i,x,P,o)}}_Y(e,a,s)}var ste=new D,bGe=new D,ute=new m,mte=new m,xY=new m,yGe=new m,gGe=new m,xGe=new m,ate=new ce;function cte(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=m.unpack(n,s,ute);if(a.x>0)continue;let l=m.unpack(i,s,mte);(a.y<0&&l.y>0||a.y>0&&l.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):m.pack(a,i,s));let d=m.unpack(o,s,xY);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):m.pack(a,o,s))}}var _Ge=5*w.EPSILON9,e5=w.EPSILON6;function TGe(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=c(n.st)?n.st.values:void 0,l=c(n.color)?n.color.values:void 0,d=oC(t),u=oC(t),f,p,y,h=!1,g=i.length/3;for(f=0;f<g;f+=4){let x=f,S=f+2,V=m.fromArray(i,x*3,ute),Z=m.fromArray(i,S*3,mte);if(Math.abs(V.y)<e5)for(V.y=e5*(Z.y<0?-1:1),i[f*3+1]=V.y,i[(f+1)*3+1]=V.y,p=x*3;p<x*3+4*3;p+=3)o[p]=i[f*3],o[p+1]=i[f*3+1],o[p+2]=i[f*3+2];if(Math.abs(Z.y)<e5)for(Z.y=e5*(V.y<0?-1:1),i[(f+2)*3+1]=Z.y,i[(f+3)*3+1]=Z.y,p=x*3;p<x*3+4*3;p+=3)r[p]=i[(f+2)*3],r[p+1]=i[(f+2)*3+1],r[p+2]=i[(f+2)*3+2];let R=d.attributes,E=d.indices,I=u.attributes,v=u.indices,P=qn.lineSegmentPlane(V,Z,dte,yGe);if(c(P)){h=!0;let F=m.multiplyByScalar(m.UNIT_Y,_Ge,gGe);V.y<0&&(m.negate(F,F),R=u.attributes,E=u.indices,I=d.attributes,v=d.indices);let N=m.add(P,F,xGe);R.position.values.push(V.x,V.y,V.z,V.x,V.y,V.z),R.position.values.push(N.x,N.y,N.z),R.position.values.push(N.x,N.y,N.z),R.prevPosition.values.push(o[x*3],o[x*3+1],o[x*3+2]),R.prevPosition.values.push(o[x*3+3],o[x*3+4],o[x*3+5]),R.prevPosition.values.push(V.x,V.y,V.z,V.x,V.y,V.z),R.nextPosition.values.push(N.x,N.y,N.z),R.nextPosition.values.push(N.x,N.y,N.z),R.nextPosition.values.push(N.x,N.y,N.z),R.nextPosition.values.push(N.x,N.y,N.z),m.negate(F,F),m.add(P,F,N),I.position.values.push(N.x,N.y,N.z),I.position.values.push(N.x,N.y,N.z),I.position.values.push(Z.x,Z.y,Z.z,Z.x,Z.y,Z.z),I.prevPosition.values.push(N.x,N.y,N.z),I.prevPosition.values.push(N.x,N.y,N.z),I.prevPosition.values.push(N.x,N.y,N.z),I.prevPosition.values.push(N.x,N.y,N.z),I.nextPosition.values.push(Z.x,Z.y,Z.z,Z.x,Z.y,Z.z),I.nextPosition.values.push(r[S*3],r[S*3+1],r[S*3+2]),I.nextPosition.values.push(r[S*3+3],r[S*3+4],r[S*3+5]);let b=D.fromArray(s,x*2,ste),G=Math.abs(b.y);R.expandAndWidth.values.push(-1,G,1,G),R.expandAndWidth.values.push(-1,-G,1,-G),I.expandAndWidth.values.push(-1,G,1,G),I.expandAndWidth.values.push(-1,-G,1,-G);let X=m.magnitudeSquared(m.subtract(P,V,xY));if(X/=m.magnitudeSquared(m.subtract(Z,V,xY)),c(l)){let W=ce.fromArray(l,x*4,ate),A=ce.fromArray(l,S*4,ate),k=w.lerp(W.x,A.x,X),B=w.lerp(W.y,A.y,X),O=w.lerp(W.z,A.z,X),H=w.lerp(W.w,A.w,X);for(p=x*4;p<x*4+2*4;++p)R.color.values.push(l[p]);for(R.color.values.push(k,B,O,H),R.color.values.push(k,B,O,H),I.color.values.push(k,B,O,H),I.color.values.push(k,B,O,H),p=S*4;p<S*4+2*4;++p)I.color.values.push(l[p])}if(c(a)){let W=D.fromArray(a,x*2,ste),A=D.fromArray(a,(f+3)*2,bGe),k=w.lerp(W.x,A.x,X);for(p=x*2;p<x*2+2*2;++p)R.st.values.push(a[p]);for(R.st.values.push(k,W.y),R.st.values.push(k,A.y),I.st.values.push(k,W.y),I.st.values.push(k,A.y),p=S*2;p<S*2+2*2;++p)I.st.values.push(a[p])}y=R.position.values.length/3-4,E.push(y,y+2,y+1),E.push(y+1,y+2,y+3),y=I.position.values.length/3-4,v.push(y,y+2,y+1),v.push(y+1,y+2,y+3)}else{let F,N;for(V.y<0?(F=u.attributes,N=u.indices):(F=d.attributes,N=d.indices),F.position.values.push(V.x,V.y,V.z),F.position.values.push(V.x,V.y,V.z),F.position.values.push(Z.x,Z.y,Z.z),F.position.values.push(Z.x,Z.y,Z.z),p=f*3;p<f*3+4*3;++p)F.prevPosition.values.push(o[p]),F.nextPosition.values.push(r[p]);for(p=f*2;p<f*2+4*2;++p)F.expandAndWidth.values.push(s[p]),c(a)&&F.st.values.push(a[p]);if(c(l))for(p=f*4;p<f*4+4*4;++p)F.color.values.push(l[p]);y=F.position.values.length/3-4,N.push(y,y+2,y+1),N.push(y+1,y+2,y+3)}}h&&(cte(u),cte(d)),_Y(e,u,d)}Ac.splitLongitude=function(e){if(!c(e))throw new L("instance is required.");let t=e.geometry,n=t.boundingSphere;if(c(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==zt.INTERSECTING))return e;if(t.geometryType!==yu.NONE)switch(t.geometryType){case yu.POLYLINES:TGe(e);break;case yu.TRIANGLES:ote(e);break;case yu.LINES:rte(e);break}else sGe(t),t.primitiveType===ve.TRIANGLES?ote(e):t.primitiveType===ve.LINES&&rte(e);return e};var An=Ac;var RFt=_(T(),1);function ZZ(e,t,n,i,o,r,s,a,l,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=l,this._flipY=d,this._initialized=u}Object.defineProperties(ZZ.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});ZZ.prototype.copyFrom=function(e){C.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(C.defined("options.source",i),C.typeOf.number.greaterThanOrEquals("xOffset",t,0),C.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new L("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new L("yOffset + options.source.height must be less than or equal to height.");let{width:r,height:s}=i,a=this._context._gl,l=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture);let u=i.arrayBufferView,f=this._size,p=this._pixelFormat,y=this._internalFormat,h=this._pixelDatatype,g=this._preMultiplyAlpha,x=this._flipY,S=4;c(u)&&(S=ke.alignmentInBytes(p,h,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,S),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){let Z;t===0&&n===0&&r===f&&s===f?(c(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ke.flipY(u,p,h,f,f)),Z=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),Z=i),V=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Z=ke.createTypedArray(p,h,f,f)),a.texImage2D(d,0,y,f,f,0,p,Ue.toWebGLConstant(h,this._context),Z),this._initialized=!0}V||(c(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),x&&(u=ke.flipY(u,p,h,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,Ue.toWebGLConstant(h,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,x),a.texSubImage2D(d,0,t,n,p,Ue.toWebGLConstant(h,this._context),i))),a.bindTexture(l,null)};ZZ.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size,C.typeOf.number.greaterThanOrEquals("xOffset",e,0),C.typeOf.number.greaterThanOrEquals("yOffset",t,0),C.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),C.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new L("xOffset + source.width must be less than or equal to width.");if(t+r>this._size)throw new L("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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};ZZ.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){if(e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0,C.typeOf.number.greaterThanOrEquals("xOffset",e,0),C.typeOf.number.greaterThanOrEquals("yOffset",t,0),e+n>this._size)throw new L("xOffset + source.width must be less than or equal to width.");if(t+i>this._size)throw new L("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");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 RZ=ZZ;var XFt=_(T(),1);var i5={DONT_CARE:oe.DONT_CARE,FASTEST:oe.FASTEST,NICEST:oe.NICEST,validate:function(e){return e===i5.DONT_CARE||e===i5.FASTEST||e===i5.NICEST}},_u=Object.freeze(i5);var KFt=_(T(),1);var wFt=_(T(),1);var o5={NEAREST:oe.NEAREST,LINEAR:oe.LINEAR};o5.validate=function(e){return e===o5.NEAREST||e===o5.LINEAR};var di=Object.freeze(o5);var FFt=_(T(),1);var O0={NEAREST:oe.NEAREST,LINEAR:oe.LINEAR,NEAREST_MIPMAP_NEAREST:oe.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:oe.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:oe.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:oe.LINEAR_MIPMAP_LINEAR};O0.validate=function(e){return e===O0.NEAREST||e===O0.LINEAR||e===O0.NEAREST_MIPMAP_NEAREST||e===O0.LINEAR_MIPMAP_NEAREST||e===O0.NEAREST_MIPMAP_LINEAR||e===O0.LINEAR_MIPMAP_LINEAR};var Jt=Object.freeze(O0);var NFt=_(T(),1);var r5={CLAMP_TO_EDGE:oe.CLAMP_TO_EDGE,REPEAT:oe.REPEAT,MIRRORED_REPEAT:oe.MIRRORED_REPEAT,validate:function(e){return e===r5.CLAMP_TO_EDGE||e===r5.REPEAT||e===r5.MIRRORED_REPEAT}},xn=Object.freeze(r5);function GZ(e){e=e??z.EMPTY_OBJECT;let{wrapS:t=xn.CLAMP_TO_EDGE,wrapT:n=xn.CLAMP_TO_EDGE,minificationFilter:i=Jt.LINEAR,magnificationFilter:o=di.LINEAR,maximumAnisotropy:r=1}=e;if(!xn.validate(t))throw new L("Invalid sampler.wrapS.");if(!xn.validate(n))throw new L("Invalid sampler.wrapT.");if(!Jt.validate(i))throw new L("Invalid sampler.minificationFilter.");if(!di.validate(o))throw new L("Invalid sampler.magnificationFilter.");C.typeOf.number.greaterThanOrEquals("maximumAnisotropy",r,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(GZ.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});GZ.equals=function(e,t){return e===t||c(e)&&c(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};GZ.NEAREST=Object.freeze(new GZ({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST}));var en=GZ;var lAt=_(T(),1);function SGe(e,t,n,i){let o=c(t.vertexBuffer),r=c(t.value),s=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!r)throw new L("attribute must have a vertexBuffer or a value.");if(o&&r)throw new L("attribute cannot have both a vertexBuffer and a value.  It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(s!==1&&s!==2&&s!==3&&s!==4)throw r?new L("attribute.value.length must be in the range [1, 4]."):new L("attribute.componentsPerAttribute must be in the range [1, 4].");if(c(t.componentDatatype)&&!q.validate(t.componentDatatype))throw new L("attribute must have a valid componentDatatype or not specify it.");if(c(t.strideInBytes)&&t.strideInBytes>255)throw new L("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new L("instanced arrays is not supported");if(c(t.instanceDivisor)&&t.instanceDivisor<0)throw new L("attribute must have an instanceDivisor greater than or equal to zero");if(c(t.instanceDivisor)&&r)throw new L("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new L("attribute zero cannot have an instanceDivisor greater than 0");let 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(l){let d=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(l){}}e.push(a)}function hte(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}c(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Ep(e){e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context),C.defined("options.attributes",e.attributes);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,l=!1,d=!1,u=i.length;for(r=0;r<u;++r)SGe(s,i[r],r,t);for(u=s.length,r=0;r<u;++r){let y=s[r];if(c(y.vertexBuffer)&&y.instanceDivisor===0){let h=y.strideInBytes||y.componentsPerAttribute*q.getSizeInBytes(y.componentDatatype);a=y.vertexBuffer.sizeInBytes/h;break}}for(r=0;r<u;++r)s[r].instanceDivisor>0&&(l=!0),c(s[r].value)&&(d=!0);let f={};for(r=0;r<u;++r){let y=s[r].index;if(f[y])throw new L(`Index ${y} is used by more than one attribute.`);f[y]=!0}let p;t.vertexArrayObject&&(p=t.glCreateVertexArray(),t.glBindVertexArray(p),hte(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=l,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=p,this._attributes=s,this._indexBuffer=o}function fte(e){return e.values.length/e.componentsPerAttribute}function CGe(e){return q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function VGe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&c(e[n])&&c(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=fte(e[o[0]]),t=1;t<s;++t){let d=fte(e[o[t]]);if(d!==r)throw new le(`Each attribute list must have the same number of vertices.  Attribute ${o[t]} has a different number of vertices (${d.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(d,u){return q.getSizeInBytes(e[u].componentDatatype)-q.getSizeInBytes(e[d].componentDatatype)});let a=0,l={};for(t=0;t<s;++t)n=o[t],i=e[n],l[n]=a,a+=CGe(i);if(a>0){let d=q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let f=r*a,p=new ArrayBuffer(f),y={};for(t=0;t<s;++t){n=o[t];let h=q.getSizeInBytes(e[n].componentDatatype);y[n]={pointer:q.createTypedArray(e[n].componentDatatype,p),index:l[n]/h,strideInComponentType:a/h}}for(t=0;t<r;++t)for(let h=0;h<s;++h){n=o[h],i=e[n];let g=i.values,x=y[n],S=x.pointer,V=i.componentsPerAttribute;for(let Z=0;Z<V;++Z)S[x.index+Z]=g[t*V+Z];x.index+=x.strideInComponentType}return{buffer:p,offsetsInBytes:l,vertexSizeInBytes:a}}}Ep.fromGeometry=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context);let t=e.context,n=e.geometry??z.EMPTY_OBJECT,i=e.bufferUsage??Ne.DYNAMIC_DRAW,o=e.attributeLocations??z.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,l,d,u=c(s)?s:[],f=n.attributes;if(r){let h=VGe(f);if(c(h)){d=_t.createVertexBuffer({context:t,typedArray:h.buffer,usage:i});let g=h.offsetsInBytes,x=h.vertexSizeInBytes;for(a in f)f.hasOwnProperty(a)&&c(f[a])&&(l=f[a],c(l.values)?u.push({index:o[a],vertexBuffer:d,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:g[a],strideInBytes:x}):u.push({index:o[a],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(a in f)if(f.hasOwnProperty(a)&&c(f[a])){l=f[a];let h=l.componentDatatype;h===q.DOUBLE&&(h=q.FLOAT),d=void 0,c(l.values)&&(d=_t.createVertexBuffer({context:t,typedArray:q.createTypedArray(h,l.values),usage:i})),u.push({index:o[a],vertexBuffer:d,value:l.value,componentDatatype:h,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize})}let p,y=n.indices;return c(y)&&(dt.computeNumberOfVertices(n)>=w.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=_t.createIndexBuffer({context:t,typedArray:new Uint32Array(y),usage:i,indexDatatype:Me.UNSIGNED_INT}):p=_t.createIndexBuffer({context:t,typedArray:new Uint16Array(y),usage:i,indexDatatype:Me.UNSIGNED_SHORT})),new Ep({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(Ep.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ep.prototype.getAttribute=function(e){return C.defined("index",e),this._attributes[e]};function LGe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=mt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let l=o[s];if(l.enabled){let d=l.instanceDivisor,u=l.index;d!==i[u]&&(t.glVertexAttribDivisor(u,d),i[u]=d)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function ZGe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&c(r.value)&&r.vertexAttrib(t)}}Ep.prototype._bind=function(){c(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&LGe(this),this._hasConstantAttributes&&ZGe(this,this._gl)):hte(this._gl,this._attributes,this._indexBuffer)};Ep.prototype._unBind=function(){if(c(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)}};Ep.prototype.isDestroyed=function(){return!1};Ep.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;c(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return c(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),c(this._vao)&&this._context.glDeleteVertexArray(this._vao),he(this)};var ni=Ep;function So(e){e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new en}=e,l=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,{width:d,height:u}=e;if(c(n)){if(!Object.values(So.FaceName).every(Z=>c(n[Z])))throw new L(`options.source requires faces ${Object.values(So.FaceName).join(", ")}.`);({width:d,height:u}=n.positiveX);for(let Z of So.faceNames()){let R=n[Z];if(Number(R.width)!==d||Number(R.height)!==u)throw new L("Each face in options.source must have the same width and height.")}}let f=d;if(!c(d)||!c(u))throw new L("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(d!==u)throw new L("Width must equal height.");if(f<=0)throw new L("Width and height must be greater than zero.");if(f>mt.maximumCubeMapSize)throw new L(`Width and height must be less than or equal to the maximum cube map size (${mt.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ke.validate(i))throw new L("Invalid options.pixelFormat.");if(ke.isDepthFormat(i))throw new L("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Ue.validate(o))throw new L("Invalid options.pixelDatatype.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new L("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new L("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");let p=ke.textureSizeInBytes(i,o,f,f)*6,y=ke.toInternalFormat(i,o,t),h=t._gl,g=h.TEXTURE_CUBE_MAP,x=h.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g,this._texture=x,this._pixelFormat=i,this._pixelDatatype=o,this._size=f,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=l,this._flipY=r;let S=c(n);function V(Z){return new RZ(t,x,g,Z,y,i,o,f,l,r,S)}this._positiveX=V(h.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=V(h.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=V(h.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=V(h.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=V(h.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=V(h.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,pte(this,a),h.activeTexture(h.TEXTURE0),h.bindTexture(g,x),s?h.pixelStorei(h.UNPACK_COLORSPACE_CONVERSION_WEBGL,h.NONE):h.pixelStorei(h.UNPACK_COLORSPACE_CONVERSION_WEBGL,h.BROWSER_DEFAULT_WEBGL);for(let Z of So.faceNames())SY(this[Z],n?.[Z],0);h.bindTexture(g,null)}So.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Fr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};So.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*RGe(){yield So.FaceName.POSITIVEX,yield So.FaceName.NEGATIVEX,yield So.FaceName.POSITIVEY,yield So.FaceName.NEGATIVEY,yield So.FaceName.POSITIVEZ,yield So.FaceName.NEGATIVEZ}So.faceNames=function(){return RGe()};function SY(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,l=e._flipY,d=e._preMultiplyAlpha,u=e._context,f=u._gl;if(!c(t)){f.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,u),null);return}let{arrayBufferView:p}=t,y=4;c(p)&&(y=ke.alignmentInBytes(r,s,o)),f.pixelStorei(f.UNPACK_ALIGNMENT,y),c(p)?(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,!1),l&&(p=ke.flipY(p,r,s,o,o)),f.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,u),p)):(f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,l),f.texImage2D(i,n,a,r,Ue.toWebGLConstant(s,u),t))}So.loadFace=SY;Object.defineProperties(So.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){pte(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}}});So.getDirection=function(e,t){switch(e){case So.FaceName.POSITIVEX:return m.clone(m.UNIT_X,t);case So.FaceName.NEGATIVEX:return m.negate(m.UNIT_X,t);case So.FaceName.POSITIVEY:return m.clone(m.UNIT_Y,t);case So.FaceName.NEGATIVEY:return m.negate(m.UNIT_Y,t);case So.FaceName.POSITIVEZ:return m.clone(m.UNIT_Z,t);case So.FaceName.NEGATIVEZ:return m.negate(m.UNIT_Z,t)}};function pte(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Jt.NEAREST_MIPMAP_NEAREST,Jt.NEAREST_MIPMAP_LINEAR,Jt.LINEAR_MIPMAP_NEAREST,Jt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ue.FLOAT&&!r.textureFloatLinear||s===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Jt.NEAREST_MIPMAP_NEAREST:Jt.NEAREST,i=di.NEAREST);let a=r._gl,l=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,e._texture),a.texParameteri(l,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(l,a.TEXTURE_MAG_FILTER,i),a.texParameteri(l,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(l,a.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&a.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(l,null)}So.prototype.loadMipmaps=function(e,t){if(C.defined("source",e),!Array.isArray(e))throw new L("source must be an array");let n=Math.log2(this._size);if(e.length!==n)throw new L("all mip levels must be defined");t=t??!1;let i=this._context._gl,o=this._texture,r=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(r,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let s=0;s<e.length;s++){let a=e[s],l=s+1;for(let d of So.faceNames())SY(this[d],a[d],l)}i.bindTexture(r,null),this._hasMipmap=!0};So.prototype.generateMipmap=function(e){if(e=e??_u.DONT_CARE,this._size>1&&!w.isPowerOfTwo(this._size))throw new L("width and height must be a power of two to call generateMipmap().");if(!_u.validate(e))throw new L("hint is invalid.");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)};So.createVertexArray=function(e){let t=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:We.POSITION_ONLY})),n=this._attributeLocations=An.createAttributeLocations(t);return ni.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW})};So.prototype.isDestroyed=function(){return!1};So.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=he(this._positiveX),this._negativeX=he(this._negativeX),this._positiveY=he(this._positiveY),this._negativeY=he(this._negativeY),this._positiveZ=he(this._positiveZ),this._negativeZ=he(this._negativeZ),he(this)};var Uo=So;var PAt=_(T(),1);function GGe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var sc=GGe;var GDt=_(T(),1);var SDt=_(T(),1);var mDt=_(T(),1);var FAt=_(T(),1),EZ=`const float czm_degreesPerRadian = 57.29577951308232;
`;var MAt=_(T(),1),XZ=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
`;var kAt=_(T(),1),IZ=`const float czm_epsilon1 = 0.1;
`;var OAt=_(T(),1),WZ=`const float czm_epsilon2 = 0.01;
`;var BAt=_(T(),1),wZ=`const float czm_epsilon3 = 0.001;
`;var HAt=_(T(),1),PZ=`const float czm_epsilon4 = 0.0001;
`;var KAt=_(T(),1),vZ=`const float czm_epsilon5 = 0.00001;
`;var QAt=_(T(),1),FZ=`const float czm_epsilon6 = 0.000001;
`;var qAt=_(T(),1),AZ=`const float czm_epsilon7 = 0.0000001;
`;var e9t=_(T(),1),MZ=`const float czm_infinity = 5906376272000.0;
`;var n9t=_(T(),1),NZ=`const float czm_oneOverPi = 0.3183098861837907;
`;var o9t=_(T(),1),kZ=`const float czm_oneOverTwoPi = 0.15915494309189535;
`;var s9t=_(T(),1),UZ=`const float czm_passCesium3DTile = 4.0;
`;var c9t=_(T(),1),OZ=`const float czm_passCesium3DTileClassification = 5.0;
`;var d9t=_(T(),1),DZ=`const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
`;var m9t=_(T(),1),BZ=`const float czm_passClassification = 7.0;
`;var h9t=_(T(),1),YZ=`const float czm_passCompute = 1.0;
`;var b9t=_(T(),1),HZ=`const float czm_passEnvironment = 0.0;
`;var g9t=_(T(),1),zZ=`const float czm_passGlobe = 2.0;
`;var _9t=_(T(),1),KZ=`const float czm_passOpaque = 7.0;
`;var S9t=_(T(),1),JZ=`const float czm_passOverlay = 10.0;
`;var V9t=_(T(),1),QZ=`const float czm_passTerrainClassification = 3.0;
`;var Z9t=_(T(),1),jZ=`const float czm_passTranslucent = 8.0;
`;var G9t=_(T(),1),qZ=`const float czm_passVoxels = 9.0;
`;var X9t=_(T(),1),$Z=`const float czm_pi = 3.141592653589793;
`;var W9t=_(T(),1),eR=`const float czm_piOverFour = 0.7853981633974483;
`;var P9t=_(T(),1),tR=`const float czm_piOverSix = 0.5235987755982988;
`;var F9t=_(T(),1),nR=`const float czm_piOverThree = 1.0471975511965976;
`;var M9t=_(T(),1),iR=`const float czm_piOverTwo = 1.5707963267948966;
`;var k9t=_(T(),1),oR=`const float czm_radiansPerDegree = 0.017453292519943295;
`;var O9t=_(T(),1),rR=`const float czm_sceneMode2D = 2.0;
`;var B9t=_(T(),1),sR=`const float czm_sceneMode3D = 3.0;
`;var H9t=_(T(),1),aR=`const float czm_sceneModeColumbusView = 1.0;
`;var K9t=_(T(),1),cR=`const float czm_sceneModeMorphing = 0.0;
`;var Q9t=_(T(),1),lR=`const float czm_solarRadius = 695500000.0;
`;var q9t=_(T(),1),dR=`const float czm_threePiOver2 = 4.71238898038469;
`;var eMt=_(T(),1),uR=`const float czm_twoPi = 6.283185307179586;
`;var nMt=_(T(),1),mR=`const float czm_webMercatorMaxLatitude = 1.4844222297453324;
`;var oMt=_(T(),1),fR=`struct czm_depthRangeStruct
{
float near;
float far;
};
`;var sMt=_(T(),1),hR=`struct czm_material
{
vec3 diffuse;
float specular;
float shininess;
vec3 normal;
vec3 emission;
float alpha;
};
`;var cMt=_(T(),1),pR=`struct czm_materialInput
{
float s;
vec2 st;
vec3 str;
vec3 normalEC;
mat3 tangentToEyeMatrix;
vec3 positionToEyeEC;
float height;
float slope;
float aspect;
float waterMask;
};
`;var dMt=_(T(),1),bR=`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;
#endif
};
`;var mMt=_(T(),1),yR=`struct czm_modelVertexOutput {
vec3 positionMC;
float pointSize;
};
`;var hMt=_(T(),1),gR=`struct czm_ray
{
vec3 origin;
vec3 direction;
};
`;var bMt=_(T(),1),xR=`struct czm_raySegment
{
float start;
float stop;
};
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
`;var gMt=_(T(),1),_R=`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 _Mt=_(T(),1),TR=`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 SMt=_(T(),1),SR=`float czm_alphaWeight(float a)
{
float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
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 VMt=_(T(),1),CR=`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);
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 ZMt=_(T(),1),VR=`vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
vec3 hsb = czm_RGBToHSB(rgb);
hsb.x += hsbShift.x;
hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0);
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);
return czm_HSBToRGB(hsb);
}
`;var GMt=_(T(),1),LR=`vec2 czm_approximateSphericalCoordinates(vec3 normal) {
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 XMt=_(T(),1),ZR=`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 WMt=_(T(),1),RR=`bool czm_backFacing()
{
return gl_FrontFacing == false;
}
`;var PMt=_(T(),1),GR=`float czm_branchFreeTernary(bool comparison, float a, float b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
`;var FMt=_(T(),1),ER=`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 MMt=_(T(),1),XR=`uniform vec4 shadowMap_cascadeDistances;
float czm_cascadeDistance(vec4 weights)
{
return dot(shadowMap_cascadeDistances, weights);
}
`;var kMt=_(T(),1),IR=`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 OMt=_(T(),1),WR=`uniform vec4 shadowMap_cascadeSplits[2];
vec4 czm_cascadeWeights(float depthEye)
{
vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
return near * far;
}
`;var BMt=_(T(),1),wR=`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) {
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 HMt=_(T(),1),PR=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
vec3 p = mix(position2D.xyz, position3D.xyz, time);
return vec4(p, 1.0);
}
`;var KMt=_(T(),1),vR=`vec4 czm_computeAtmosphereColor(
vec3 positionWC,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
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;
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
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));
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
return vec4(color, opacity);
}
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;
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
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));
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
return vec4(color, opacity);
}
`;var QMt=_(T(),1),FR=`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 qMt=_(T(),1),AR=`vec4 czm_computePosition();
`;var eNt=_(T(),1),MR=`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;
const int PRIMARY_STEPS_MAX = 16;
const int LIGHT_STEPS_MAX = 4;
rayleighColor = vec3(0.0);
mieColor = vec3(0.0);
opacity = 0.0;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
vec3 origin = vec3(0.0);
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
return;
}
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
float start_0 = primaryRayAtmosphereIntersect.start;
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
float x_o_a = start_0 - ATMOSPHERE_THICKNESS;
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);
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0);
float rayPositionLength = primaryRayAtmosphereIntersect.start;
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);
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
if (i >= PRIMARY_STEPS) {
break;
}
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
opticalDepth += sampleDensity;
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);
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
if (j >= LIGHT_STEPS) {
break;
}
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
lightPositionLength += lightStepLength;
}
vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
rayleighAccumulation += sampleDensity.x * attenuation;
mieAccumulation += sampleDensity.y * attenuation;
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
}
rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
mieColor = czm_atmosphereMieCoefficient * mieAccumulation;
opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
}
`;var nNt=_(T(),1),NR=`vec2 cordic(float angle)
{
vec2 vector = vec2(6.0725293500888267e-1, 0.0);
float sense = (angle < 0.0) ? -1.0 : 1.0;
mat2 rotation = mat2(1.0, sense, -sense, 1.0);
vector = rotation * vector;
angle -= sense * 7.8539816339744828e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
float factor = sense * 5.0e-1;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.6364760900080609e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.5e-1;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.4497866312686414e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.25e-1;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.2435499454676144e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 6.25e-2;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 6.2418809995957350e-2;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.125e-2;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.1239833430268277e-2;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.5625e-2;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.5623728620476831e-2;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 7.8125e-3;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 7.8123410601011111e-3;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.90625e-3;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.9062301319669718e-3;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.953125e-3;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.9531225164788188e-3;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 9.765625e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 9.7656218955931946e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 4.8828125e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.8828121119489829e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.44140625e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.4414062014936177e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.220703125e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.2207031189367021e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 6.103515625e-5;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 6.1035156174208773e-5;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.0517578125e-5;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.0517578115526096e-5;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.52587890625e-5;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.5258789061315762e-5;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 7.62939453125e-6;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 7.6293945311019700e-6;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.814697265625e-6;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.8146972656064961e-6;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.9073486328125e-6;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.9073486328101870e-6;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 9.5367431640625e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 9.5367431640596084e-7;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 4.76837158203125e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.7683715820308884e-7;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.384185791015625e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.3841857910155797e-7;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.1920928955078125e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
return vector;
}
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 oNt=_(T(),1),kR=`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 sNt=_(T(),1),UR=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
out float v_WindowZ;
#endif
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 cNt=_(T(),1),OR=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
{
vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));
vec3 tangentEC = normalize(czm_normal3D * tangentMC);
vec3 bitangentEC = normalize(cross(normalEC, tangentEC));
return mat3(
tangentEC.x,   tangentEC.y,   tangentEC.z,
bitangentEC.x, bitangentEC.y, bitangentEC.z,
normalEC.x,    normalEC.y,    normalEC.z);
}
`;var dNt=_(T(),1),DR=`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 mNt=_(T(),1),BR=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
{
return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
}
`;var hNt=_(T(),1),YR=`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 bNt=_(T(),1),HR=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
{
vec4 p = positionEC;
vec4 zEyeOffset = normalize(p) * eyeOffset.z;
p.xy += eyeOffset.xy + zEyeOffset.xy;
p.z += zEyeOffset.z;
return p;
}
`;var gNt=_(T(),1),zR=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
{
vec4 q = czm_projection * positionEC;
q.xyz /= q.w;
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;
return q;
}
`;var _Nt=_(T(),1),KR=`float czm_fastApproximateAtan(float x) {
return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
}
float czm_fastApproximateAtan(float x, float y) {
float t = abs(x);
float opposite = abs(y);
float adjacent = max(t, opposite);
opposite = min(t, opposite);
t = czm_fastApproximateAtan(opposite / adjacent);
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 SNt=_(T(),1),JR=`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);
}
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 VNt=_(T(),1),QR=`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 ZNt=_(T(),1),jR=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
{
return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
}
`;var GNt=_(T(),1),qR=`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 XNt=_(T(),1),$R=`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 WNt=_(T(),1),eG=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
{
return max(dot(lightDirectionEC, normalEC), 0.0);
}
`;var PNt=_(T(),1),tG=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
{
vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
return pow(specular, max(shininess, czm_epsilon2));
}
`;var FNt=_(T(),1),nG=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
{
float cosAngle = cos(angleInRadians);
float sinAngle = sin(angleInRadians);
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);
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));
return ((noise / 4.0) - 0.5) * 2.0;
}
`;var MNt=_(T(),1),iG=`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 kNt=_(T(),1),oG=`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 ONt=_(T(),1),rG=`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 BNt=_(T(),1),sG=`vec3 czm_inverseGamma(vec3 color) {
return pow(color, vec3(1.0 / czm_gamma));
}
`;var HNt=_(T(),1),aG=`bool czm_isEmpty(czm_raySegment interval)
{
return (interval.stop < 0.0);
}
`;var KNt=_(T(),1),cG=`bool czm_isFull(czm_raySegment interval)
{
return (interval.start == 0.0 && interval.stop == czm_infinity);
}
`;var QNt=_(T(),1),lG=`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 qNt=_(T(),1),dG=`vec3 czm_linearToSrgb(vec3 linearIn)
{
return pow(linearIn, vec3(1.0/2.2));
}
vec4 czm_linearToSrgb(vec4 linearIn)
{
vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
return vec4(srgbOut, linearIn.a);
}
`;var e5t=_(T(),1),uG=`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 n5t=_(T(),1),mG=`float czm_luminance(vec3 rgb)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
return dot(rgb, W);
}
`;var o5t=_(T(),1),fG=`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 s5t=_(T(),1),hG=`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;
}
float czm_metersPerPixel(vec4 positionEC)
{
return czm_metersPerPixel(positionEC, czm_pixelRatio);
}
`;var c5t=_(T(),1),pG=`vec4 czm_modelToWindowCoordinates(vec4 position)
{
vec4 q = czm_modelViewProjection * position;
q.xyz /= q.w;
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;
return q;
}
`;var d5t=_(T(),1),bG=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
{
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 m5t=_(T(),1),yG=`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 h5t=_(T(),1),gG=`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);
}
vec3 czm_octDecode(vec2 encoded)
{
return czm_octDecode(encoded, 255.0);
}
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));
}
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 b5t=_(T(),1),xG=`vec4 czm_packDepth(float depth)
{
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 g5t=_(T(),1),_G=`vec3 lambertianDiffuse(vec3 diffuseColor)
{
return diffuseColor / czm_pi;
}
vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
{
float versine = 1.0 - VdotH;
float versineSquared = versine * versine;
return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
}
#ifdef USE_ANISOTROPY
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);
}
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
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;
}
float GGX(float alphaRoughness, float NdotH)
{
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
return alphaRoughnessSquared / (czm_pi * f * f);
}
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;
}
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);
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;
vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
return (diffuseContribution + specularContribution) * NdotL;
}
`;var _5t=_(T(),1),TG=`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 S5t=_(T(),1),SG=`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);
}
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
if (czm_sceneMode == czm_sceneMode3D) {
diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
}
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
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 V5t=_(T(),1),CG=`float czm_planeDistance(vec4 plane, vec3 point) {
return (dot(plane.xyz, point) + plane.w);
}
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
return (dot(planeNormal, point) + planeDistance);
}
`;var Z5t=_(T(),1),VG=`vec3 czm_pointAlongRay(czm_ray ray, float time)
{
return ray.origin + (time * ray.direction);
}
`;var G5t=_(T(),1),LG=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
{
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)
{
if (qw >= 0.0)
{
return czm_emptyRaySegment;
}
else
{
float qw2 = qw * qw;
float difference = q2 - 1.0;
float w2 = dot(w, w);
float product = w2 * difference;
if (qw2 < product)
{
return czm_emptyRaySegment;
}
else if (qw2 > product)
{
float discriminant = qw * qw - product;
float temp = -qw + sqrt(discriminant);
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
{
float root = sqrt(difference / w2);
czm_raySegment i = czm_raySegment(root, root);
return i;
}
}
}
else if (q2 < 1.0)
{
float difference = q2 - 1.0;
float w2 = dot(w, w);
float product = w2 * difference;
float discriminant = qw * qw - product;
float temp = -qw + sqrt(discriminant);
czm_raySegment i = czm_raySegment(0.0, temp / w2);
return i;
}
else
{
if (qw < 0.0)
{
float w2 = dot(w, w);
czm_raySegment i = czm_raySegment(0.0, -qw / w2);
return i;
}
else
{
return czm_emptyRaySegment;
}
}
}
`;var X5t=_(T(),1),ZG=`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 W5t=_(T(),1),RG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var P5t=_(T(),1),GG=`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 F5t=_(T(),1),EG=`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 M5t=_(T(),1),XG=`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 k5t=_(T(),1),IG=`vec3 RGBtoHCV(vec3 rgb)
{
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 O5t=_(T(),1),WG=`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 B5t=_(T(),1),wG=`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 H5t=_(T(),1),PG=`vec3 czm_saturation(vec3 rgb, float adjustment)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
vec3 intensity = vec3(dot(rgb, W));
return mix(intensity, rgb, adjustment);
}
`;var K5t=_(T(),1),vG=`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 Q5t=_(T(),1),FG=`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 q5t=_(T(),1),AG=`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 ekt=_(T(),1),MG=`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 nkt=_(T(),1),NG=`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 okt=_(T(),1),kG=`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 skt=_(T(),1),UG=`vec4 czm_textureCube(samplerCube sampler, vec3 p) {
#if __VERSION__ == 300
return texture(sampler, p);
#else
return textureCube(sampler, p);
#endif
}
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 ckt=_(T(),1),OG=`vec4 czm_transformPlane(vec4 plane, mat4 transform) {
vec4 transformedPlane = transform * plane;
float normalMagnitude = length(transformedPlane.xyz);
return transformedPlane / normalMagnitude;
}
`;var dkt=_(T(),1),DG=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{
vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
if (length(highDifference) == 0.0) {
highDifference = vec3(0);
}
vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
return vec4(highDifference + lowDifference, 1.0);
}
`;var mkt=_(T(),1),BG=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
if (czm_sceneMode == czm_sceneMode3D) {
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);
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 hkt=_(T(),1),YG=`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 bkt=_(T(),1),HG=`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;
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 gkt=_(T(),1),zG=`float czm_unpackDepth(vec4 packedDepth)
{
return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
}
`;var _kt=_(T(),1),KG=`float czm_unpackFloat(vec4 packedFloat)
{
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 Skt=_(T(),1),JG=`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 Vkt=_(T(),1),QG=`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 Zkt=_(T(),1),jG=`#ifdef LOG_DEPTH
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
coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
#endif
return coords;
}
void czm_vertexLogDepth()
{
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
gl_Position = czm_updatePositionDepth(gl_Position);
#endif
}
void czm_vertexLogDepth(vec4 clipCoords)
{
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
czm_updatePositionDepth(clipCoords);
#endif
}
`;var Gkt=_(T(),1),qG=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
{
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);
q /= screenCoordinate.w;
if (!(czm_inverseProjection == mat4(0.0)))
{
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;
}
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)
{
#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;
return eyeCoordinate;
#else
vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
#endif
return eyeCoordinate;
}
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
{
vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
}
`;var Xkt=_(T(),1),$G=`#if !defined(LOG_DEPTH)
in float v_WindowZ;
#endif
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 Wkt=_(T(),1),eE=`#ifdef LOG_DEPTH
in float v_depthFromNearPlusOne;
#ifdef POLYGON_OFFSET
uniform vec2 u_polygonOffset;
#endif
#endif
void czm_writeLogDepth(float depth)
{
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
discard;
}
#ifdef POLYGON_OFFSET
float factor = u_polygonOffset[0];
float units = u_polygonOffset[1];
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
if (factor != 0.0) {
float x = dFdx(depth);
float y = dFdy(depth);
float m = sqrt(x * x + y * y);
depth += m * factor;
}
#endif
#endif
gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
#ifdef POLYGON_OFFSET
gl_FragDepth += czm_epsilon7 * units;
#endif
#endif
}
void czm_writeLogDepth() {
#ifdef LOG_DEPTH
czm_writeLogDepth(v_depthFromNearPlusOne);
#endif
}
`;var Pkt=_(T(),1),tE=`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 Fkt=_(T(),1),nE=`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 Sx={czm_degreesPerRadian:EZ,czm_depthRange:XZ,czm_epsilon1:IZ,czm_epsilon2:WZ,czm_epsilon3:wZ,czm_epsilon4:PZ,czm_epsilon5:vZ,czm_epsilon6:FZ,czm_epsilon7:AZ,czm_infinity:MZ,czm_oneOverPi:NZ,czm_oneOverTwoPi:kZ,czm_passCesium3DTile:UZ,czm_passCesium3DTileClassification:OZ,czm_passCesium3DTileClassificationIgnoreShow:DZ,czm_passClassification:BZ,czm_passCompute:YZ,czm_passEnvironment:HZ,czm_passGlobe:zZ,czm_passOpaque:KZ,czm_passOverlay:JZ,czm_passTerrainClassification:QZ,czm_passTranslucent:jZ,czm_passVoxels:qZ,czm_pi:$Z,czm_piOverFour:eR,czm_piOverSix:tR,czm_piOverThree:nR,czm_piOverTwo:iR,czm_radiansPerDegree:oR,czm_sceneMode2D:rR,czm_sceneMode3D:sR,czm_sceneModeColumbusView:aR,czm_sceneModeMorphing:cR,czm_solarRadius:lR,czm_threePiOver2:dR,czm_twoPi:uR,czm_webMercatorMaxLatitude:mR,czm_depthRangeStruct:fR,czm_material:hR,czm_materialInput:pR,czm_modelMaterial:bR,czm_modelVertexOutput:yR,czm_ray:gR,czm_raySegment:xR,czm_shadowParameters:_R,czm_acesTonemapping:TR,czm_alphaWeight:SR,czm_antialias:CR,czm_applyHSBShift:VR,czm_approximateSphericalCoordinates:LR,czm_approximateTanh:ZR,czm_backFacing:RR,czm_branchFreeTernary:GR,czm_cascadeColor:ER,czm_cascadeDistance:XR,czm_cascadeMatrix:IR,czm_cascadeWeights:WR,czm_clipPolygons:wR,czm_columbusViewMorph:PR,czm_computeAtmosphereColor:vR,czm_computeGroundAtmosphereScattering:FR,czm_computePosition:AR,czm_computeScattering:MR,czm_cosineAndSine:NR,czm_decompressTextureCoordinates:kR,czm_depthClamp:UR,czm_eastNorthUpToEyeCoordinates:OR,czm_ellipsoidContainsPoint:DR,czm_ellipsoidTextureCoordinates:BR,czm_equalsEpsilon:YR,czm_eyeOffset:HR,czm_eyeToWindowCoordinates:zR,czm_fastApproximateAtan:KR,czm_fog:JR,czm_gammaCorrect:QR,czm_geodeticSurfaceNormal:jR,czm_getDefaultMaterial:qR,czm_getDynamicAtmosphereLightDirection:$R,czm_getLambertDiffuse:eG,czm_getSpecular:tG,czm_getWaterNoise:nG,czm_HSBToRGB:iG,czm_HSLToRGB:oG,czm_hue:rG,czm_inverseGamma:sG,czm_isEmpty:aG,czm_isFull:cG,czm_latitudeToWebMercatorFraction:lG,czm_linearToSrgb:dG,czm_lineDistance:uG,czm_luminance:mG,czm_maximumComponent:fG,czm_metersPerPixel:hG,czm_modelToWindowCoordinates:pG,czm_multiplyWithColorBalance:bG,czm_nearFarScalar:yG,czm_octDecode:gG,czm_packDepth:xG,czm_pbrLighting:_G,czm_pbrNeutralTonemapping:TG,czm_phong:SG,czm_planeDistance:CG,czm_pointAlongRay:VG,czm_rayEllipsoidIntersectionInterval:LG,czm_raySphereIntersectionInterval:ZG,czm_readDepth:RG,czm_readNonPerspective:GG,czm_reverseLogDepth:EG,czm_RGBToHSB:XG,czm_RGBToHSL:IG,czm_RGBToXYZ:WG,czm_round:wG,czm_saturation:PG,czm_shadowDepthCompare:vG,czm_shadowVisibility:FG,czm_signNotZero:AG,czm_sphericalHarmonics:MG,czm_srgbToLinear:NG,czm_tangentToEyeSpaceMatrix:kG,czm_textureCube:UG,czm_transformPlane:OG,czm_translateRelativeToEye:DG,czm_translucentPhong:BG,czm_transpose:YG,czm_unpackClippingExtents:HG,czm_unpackDepth:zG,czm_unpackFloat:KG,czm_unpackUint:JG,czm_valueTransform:QG,czm_vertexLogDepth:jG,czm_windowToEyeCoordinates:qG,czm_writeDepthClamp:$G,czm_writeLogDepth:eE,czm_writeNonPerspective:tE,czm_XYZToRGB:nE};var hDt=_(T(),1);function EGe(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 iE=EGe;function bte(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 yte(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return c(i)||(t=bte(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function gte(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);c(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Ms._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=yte(i,Ms._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),gte(o,t)}}))}function XGe(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]);if(i.length!==0){let o=`A circular dependency was found in the following built-in functions/structs/constants: 
`;for(let r=0;r<i.length;++r)o=`${o+i[r].name}
`;throw new L(o)}}function IGe(e){let t=[],n=yte("main",e,t);gte(n,t),XGe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function xte(e,t,n){let i,o,r="",s=e.sources;if(c(s))for(i=0,o=s.length;i<o;++i)r+=`
#line 0
${s[i]}`;r=bte(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(g,x){if(c(a)&&a!==x)throw new L(`inconsistent versions found: ${a} and ${x}`);return a=x,`
`});let l=[];r=r.replace(/#extension.*\n/gm,function(g){return l.push(g),`
`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let d=e.pickColorQualifier;c(d)&&(r=Ms.createPickFragmentShaderSource(r,d));let u="",f=l.length;for(i=0;i<f;i++)u+=l[i];t&&(u+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
    precision highp float;
    precision highp int;
#else
    precision mediump float;
    precision mediump int;
    #define highp mediump
#endif

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

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

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

`),u+=y,u+=r,n.webgl2?u=`#version 300 es
${u}`:u=iE(u,t),u}function Ms(e){e=e??z.EMPTY_OBJECT;let t=e.pickColorQualifier;if(c(t)&&t!=="uniform"&&t!=="in")throw new L("options.pickColorQualifier must be 'uniform' or 'in'.");this.defines=c(e.defines)?e.defines.slice(0):[],this.sources=c(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=e.includeBuiltIns??!0}Ms.prototype.clone=function(){return new Ms({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Ms.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Ms.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}`};Ms.prototype.createCombinedVertexShader=function(e){return xte(this,!1,e)};Ms.prototype.createCombinedFragmentShader=function(e){return xte(this,!0,e)};Ms._czmBuiltinsAndUniforms={};for(let e in Sx)Sx.hasOwnProperty(e)&&(Ms._czmBuiltinsAndUniforms[e]=Sx[e]);for(let e in _p)if(_p.hasOwnProperty(e)){let t=_p[e];typeof t.getDeclaration=="function"&&(Ms._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Ms.createPickVertexShaderSource=function(e){return`${Ms.replaceMain(e,"czm_old_main")}
in vec4 pickColor; 
out vec4 czm_pickColor; 
void main() 
{ 
    czm_old_main(); 
    czm_pickColor = pickColor; 
}`};Ms.createPickFragmentShaderSource=function(e,t){let n=Ms.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 WGe(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 _te(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 Tte(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(_te(e,o))return o}}var wGe=["v_normalEC","v_normal"];Ms.findNormalVarying=function(e){return _te(e,"#ifdef HAS_NORMALS")?WGe(e,"HAS_NORMALS")?"v_normalEC":void 0:Tte(e,wGe)};var PGe=["v_positionEC"];Ms.findPositionVarying=function(e){return Tte(e,PGe)};var Be=Ms;function wm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(wm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});wm.prototype.replaceShaderProgram=function(e){return c(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function vGe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}wm.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Be({sources:[t]})),typeof n=="string"&&(n=new Be({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=c(i)?vGe(i):"",a=`${o}:${r}:${s}`,l;if(c(this._shaders[a]))l=this._shaders[a],delete this._shadersToRelease[a];else{let d=this._context,u=t.createCombinedVertexShader(d),f=n.createCombinedFragmentShader(d),p=new tn({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:f,attributeLocations:i});l={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=l,this._shaders[a]=l,++this._numberOfShaders}return++l.count,l.shaderProgram};wm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(c(r)){CY(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};wm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(c(o))return o.shaderProgram};wm.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 Be({sources:[r]})),typeof s=="string"&&(s=new Be({sources:[s]}));let l=this._context,d=r.createCombinedVertexShader(l),u=s.createCombinedFragmentShader(l),f=new tn({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:f,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),f._cachedShader=p,this._shaders[o]=p,f};function CY(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];CY(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}wm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];CY(this,n),--this._numberOfShaders}this._shadersToRelease={}};wm.prototype.releaseShaderProgram=function(e){if(c(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};wm.prototype.isDestroyed=function(){return!1};wm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return he(this)};var oE=wm;var YDt=_(T(),1);function Pm(e){e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new en}=e,{width:l,height:d}=e;c(n)&&(c(l)||(l=n.videoWidth??n.naturalWidth??n.width),c(d)||(d=n.videoHeight??n.naturalHeight??n.height));let u=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,f=ke.toInternalFormat(i,o,t),p=ke.isCompressedFormat(f);if(!c(l)||!c(d))throw new L("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(C.typeOf.number.greaterThan("width",l,0),l>mt.maximumTextureSize)throw new L(`Width must be less than or equal to the maximum texture size (${mt.maximumTextureSize}).  Check maximumTextureSize.`);if(C.typeOf.number.greaterThan("height",d,0),d>mt.maximumTextureSize)throw new L(`Height must be less than or equal to the maximum texture size (${mt.maximumTextureSize}).  Check maximumTextureSize.`);if(!ke.validate(i))throw new L("Invalid options.pixelFormat.");if(!p&&!Ue.validate(o))throw new L("Invalid options.pixelDatatype.");if(i===ke.DEPTH_COMPONENT&&o!==Ue.UNSIGNED_SHORT&&o!==Ue.UNSIGNED_INT)throw new L("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ke.DEPTH_STENCIL&&o!==Ue.UNSIGNED_INT_24_8)throw new L("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new L("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.  Check context.floatingPointTexture.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new L("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ke.isDepthFormat(i)){if(c(n))throw new L("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new L("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture.  Check context.depthTexture.")}if(p){if(!c(n)||!c(n.arrayBufferView))throw new L("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ke.isDXTFormat(f)&&!t.s3tc)throw new L("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ke.isPVRTCFormat(f)&&!t.pvrtc)throw new L("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ke.isASTCFormat(f)&&!t.astc)throw new L("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ke.isETC2Format(f)&&!t.etc)throw new L("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ke.isETC1Format(f)&&!t.etc1)throw new L("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ke.isBC7Format(f)&&!t.bc7)throw new L("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ke.compressedTextureSizeInBytes(f,l,d)!==n.arrayBufferView.byteLength)throw new L("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}let y=t._gl,h=p?ke.compressedTextureSizeInBytes(i,l,d):ke.textureSizeInBytes(i,o,l,d);this._id=e.id??Hn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y.TEXTURE_2D,this._texture=y.createTexture(),this._internalFormat=f,this._pixelFormat=i,this._pixelDatatype=o,this._width=l,this._height=d,this._dimensions=new D(l,d),this._hasMipmap=!1,this._sizeInBytes=h,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Lte(this,a),y.activeTexture(y.TEXTURE0),y.bindTexture(this._textureTarget,this._texture),c(n)?(s?y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.NONE):y.pixelStorei(y.UNPACK_COLORSPACE_CONVERSION_WEBGL,y.BROWSER_DEFAULT_WEBGL),c(n.arrayBufferView)?ke.isCompressedFormat(f)?FGe(this,n):Ste(this,n):c(n.framebuffer)?MGe(this,n):Cte(this,n),this._initialized=!0):Vte(this),y.bindTexture(this._textureTarget,null)}function FGe(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),c(t.mipLevels)){let l=s,d=a;for(let u=0;u<t.mipLevels.length;++u)l=s5(l),d=s5(d),i.compressedTexImage2D(o,u+1,r,l,d,0,t.mipLevels[u])}}function Ste(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:l,pixelDatatype:d,flipY:u}=e,f=ke.alignmentInBytes(l,d,s);i.pixelStorei(i.UNPACK_ALIGNMENT,f),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(u&&(p=ke.flipY(p,l,d,s,a)),i.texImage2D(o,0,r,s,a,0,l,Ue.toWebGLConstant(d,n),p),c(t.mipLevels)){let y=s,h=a;for(let g=0;g<t.mipLevels.length;++g)y=s5(y),h=s5(h),i.texImage2D(o,g+1,r,y,h,0,l,Ue.toWebGLConstant(d,n),t.mipLevels[g])}}function AGe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:l,pixelDatatype:d}=e,u=ke.alignmentInBytes(l,d,o);a.pixelStorei(a.UNPACK_ALIGNMENT,u),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=ke.flipY(t,l,d,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,l,Ue.toWebGLConstant(d,s),t)}function MGe(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 Cte(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,Ue.toWebGLConstant(e.pixelDatatype,n),t)}function NGe(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,Ue.toWebGLConstant(e.pixelDatatype,o),t)}function s5(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Vte(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ue.toWebGLConstant(e._pixelDatatype,t),null)}Pm.create=function(e){return new Pm(e)};Pm.fromFramebuffer=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context);let t=e.context,n=t._gl,{pixelFormat:i=ke.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:l}=e;if(!ke.validate(i))throw new L("Invalid pixelFormat.");if(ke.isDepthFormat(i)||ke.isCompressedFormat(i))throw new L("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(C.defined("options.context",t),C.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),C.typeOf.number.greaterThanOrEquals("framebufferYOffset",r,0),o+s>n.drawingBufferWidth)throw new L("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(r+a>n.drawingBufferHeight)throw new L("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new Pm({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:c(l)?l:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Pm.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Lte(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 Lte(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Jt.NEAREST_MIPMAP_NEAREST,Jt.NEAREST_MIPMAP_LINEAR,Jt.LINEAR_MIPMAP_NEAREST,Jt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ue.FLOAT&&!r.textureFloatLinear||a===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Jt.NEAREST_MIPMAP_NEAREST:Jt.NEAREST,i=di.NEAREST),r.webgl2&&ke.isDepthFormat(s)&&(n=Jt.NEAREST,i=di.NEAREST);let l=r._gl,d=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(d,e._texture),l.texParameteri(d,l.TEXTURE_MIN_FILTER,n),l.texParameteri(d,l.TEXTURE_MAG_FILTER,i),l.texParameteri(d,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(d,l.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&l.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(d,null)}Pm.prototype.copyFrom=function(e){C.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(C.defined("options.source",i),ke.isDepthFormat(this._pixelFormat))throw new L("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new L("Cannot call copyFrom with a compressed texture pixel format.");C.typeOf.number.greaterThanOrEquals("xOffset",t,0),C.typeOf.number.greaterThanOrEquals("yOffset",n,0),C.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),C.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:l,height:d}=i;c(i.videoWidth)&&c(i.videoHeight)?(l=i.videoWidth,d=i.videoHeight):c(i.naturalWidth)&&c(i.naturalHeight)&&(l=i.naturalWidth,d=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let u=!1;this._initialized||(t===0&&n===0&&l===this._width&&d===this._height?(c(i.arrayBufferView)?Ste(this,i):Cte(this,i),u=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Vte(this)),this._initialized=!0),u||(c(i.arrayBufferView)?AGe(this,i.arrayBufferView,t,n,l,d):NGe(this,i,t,n)),s.bindTexture(a,null)};Pm.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height,ke.isDepthFormat(this._pixelFormat))throw new L("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Ue.FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new L("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ke.isCompressedFormat(this._pixelFormat))throw new L("Cannot call copyFrom with a compressed texture pixel format.");C.typeOf.number.greaterThanOrEquals("xOffset",e,0),C.typeOf.number.greaterThanOrEquals("yOffset",t,0),C.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),C.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),C.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),C.typeOf.number.lessThanOrEquals("yOffset + height",t+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};Pm.prototype.generateMipmap=function(e){if(e=e??_u.DONT_CARE,ke.isDepthFormat(this._pixelFormat))throw new L("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new L("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!w.isPowerOfTwo(this._width))throw new L("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!w.isPowerOfTwo(this._height))throw new L("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!_u.validate(e))throw new L("hint is invalid.");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)};Pm.prototype.isDestroyed=function(){return!1};Pm.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),he(this)};var Pt=Pm;var JDt=_(T(),1);function Cx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Cx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Cx.prototype.getTexture=function(e){let t=this._textures[e];if(c(t))return delete this._texturesToRelease[e],++t.count,t.texture};Cx.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};Cx.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={}};Cx.prototype.isDestroyed=function(){return!1};Cx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return he(this)};var rE=Cx;var n3t=_(T(),1);var TBt=_(T(),1);var fBt=_(T(),1);var iBt=_(T(),1);function Tu(e){this.planes=e??[]}var sE=[new m,new m,new m];m.clone(m.UNIT_X,sE[0]);m.clone(m.UNIT_Y,sE[1]);m.clone(m.UNIT_Z,sE[2]);var D0=new m,kGe=new m,Zte=new cn(new m(1,0,0),0);Tu.fromBoundingSphere=function(e,t){if(!c(e))throw new L("boundingSphere is required.");c(t)||(t=new Tu);let n=sE.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 l=sE[a],d=i[s],u=i[s+1];c(d)||(d=i[s]=new ce),c(u)||(u=i[s+1]=new ce),m.multiplyByScalar(l,-r,D0),m.add(o,D0,D0),d.x=l.x,d.y=l.y,d.z=l.z,d.w=-m.dot(l,D0),m.multiplyByScalar(l,r,D0),m.add(o,D0,D0),u.x=-l.x,u.y=-l.y,u.z=-l.z,u.w=-m.dot(m.negate(l,kGe),D0),s+=2}return t};Tu.prototype.computeVisibility=function(e){if(!c(e))throw new L("boundingVolume is required.");let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(cn.fromCartesian4(t[i],Zte));if(r===zt.OUTSIDE)return zt.OUTSIDE;r===zt.INTERSECTING&&(n=!0)}return n?zt.INTERSECTING:zt.INSIDE};Tu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!c(e))throw new L("boundingVolume is required.");if(!c(t))throw new L("parentPlaneMask is required.");if(t===Tu.MASK_OUTSIDE||t===Tu.MASK_INSIDE)return t;let n=Tu.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))continue;let a=e.intersectPlane(cn.fromCartesian4(i[o],Zte));if(a===zt.OUTSIDE)return Tu.MASK_OUTSIDE;a===zt.INTERSECTING&&(n|=s)}return n};Tu.MASK_OUTSIDE=4294967295;Tu.MASK_INSIDE=0;Tu.MASK_INDETERMINATE=2147483647;var fs=Tu;function uh(e){e=e??z.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 fs,this._orthographicMatrix=new M}function Rte(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new L("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new L("right must be greater than left.");if(e.bottom>e.top)throw new L("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new L("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(uh.prototype,{projectionMatrix:{get:function(){return Rte(this),this._orthographicMatrix}}});var UGe=new m,OGe=new m,DGe=new m,VY=new m;uh.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new L("position is required.");if(!c(t))throw new L("direction is required.");if(!c(n))throw new L("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,d=this.far,u=m.cross(t,n,UGe);m.normalize(u,u);let f=OGe;m.multiplyByScalar(t,l,f),m.add(e,f,f);let p=DGe;m.multiplyByScalar(u,a,p),m.add(f,p,p);let y=i[0];return c(y)||(y=i[0]=new ce),y.x=u.x,y.y=u.y,y.z=u.z,y.w=-m.dot(u,p),m.multiplyByScalar(u,s,p),m.add(f,p,p),y=i[1],c(y)||(y=i[1]=new ce),y.x=-u.x,y.y=-u.y,y.z=-u.z,y.w=-m.dot(m.negate(u,VY),p),m.multiplyByScalar(n,r,p),m.add(f,p,p),y=i[2],c(y)||(y=i[2]=new ce),y.x=n.x,y.y=n.y,y.z=n.z,y.w=-m.dot(n,p),m.multiplyByScalar(n,o,p),m.add(f,p,p),y=i[3],c(y)||(y=i[3]=new ce),y.x=-n.x,y.y=-n.y,y.z=-n.z,y.w=-m.dot(m.negate(n,VY),p),y=i[4],c(y)||(y=i[4]=new ce),y.x=t.x,y.y=t.y,y.z=t.z,y.w=-m.dot(t,f),m.multiplyByScalar(t,d,p),m.add(e,p,p),y=i[5],c(y)||(y=i[5]=new ce),y.x=-t.x,y.y=-t.y,y.z=-t.z,y.w=-m.dot(m.negate(t,VY),p),this._cullingVolume};uh.prototype.getPixelDimensions=function(e,t,n,i,o){if(Rte(this),!c(e)||!c(t))throw new L("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new L("drawingBufferWidth must be greater than zero.");if(t<=0)throw new L("drawingBufferHeight must be greater than zero.");if(!c(n))throw new L("distance is required.");if(!c(i))throw new L("pixelRatio is required.");if(i<=0)throw new L("pixelRatio must be greater than zero.");if(!c(o))throw new L("A result object is required.");let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,l=i*s/t;return o.x=a,o.y=l,o};uh.prototype.clone=function(e){return c(e)||(e=new uh),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};uh.prototype.equals=function(e){return c(e)&&e instanceof uh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};uh.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof uh&&w.equalsEpsilon(this.right,e.right,t,n)&&w.equalsEpsilon(this.left,e.left,t,n)&&w.equalsEpsilon(this.top,e.top,t,n)&&w.equalsEpsilon(this.bottom,e.bottom,t,n)&&w.equalsEpsilon(this.near,e.near,t,n)&&w.equalsEpsilon(this.far,e.far,t,n)};var Oo=uh;function Zl(e){e=e??z.EMPTY_OBJECT,this._offCenterFrustum=new Oo,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}Zl.packedLength=4;Zl.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Zl.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new Zl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function B0(e){if(!c(e.width)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new L("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new L("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new L("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;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(Zl.prototype,{projectionMatrix:{get:function(){return B0(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return B0(this),this._offCenterFrustum}}});Zl.prototype.computeCullingVolume=function(e,t,n){return B0(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Zl.prototype.getPixelDimensions=function(e,t,n,i,o){return B0(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Zl.prototype.clone=function(e){return c(e)||(e=new Zl),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};Zl.prototype.equals=function(e){return!c(e)||!(e instanceof Zl)?!1:(B0(this),B0(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Zl.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof Zl)?!1:(B0(this),B0(e),w.equalsEpsilon(this.width,e.width,t,n)&&w.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var sn=Zl;var IBt=_(T(),1);var LY={};function BGe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var YGe=32.184,HGe=2451545;function zte(e,t){t=ee.addSeconds(e,YGe,t);let n=ee.totalDays(t)-HGe;return t=ee.addSeconds(t,BGe(n),t),t}var a5=new ee(2451545,0,zn.TAI),zGe=1e3,Su=w.RADIANS_PER_DEGREE,ud=w.RADIANS_PER_ARCSECOND,wa=14959787e4,Gte=new te;function Kte(e,t,n,i,o,r,s){if(n<0&&(n=-n,o+=w.PI),n<0||n>w.PI)throw new L("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");let a=e*(1-t),l=i-o,d=o,u=JGe(r-i,t);if(KGe(t,0)==="Hyperbolic"&&Math.abs(w.negativePiToPi(u))>=Math.acos(-1/t))throw new L("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");$Ge(l,n,d,Gte);let p=a*(1+t),y=Math.cos(u),h=Math.sin(u),g=1+t*y;if(g<=w.Epsilon10)throw new L("elements cannot be converted to cartesian");let x=p/g;return c(s)?(s.x=x*y,s.y=x*h,s.z=0):s=new m(x*y,x*h,0),te.multiplyByVector(Gte,s,s)}function KGe(e,t){if(e<0)throw new L("eccentricity cannot be negative.");return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function JGe(e,t){if(t<0||t>=1)throw new L("eccentricity out of range.");let n=jGe(e,t);return qGe(n,t)}var Ete=50,QGe=w.EPSILON8;function jGe(e,t){if(t<0||t>=1)throw new L("eccentricity out of range.");let n=Math.floor(e/w.TWO_PI);e-=n*w.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<Ete&&Math.abs(o-i)>QGe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}if(r>=Ete)throw new L("Kepler equation did not converge");return o=i+n*w.TWO_PI,o}function qGe(e,t){if(t<0||t>=1)throw new L("eccentricity out of range.");let n=Math.floor(e/w.TWO_PI);e-=n*w.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=w.zeroToTwoPi(r),e<0&&(r-=w.TWO_PI),r+=n*w.TWO_PI,r}function $Ge(e,t,n,i){if(t<0||t>w.PI)throw new L("inclination out of range");let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),l=Math.cos(n),d=Math.sin(n);return c(i)?(i[0]=l*o-d*r*s,i[1]=d*o+l*r*s,i[2]=r*a,i[3]=-l*r-d*o*s,i[4]=-d*r+l*o*s,i[5]=o*a,i[6]=d*a,i[7]=-l*a,i[8]=s):i=new te(l*o-d*r*s,-l*r-d*o*s,d*a,d*o+l*r*s,-d*r+l*o*s,-l*a,r*a,o*a,s),i}var eEe=1.0000010178*wa,tEe=100.46645683*Su,nEe=129597742283429e-5*ud,Xte=16002,Ite=21863,Wte=32004,wte=10931,Pte=14529,vte=16368,Fte=15318,Ate=32794,iEe=64*1e-7*wa,oEe=-152*1e-7*wa,rEe=62*1e-7*wa,sEe=-8*1e-7*wa,aEe=32*1e-7*wa,cEe=-41*1e-7*wa,lEe=19*1e-7*wa,dEe=-11*1e-7*wa,uEe=-150*1e-7*wa,mEe=-46*1e-7*wa,fEe=68*1e-7*wa,hEe=54*1e-7*wa,pEe=14*1e-7*wa,bEe=24*1e-7*wa,yEe=-28*1e-7*wa,gEe=22*1e-7*wa,Mte=10,Nte=16002,kte=21863,Ute=10931,Ote=1473,Dte=32004,Bte=4387,Yte=73,xEe=-325*1e-7,_Ee=-322*1e-7,TEe=-79*1e-7,SEe=232*1e-7,CEe=-52*1e-7,VEe=97*1e-7,LEe=55*1e-7,ZEe=-41*1e-7,REe=-105*1e-7,GEe=-137*1e-7,EEe=258*1e-7,XEe=35*1e-7,IEe=-116*1e-7,WEe=-88*1e-7,wEe=-112*1e-7,PEe=-80*1e-7,rC=new ee(0,0,zn.TAI);function vEe(e,t){zte(e,rC);let i=(rC.dayNumber-a5.dayNumber+(rC.secondsOfDay-a5.secondsOfDay)/Kn.SECONDS_PER_DAY)/(Kn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=eEe+iEe*Math.cos(Xte*o)+uEe*Math.sin(Xte*o)+oEe*Math.cos(Ite*o)+mEe*Math.sin(Ite*o)+rEe*Math.cos(Wte*o)+fEe*Math.sin(Wte*o)+sEe*Math.cos(wte*o)+hEe*Math.sin(wte*o)+aEe*Math.cos(Pte*o)+pEe*Math.sin(Pte*o)+cEe*Math.cos(vte*o)+bEe*Math.sin(vte*o)+lEe*Math.cos(Fte*o)+yEe*Math.sin(Fte*o)+dEe*Math.cos(Ate*o)+gEe*Math.sin(Ate*o),s=tEe+nEe*i+xEe*Math.cos(Mte*o)+REe*Math.sin(Mte*o)+_Ee*Math.cos(Nte*o)+GEe*Math.sin(Nte*o)+TEe*Math.cos(kte*o)+EEe*Math.sin(kte*o)+SEe*Math.cos(Ute*o)+XEe*Math.sin(Ute*o)+CEe*Math.cos(Ote*o)+IEe*Math.sin(Ote*o)+VEe*Math.cos(Dte*o)+WEe*Math.sin(Dte*o)+LEe*Math.cos(Bte*o)+wEe*Math.sin(Bte*o)+ZEe*Math.cos(Yte*o)+PEe*Math.sin(Yte*o),a=.0167086342-.0004203654*i,l=102.93734808*Su+11612.3529*ud*i,d=469.97289*ud*i,u=174.87317577*Su-8679.27034*ud*i;return Kte(r,a,d,l,u,s,t)}function Jte(e,t){zte(e,rC);let i=(rC.dayNumber-a5.dayNumber+(rC.secondsOfDay-a5.secondsOfDay)/Kn.SECONDS_PER_DAY)/Kn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,l=.055545526-16e-9*i,d=5.15668983*Su,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,f=83.35324312*Su,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,y=125.04455501*Su,h=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,g=218.31664563*Su,x=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,S=297.85019547*Su+ud*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*Su+ud*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),Z=134.96340251*Su+ud*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),R=357.52910918*Su+ud*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*Su-ud*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*S,v=4*S,P=6*S,F=2*Z,N=3*Z,b=4*Z,G=2*V;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-Z)-235.6*Math.cos(Z)+218.1*Math.cos(I-R)+181*Math.cos(I+Z),l+=.014216*Math.cos(I-Z)+.008551*Math.cos(I-F)-.001383*Math.cos(Z)+.001356*Math.cos(I+Z)-.001147*Math.cos(v-N)-914e-6*Math.cos(v-F)+869e-6*Math.cos(I-R-Z)-627e-6*Math.cos(I)-394e-6*Math.cos(v-b)+282e-6*Math.cos(I-R-F)-279e-6*Math.cos(S-Z)-236e-6*Math.cos(F)+231e-6*Math.cos(v)+229e-6*Math.cos(P-b)-201e-6*Math.cos(F-G),u+=486.26*Math.cos(I-G)-40.13*Math.cos(I)+37.51*Math.cos(G)+25.73*Math.cos(F-G)+19.97*Math.cos(I-R-G),p+=-55609*Math.sin(I-Z)-34711*Math.sin(I-F)-9792*Math.sin(Z)+9385*Math.sin(v-N)+7505*Math.sin(v-F)+5318*Math.sin(I+Z)+3484*Math.sin(v-b)-3417*Math.sin(I-R-Z)-2530*Math.sin(P-b)-2376*Math.sin(I)-2075*Math.sin(I-N)-1883*Math.sin(F)-1736*Math.sin(P-5*Z)+1626*Math.sin(R)-1370*Math.sin(P-N),h+=-5392*Math.sin(I-G)-540*Math.sin(R)-441*Math.sin(I)+423*Math.sin(G)-288*Math.sin(F-G),x+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-Z)-662.5*Math.sin(R)+396.3*Math.sin(Z)-218*Math.sin(I-R);let X=2*E,W=3*E;u+=46.997*Math.cos(E)*i-.614*Math.cos(I-G+E)*i+.614*Math.cos(I-G-E)*i-.0297*Math.cos(X)*o-.0335*Math.cos(E)*o+.0012*Math.cos(I-G+X)*o-16e-5*Math.cos(E)*r+4e-5*Math.cos(W)*r+4e-5*Math.cos(X)*r;let A=2.116*Math.sin(E)*i-.111*Math.sin(I-G-E)*i-.0015*Math.sin(E)*o;p+=A,x+=A,h+=-520.77*Math.sin(E)*i+13.66*Math.sin(I-G+E)*i+1.12*Math.sin(I-E)*i-1.06*Math.sin(G-E)*i+.66*Math.sin(X)*o+.371*Math.sin(E)*o-.035*Math.sin(I-G+X)*o-.015*Math.sin(I-G+E)*o+.0014*Math.sin(E)*r-.0011*Math.sin(W)*r-9e-4*Math.sin(X)*r,a*=zGe;let k=d+u*ud,B=f+p*ud,O=g+x*ud,H=y+h*ud;return Kte(a,l,k,B,H,O,t)}var Hte=.012300034,FEe=Hte/(Hte+1)*-1;function AEe(e,t){return t=Jte(e,t),m.multiplyByScalar(t,FEe,t)}var Qte=new te(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),aE=new m;LY.computeSunPositionInEarthInertialFrame=function(e,t){return c(e)||(e=ee.now()),c(t)||(t=new m),aE=vEe(e,aE),t=m.negate(aE,t),AEe(e,aE),m.subtract(t,aE,t),te.multiplyByVector(Qte,t,t),t};LY.computeMoonPositionInEarthInertialFrame=function(e,t){return c(e)||(e=ee.now()),t=Jte(e,t),te.multiplyByVector(Qte,t,t),t};var Y0=LY;var wBt=_(T(),1),c5={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};c5.getMorphTime=function(e){return e===c5.SCENE3D?1:e===c5.MORPHING?void 0:0};var se=Object.freeze(c5);var ABt=_(T(),1);function MEe(e){e=e??z.EMPTY_OBJECT,this.color=Y.clone(e.color??Y.WHITE),this.intensity=e.intensity??2}var Xp=MEe;function sC(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new je,this._viewportCartesian4=new ce,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 D,this._currentFrustum=new D,this._frustumPlanes=new ce,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=te.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 te,this._viewRotation=new te,this._inverseViewRotation=new te,this._viewRotation3D=new te,this._inverseViewRotation3D=new te,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 te,this._normal3DDirty=!0,this._normal3D=new te,this._inverseNormalDirty=!0,this._inverseNormal=new te,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new te,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Bn,this._cameraPosition=new m,this._sunPositionWC=new m,this._sunPositionColumbusView=new m,this._sunDirectionWC=new m,this._sunDirectionEC=new m,this._moonDirectionEC=new m,this._lightDirectionWC=new m,this._lightDirectionEC=new m,this._lightColor=new m,this._lightColorHdr=new m,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new m,this._cameraRight=new m,this._cameraUp=new m,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new D,this._eyeEllipsoidNormalEC=new m,this._eyeEllipsoidCurvature=new D,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new Y,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new m,this._atmosphereRayleighScaleHeight=new m,this._atmosphereMieCoefficient=new m,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(sC.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!je.equals(e,this._viewport)){je.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 qte(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return qte(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),te.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return RY(this),this._view3D}},viewRotation:{get:function(){return RY(this),this._viewRotation}},viewRotation3D:{get:function(){return RY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return tne(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return tne(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return JEe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return QEe(this),this._modelView}},modelView3D:{get:function(){return jEe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return iXe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return qEe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return $Ee(this),this._inverseModelView3D}},viewProjection:{get:function(){return eXe(this),this._viewProjection}},inverseViewProjection:{get:function(){return tXe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return nXe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return oXe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return rXe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return sXe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return aXe(this),this._normal}},normal3D:{get:function(){return cXe(this),this._normal3D}},inverseNormal:{get:function(){return lXe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return dXe(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 ene(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return ene(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??re.default}}});function NEe(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 kEe(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function UEe(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function OEe(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var jte=new m,DEe=new M;function BEe(e,t){m.clone(t.positionWC,e._cameraPosition),m.clone(t.directionWC,e._cameraDirection),m.clone(t.rightWC,e._cameraRight),m.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(c(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=m.fromRadians(o.longitude,o.latitude,0,n,jte)):(e._eyeHeight=-n.maximumRadius,m.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=m.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,jte)),e._encodedCameraPositionMCDirty=!0,!c(i))return;e._eyeEllipsoidNormalEC=te.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=wt.eastNorthUpToFixedFrame(i,n,DEe);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),w.equalsEpsilon(n._radii.x,n._radii.y,w.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var ZY=new te,YEe=new pe;function HEe(e,t){wt.computeIcrfToCentralBodyFixedMatrix(t.time,ZY);let n=Y0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);te.multiplyByVector(ZY,n,n),m.normalize(n,e._sunDirectionWC),n=te.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),m.normalize(n,n),n=Y0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),te.multiplyByVector(ZY,n,n),te.multiplyByVector(e.viewRotation3D,n,n),m.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,YEe);i.project(r,e._sunPositionColumbusView)}sC.prototype.updateCamera=function(e){NEe(this,e.viewMatrix),kEe(this,e.inverseViewMatrix),BEe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==se.SCENE2D&&e.frustum instanceof sn};sC.prototype.updateFrustum=function(e){UEe(this,e.projectionMatrix),c(e.infiniteProjectionMatrix)&&OEe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=w.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;c(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};sC.prototype.updatePass=function(e){this._pass=e};var zEe=[],KEe=new Xp;sC.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===se.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),HEe(this,e);let n=e.light??KEe;n instanceof Xp?(this._lightDirectionWC=m.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=m.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=m.normalize(m.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=te.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=m.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=m.multiplyByScalar(o,n.intensity,o);let r=m.maximumComponent(o);r>1?m.divideByScalar(o,r,this._lightColor):m.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=c(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??zEe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let l=e.atmosphere;c(l)&&(this._atmosphereHsbShift=m.fromElements(l.hueShift,l.saturationShift,l.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=l.lightIntensity,this._atmosphereRayleighCoefficient=m.clone(l.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=l.rayleighScaleHeight,this._atmosphereMieCoefficient=m.clone(l.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=l.mieScaleHeight,this._atmosphereMieAnisotropy=l.mieAnisotropy,this._atmosphereDynamicLighting=l.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=wt.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,f;c(d)?u.height>u.width?f=Math.tan(.5*d)*2/u.height:f=Math.tan(.5*d)*2/u.width:f=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=f*e.maximumScreenSpaceError,Y.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function qte(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 JEe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==se.SCENE2D&&e._mode!==se.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function QEe(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function jEe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function qEe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function $Ee(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function eXe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function tXe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function nXe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function iXe(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 oXe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function rXe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function sXe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function aXe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),te.transpose(t,t)}}function cXe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),te.transpose(t,t)}}function lXe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),te.transpose(t,t)}}function dXe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),te.transpose(t,t)}}var $te=new m;function ene(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,$te),Bn.fromCartesian($te,e._encodedCameraPositionMC))}var uXe=new m,mXe=new m,fXe=new m,hXe=new m,pXe=new pe,bXe=new m,yXe=new M;function gXe(e,t,n,i,o,r,s,a){let l=uXe;l.x=e.y,l.y=e.z,l.z=e.x;let d=mXe;d.x=n.y,d.y=n.z,d.z=n.x;let u=fXe;u.x=i.y,u.y=i.z,u.z=i.x;let f=hXe;f.x=t.y,f.y=t.z,f.z=t.x,r===se.SCENE2D&&(l.z=o*.5);let p=s.unproject(l,pXe);p.longitude=w.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=w.clamp(p.latitude,-w.PI_OVER_TWO,w.PI_OVER_TWO);let y=s.ellipsoid,h=y.cartographicToCartesian(p,bXe),g=wt.eastNorthUpToFixedFrame(h,y,yXe);return M.multiplyByPointAsVector(g,d,d),M.multiplyByPointAsVector(g,u,u),M.multiplyByPointAsVector(g,f,f),c(a)||(a=new M),a[0]=d.x,a[1]=u.x,a[2]=-f.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-f.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-f.z,a[11]=0,a[12]=-m.dot(d,h),a[13]=-m.dot(u,h),a[14]=m.dot(f,h),a[15]=1,a}function RY(e){e._view3DDirty&&(e._mode===se.SCENE3D?M.clone(e._view,e._view3D):gXe(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 tne(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var cE=sC;function Cu(e,t){C.defined("canvas",e);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=c(n)?n(e,o):xXe(e,o,i),l=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=l,this._id=Hn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new oE(this),this._textureCache=new rE;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),mt._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),mt._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),mt._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),mt._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),mt._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),mt._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),mt._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),mt._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),mt._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),mt._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),mt._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);mt._minimumAliasedLineWidth=u[0],mt._maximumAliasedLineWidth=u[1];let f=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);mt._minimumAliasedPointSize=f[0],mt._maximumAliasedPointSize=f[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);mt._maximumViewportWidth=p[0],mt._maximumViewportHeight=p[1];let y=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);mt._highpFloatSupported=y.precision!==0;let h=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);mt._highpIntSupported=h.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!Cr(d,["OES_standard_derivatives"]),this._blendMinmax=!!Cr(d,["EXT_blend_minmax"]),this._elementIndexUint=!!Cr(d,["OES_element_index_uint"]),this._depthTexture=!!Cr(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Cr(d,["EXT_frag_depth"]),this._debugShaders=Cr(d,["WEBGL_debug_shaders"]),this._textureFloat=!!Cr(d,["OES_texture_float"]),this._textureHalfFloat=!!Cr(d,["OES_texture_half_float"]),this._textureFloatLinear=!!Cr(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Cr(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Cr(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Cr(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Cr(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Cr(d,["EXT_color_buffer_half_float"]),this._s3tc=!!Cr(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Cr(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Cr(d,["WEBGL_compressed_texture_astc"]),this._etc=!!Cr(d,["WEBG_compressed_texture_etc"]),this._etc1=!!Cr(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Cr(d,["EXT_texture_compression_bptc"]),Ll.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let g=r?Cr(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=g,mt._maximumTextureFilterAnisotropy=c(g)?d.getParameter(g.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let x,S,V,Z,R,E,I,v,P,F;if(l){let X=this;x=function(){return X._gl.createVertexArray()},S=function(W){X._gl.bindVertexArray(W)},V=function(W){X._gl.deleteVertexArray(W)},Z=function(W,A,k,B,O){d.drawElementsInstanced(W,A,k,B,O)},R=function(W,A,k,B){d.drawArraysInstanced(W,A,k,B)},E=function(W,A){d.vertexAttribDivisor(W,A)},I=function(W){d.drawBuffers(W)}}else v=Cr(d,["OES_vertex_array_object"]),c(v)&&(x=function(){return v.createVertexArrayOES()},S=function(X){v.bindVertexArrayOES(X)},V=function(X){v.deleteVertexArrayOES(X)}),P=Cr(d,["ANGLE_instanced_arrays"]),c(P)&&(Z=function(X,W,A,k,B){P.drawElementsInstancedANGLE(X,W,A,k,B)},R=function(X,W,A,k){P.drawArraysInstancedANGLE(X,W,A,k)},E=function(X,W){P.vertexAttribDivisorANGLE(X,W)}),F=Cr(d,["WEBGL_draw_buffers"]),c(F)&&(I=function(X){F.drawBuffersWEBGL(X)});this.glCreateVertexArray=x,this.glBindVertexArray=S,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=Z,this.glDrawArraysInstanced=R,this.glVertexAttribDivisor=E,this.glDrawBuffers=I,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!F,mt._maximumDrawBuffers=this.drawBuffers?d.getParameter(oe.MAX_DRAW_BUFFERS):1,mt._maximumColorAttachments=this.drawBuffers?d.getParameter(oe.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new Y(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let N=new cE,b=new sc(this),G=Oe.fromCache();this._defaultPassState=b,this._defaultRenderState=G,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=N,this._currentRenderState=G,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let X=0;X<mt._maximumVertexAttributes;X++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Oe.apply(d,G,b)}function xXe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new le("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(!c(r))throw new le("The browser supports WebGL, but initialization failed.");return r}function _Xe(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 TXe(e,t,n,i){let o=`${_Xe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function SXe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new le(TXe(e,t,n,i))}function CXe(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 VXe(e,t){if(!c(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,CXe(e,o,t))}return i}function Cr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var LXe={};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=VXe(this._originalGLContext,e?SXe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Pt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,0])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Pt({context:this,pixelFormat:ke.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 Pt({context:this,pixelFormat:ke.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 Uo({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 LXe}}});function ZXe(e){if(e.validateFramebuffer){let t=e._gl,n=t.checkFramebufferStatus(t.FRAMEBUFFER);if(n!==t.FRAMEBUFFER_COMPLETE){let i;switch(n){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="Framebuffer is not complete.  Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached.  Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:i="Framebuffer is not complete.  Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete.  Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete.  Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.";break}throw new L(i)}}}function nne(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Oe.partialApply(e._gl,o,t,r,n,i)}var GY;typeof WebGLRenderingContext<"u"&&(GY=[oe.BACK]);function EY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=GY;if(c(t))t._bind(),ZXe(e),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var RXe=new ti;Cu.prototype.clear=function(e,t){e=e??RXe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;c(o)&&(Y.equals(this._clearColor,o)||(Y.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),c(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),c(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;nne(this,a,t,!0);let l=e.framebuffer??t.framebuffer;EY(this,l),n.clear(i)};function GXe(e,t,n,i,o){if(c(t)&&o.depthTest&&o.depthTest.enabled&&!t.hasDepthAttachment)throw new L("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");EY(e,t),nne(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function EXe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,l=t.instanceCount;if(!ve.validate(o))throw new L("drawCommand.primitiveType is required and must be valid.");if(C.defined("drawCommand.vertexArray",r),C.typeOf.number.greaterThanOrEquals("drawCommand.offset",s,0),c(a)&&C.typeOf.number.greaterThanOrEquals("drawCommand.count",a,0),C.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new L("Instanced arrays extension is not supported");e._us.model=t._modelMatrix??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;c(d)?(s=s*d.bytesPerIndex,c(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,l===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,l)):(c(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,l===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,l)),r._unBind()}Cu.prototype.draw=function(e,t,n,i){C.defined("drawCommand",e),C.defined("drawCommand.shaderProgram",e._shaderProgram),t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,GXe(this,o,t,n,r),EXe(this,e,n,i)};Cu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=GY;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.readPixels=function(e){let t=this._gl;e=e??z.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??t.drawingBufferWidth,r=e.height??t.drawingBufferHeight,s=e.framebuffer;C.typeOf.number.greaterThan("readState.width",o,0),C.typeOf.number.greaterThan("readState.height",r,0);let a=Ue.UNSIGNED_BYTE;c(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let l=ke.createTypedArray(ke.RGBA,a,o,r);return EY(this,s),t.readPixels(n,i,o,r,ke.RGBA,Ue.toWebGLConstant(a,this),l),l};var ine={position:0,textureCoordinates:1};Cu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!c(e)){let t=new dt({attributes:{position:new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:ve.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:ine,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Cu.prototype.createViewportQuadCommand=function(e,t){return t=t??z.EMPTY_OBJECT,new et({vertexArray:this.getViewportQuadVertexArray(),primitiveType:ve.TRIANGLES,renderState:t.renderState,shaderProgram:tn.fromCache({context:this,vertexShaderSource:fx,fragmentShaderSource:e,attributeLocations:ine}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Cu.prototype.getObjectByPickColor=function(e){return C.defined("pickColor",e),this._pickObjects[e.toRgba()]};function XY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(XY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});XY.prototype.destroy=function(){delete this._pickObjects[this.key]};Cu.prototype.createPickId=function(e){C.defined("object",e),++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new le("Out of unique Pick IDs.");return this._pickObjects[t]=e,new XY(this._pickObjects,t,Y.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];c(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(),he(this)};var lE=Cu;var hYt=_(T(),1);var D3t=_(T(),1);function aC(e){e=e??z.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:l}=e;if(C.defined("options.context",t),C.defined("options.width",n),C.defined("options.height",i),this._width=n,this._height=i,c(o)!==c(r))throw new L("Both color renderbuffer and texture attachments must be provided.");if(c(s)!==c(a))throw new L("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Fr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:l}),this._colorFramebuffer=new Fr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:l})}aC.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};aC.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};aC.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),c(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)};aC.prototype.isDestroyed=function(){return!1};aC.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),he(this)};var dE=aC;var tYt=_(T(),1);var H3t=_(T(),1);var Rl={RGBA4:oe.RGBA4,RGBA8:oe.RGBA8,RGBA16F:oe.RGBA16F,RGBA32F:oe.RGBA32F,RGB5_A1:oe.RGB5_A1,RGB565:oe.RGB565,DEPTH_COMPONENT16:oe.DEPTH_COMPONENT16,STENCIL_INDEX8:oe.STENCIL_INDEX8,DEPTH_STENCIL:oe.DEPTH_STENCIL,DEPTH24_STENCIL8:oe.DEPTH24_STENCIL8,validate:function(e){return e===Rl.RGBA4||e===Rl.RGBA8||e===Rl.RGBA16F||e===Rl.RGBA32F||e===Rl.RGB5_A1||e===Rl.RGB565||e===Rl.DEPTH_COMPONENT16||e===Rl.STENCIL_INDEX8||e===Rl.DEPTH_STENCIL||e===Rl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===oe.FLOAT?Rl.RGBA32F:e===oe.HALF_FLOAT_OES?Rl.RGBA16F:Rl.RGBA8}},ac=Object.freeze(Rl);function uE(e){e=e??z.EMPTY_OBJECT,C.defined("options.context",e.context);let n=e.context._gl,i=mt.maximumRenderbufferSize,o=e.format??ac.RGBA4,r=c(e.width)?e.width:n.drawingBufferWidth,s=c(e.height)?e.height:n.drawingBufferHeight,a=e.numSamples??1;if(!ac.validate(o))throw new L("Invalid format.");if(C.typeOf.number.greaterThan("width",r,0),r>i)throw new L(`Width must be less than or equal to the maximum renderbuffer size (${i}).  Check maximumRenderbufferSize.`);if(C.typeOf.number.greaterThan("height",s,0),s>i)throw new L(`Height must be less than or equal to the maximum renderbuffer size (${i}).  Check maximumRenderbufferSize.`);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(uE.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});uE.prototype._getRenderbuffer=function(){return this._renderbuffer};uE.prototype.isDestroyed=function(){return!1};uE.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),he(this)};var md=uE;function Ss(e){if(e=e??z.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._color&&!this._depth&&!this._depthStencil)throw new L("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new L("Cannot have both a depth and depth-stencil attachment.");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(Ss.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}}});Ss.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=c(i)&&this._pixelDatatype!==i||c(o)&&this._pixelFormat!==o,l=n===1?c(this._framebuffer):c(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!l||this._color&&!c(this._colorTextures[0])};Ss.prototype.update=function(e,t,n,i,o,r){if(!c(t)||!c(n))throw new L("width and height must be defined.");if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??ke.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 Pt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:en.NEAREST}),this._numSamples>1){let a=ac.getColorFormat(o);this._colorRenderbuffers[s]=new md({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Pt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:en.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new md({context:e,width:t,height:n,format:ac.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new md({context:e,width:t,height:n,format:ac.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Pt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:en.NEAREST}):this._depthRenderbuffer=new md({context:e,width:t,height:n,format:ac.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new dE({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 Fr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ss.prototype.getColorTexture=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");return this._colorTextures[e]};Ss.prototype.setColorTexture=function(e,t){if(t=t??0,this._createColorAttachments)throw new L("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ss.prototype.getColorRenderbuffer=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]};Ss.prototype.setColorRenderbuffer=function(e,t){if(t=t??0,this._createColorAttachments)throw new L("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new L("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ss.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ss.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ss.prototype.getDepthTexture=function(){return this._depthTexture};Ss.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ss.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ss.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ss.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ss.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new L("createDepthAttachments must be false if setDepthStencilTexture is called.");this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ss.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ss.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ss.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ss.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&&c(i)&&!i.isDestroyed()&&i.destroy(),c(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&c(o)&&!o.isDestroyed()&&o.destroy(),c(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()),c(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),c(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()),c(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),c(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var hi=Ss;var TYt=_(T(),1);function XXe(e,t,n){if(C.defined("context",e),C.defined("urls",t),Object.values(Uo.FaceName).some(r=>!c(t[r])))throw new L("urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ge.createIfNeeded(t.positiveX).fetchImage(i),Ge.createIfNeeded(t.negativeX).fetchImage(i),Ge.createIfNeeded(t.positiveY).fetchImage(i),Ge.createIfNeeded(t.negativeY).fetchImage(i),Ge.createIfNeeded(t.positiveZ).fetchImage(i),Ge.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Uo({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var mE=XXe;var kYt=_(T(),1);var VYt=_(T(),1);var Vx={VERTEX:0,FRAGMENT:1,BOTH:2};Vx.includesVertexShader=function(e){return C.typeOf.number("destination",e),e===Vx.VERTEX||e===Vx.BOTH};Vx.includesFragmentShader=function(e){return C.typeOf.number("destination",e),e===Vx.FRAGMENT||e===Vx.BOTH};var xe=Object.freeze(Vx);var ZYt=_(T(),1);function IY(e){this.name=e,this.fields=[]}IY.prototype.addField=function(e,t){let n=`    ${e} ${t};`;this.fields.push(n)};IY.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=["    float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var fE=IY;var EYt=_(T(),1);function WY(e){this.signature=e,this.body=[]}WY.prototype.addLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new L(`Expected lines to be a string or an array of strings, actual value was ${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}`)};WY.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var hE=WY;function Mc(){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(Mc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Mc.prototype.addDefine=function(e,t,n){C.typeOf.string("identifier",e),n=n??xe.BOTH;let i=e;c(t)&&(i+=` ${t.toString()}`),xe.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),xe.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Mc.prototype.addStruct=function(e,t,n){C.typeOf.string("structId",e),C.typeOf.string("structName",t),C.typeOf.number("destination",n),this._structs[e]=new fE(t),xe.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),xe.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Mc.prototype.addStructField=function(e,t,n){C.typeOf.string("structId",e),C.typeOf.string("type",t),C.typeOf.string("identifier",n),this._structs[e].addField(t,n)};Mc.prototype.addFunction=function(e,t,n){C.typeOf.string("functionName",e),C.typeOf.string("signature",t),C.typeOf.number("destination",n),this._functions[e]=new hE(t),xe.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),xe.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Mc.prototype.addFunctionLines=function(e,t){if(C.typeOf.string("functionName",e),typeof t!="string"&&!Array.isArray(t))throw new L(`Expected lines to be a string or an array of strings, actual value was ${t}`);this._functions[e].addLines(t)};Mc.prototype.addUniform=function(e,t,n){C.typeOf.string("type",e),C.typeOf.string("identifier",t),n=n??xe.BOTH;let i=`uniform ${e} ${t};`;xe.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),xe.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Mc.prototype.setPositionAttribute=function(e,t){if(C.typeOf.string("type",e),C.typeOf.string("identifier",t),c(this._positionAttributeLine))throw new L("setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()");return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Mc.prototype.addAttribute=function(e,t){C.typeOf.string("type",e),C.typeOf.string("identifier",t);let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=WXe(e),i};Mc.prototype.addVarying=function(e,t,n){C.typeOf.string("type",e),C.typeOf.string("identifier",t),n=c(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Mc.prototype.addVertexLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new L(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Mc.prototype.addFragmentLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new L(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Mc.prototype.buildShaderProgram=function(e){C.typeOf.object("context",e);let t=c(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=IXe(this),i=wXe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new Be({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),a=new Be({defines:this._fragmentShaderParts.defineLines,sources:[s]});return tn.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Mc.prototype.clone=function(){return He(this,!0)};function IXe(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(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function WXe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function wXe(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(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var Lx=Mc;var aHt=_(T(),1);var YYt=_(T(),1);function pE({x:e,y:t,width:n,height:i}){this.rectangle=new je(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function wY({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new pE({x:n,y:n,width:e-2*n,height:t-2*n})}wY.prototype.pack=function(e,{width:t,height:n}){C.typeOf.number.greaterThanOrEquals("index",e,0),C.typeOf.number.greaterThanOrEquals("image.width",t,1),C.typeOf.number.greaterThanOrEquals("image.height",n,1);let i=this._findNode(this._root,{width:t,height:n});if(c(i))return i.index=e,i};wY.prototype._findNode=function(e,{width:t,height:n}){if(c(e)){if(!c(e.childNode1)&&!c(e.childNode2)){if(c(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,s=o-t,a=r-n;return s<0||a<0?void 0:s===0&&a===0?e:s>a?(e.childNode1=new pE({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new pE({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new pE({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new pE({x:i.x,y:i.y+n,width:o,height:a}),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 cC=wY;var one=16;function Gl(e){e=e??z.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new D(one,one);C.typeOf.number.greaterThanOrEquals("options.borderWidthInPixels",t,0),C.typeOf.number.greaterThan("options.initialSize.x",n.x,0),C.typeOf.number.greaterThan("options.initialSize.y",n.y,0),this._pixelFormat=e.pixelFormat??ke.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Hn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Gl.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 c(this._texture)?this._texture.sizeInBytes:0}}});Gl.prototype.computeTextureCoordinates=function(e,t){C.typeOf.number.greaterThanOrEquals("index",e,0);let n=this._texture,i=this._rectangles[e];if(c(t)||(t=new je),!c(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,l=i.x,d=i.y,u=this._subRegions.get(e);if(c(u)){let f=this._rectangles[u];l+=f.x,d+=f.y}return t.x=l/o,t.y=d/r,t.width=s/o,t.height=a/r,t};Gl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Pt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,l=s._textureTarget,d=this._texture,u=new Fr({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(l,s._texture),u._bind();let f=this.rectangles,p=this._subRegions;for(let y=0;y<f.length;++y){let h=i[y],g=f[y];if(!c(h)||!c(g)||c(p.get(y)))continue;let{x,y:S,width:V,height:Z}=h;a.copyTexSubImage2D(l,0,x,S,g.x,g.y,V,Z)}return a.bindTexture(l,null),s._initialized=!0,u._unBind(),u.destroy(),s};Gl.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,l=this._subRegions,d=i.map((V,Z)=>new rne({index:Z,image:V})).filter((V,Z)=>c(V.image)&&!c(l.get(Z))),u=0,f=0,p=0;for(let V=t;V<o.length;++V){let{width:Z,height:R}=o[V].image;u=Math.max(u,Z),f=Math.max(f,R),p+=Z*R,d.push(o[V])}s=Math.max(u,s),a=Math.max(f,a),e.webgl2||(s=w.nextPowerOfTwo(s),a=w.nextPowerOfTwo(a));let y=p,h=1;for(;y/s/a>=1;)h*=2,s>a?a*=h:s*=h;d.sort(({image:V},{image:Z})=>Z.height*Z.width-V.height*V.width);let g=new Array(this._nextIndex);for(let V of this._subRegions.keys())c(l.get(V))&&(g[V]=i[V]);let x,S=!1;for(;!S;){x=new cC({height:a,width:s,borderPadding:n});let V;for(V=0;V<d.length;++V){let{index:Z,image:R}=d[V];if(!c(R))continue;let E=x.pack(Z,R);if(!c(E)){s>a?a*=2:s*=2;break}g[Z]=E.rectangle}S=V===d.length}this._texturePacker=x,this._texture=this._copyFromTexture(e,s,a,g),r.destroy(),this._rectangles=g,this._guid=Hn()};Gl.prototype.getImageIndex=function(e){return C.typeOf.string("id",e),this._indexById.get(e)};Gl.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}),c(n)&&n(e)}catch(s){if(c(i)){i(s);return}}};function rne({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Gl.prototype._addImage=function(e,t){return C.typeOf.number.greaterThanOrEquals("index",e,0),C.defined("image",t),new Promise((n,i)=>{this._imagesToAddQueue.push(new rne({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};Gl.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(!c(a)){try{this._resize(e,n)}catch(l){i=l,c(o.reject)&&o.reject(i)}break}this._rectangles[s]=a.rectangle}if(c(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];c(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};Gl.prototype.update=function(e){if(!c(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new Pt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new cC({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function PXe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof Ge)&&(e=Ge.createIfNeeded(e).fetchImage()),e}Gl.prototype.addImage=function(e,t){C.typeOf.string("id",e),C.defined("image",t);let n=this._indexPromiseById.get(e);if(c(n))return n;let i=this._nextIndex++;return this._indexById.set(e,i),n=(async()=>(t=await PXe(t,e),C.defined("image",t),this.isDestroyed()||!c(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};Gl.prototype.addImageSubRegion=function(e,t){C.typeOf.string("id",e),C.defined("subRegion",t);let n=this._indexById.get(e);if(!c(n))throw new le(`image with id "${e}" not found in the atlas.`);let i=this._indexPromiseById.get(e);for(let[r,s]of this._subRegions.entries())if(n===s&&this._rectangles[r].equals(t))return i.then(l=>l===-1?-1:r);let o=this._nextIndex++;return this._subRegions.set(o,n),this._rectangles[o]=t.clone(),i.then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return C.typeOf.number.lessThanOrEquals("subRegion.x",t.x,s.width),C.typeOf.number.lessThanOrEquals("subRegion.x + subRegion.width",t.x+t.width,s.width),C.typeOf.number.lessThanOrEquals("subRegion.y",t.y,s.height),C.typeOf.number.lessThanOrEquals("subRegion.y + subRegion.height",t.y+t.height,s.height),o})};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{c(e)&&e(-1)}),he(this)};var Zx=Gl;var gHt=_(T(),1);function Ns(e,t,n,i){if(C.defined("context",e),!t||t.length===0)throw new L("At least one attribute is required.");let o=Ns._verifyAttributes(t);n=n??0;let r=[],s={},a,l,d=o.length;for(let f=0;f<d;++f){let p=o[f];if(p.vertexBuffer){r.push(p);continue}l=p.usage,a=s[l],c(a)||(a=s[l]=[]),a.push(p)}function u(f,p){return q.getSizeInBytes(p.componentDatatype)-q.getSizeInBytes(f.componentDatatype)}this._allBuffers=[];for(l in s)if(s.hasOwnProperty(l)){a=s[l],a.sort(u);let f=Ns._vertexSizeInBytes(a),p=a[0].usage,y={vertexSizeInBytes:f,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ns._createArrayViews(a,f)};this._allBuffers.push(y)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ns._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??Ne.STATIC_DRAW};if(t.push(r),r.componentsPerAttribute!==1&&r.componentsPerAttribute!==2&&r.componentsPerAttribute!==3&&r.componentsPerAttribute!==4)throw new L("attribute.componentsPerAttribute must be in the range [1, 4].");let s=r.componentDatatype;if(!q.validate(s))throw new L("Attribute must have a valid componentDatatype or not specify it.");if(!Ne.validate(r.usage))throw new L("Attribute must have a valid usage or not specify it.")}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;if(n[r])throw new L(`Index ${r} is used by more than one attribute.`);n[r]=!0}return t};Ns._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};Ns._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};Ns.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];Ns._resize(o,this._size),Ns._appendWriters(this.writers,o)}PY(this)};Ns._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(c(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let l=0;l<a;++l)r[l]=s[l]}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 vXe=[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 l=i*n;t[l]=o,t[l+1]=r,t[l+2]=s,t[l+3]=a,e.needsCommit=!0}}];Ns._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]=vXe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ns.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=FXe(this,i)||t;if(t||!c(this.va)){PY(this);let s=this.va=[],a=w.SIXTY_FOUR_KILOBYTES-4,l=c(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let d=0;d<l;++d){let u=[];for(o=0,r=n.length;o<r;++o){i=n[o];let f=d*(i.vertexSizeInBytes*a);Ns._appendAttributes(u,i,f,this._instanced)}u=u.concat(this._precreated),s.push({va:new ni({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==l-1?a:this._size%a)})}}};function FXe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=c(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=_t.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ns._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})}};Ns.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new L("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new L("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)AXe(n[i],e,t)};function AXe(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)}}Ns.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function PY(e){let t=e.va;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ns.prototype.isDestroyed=function(){return!1};Ns.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 PY(this),he(this)};var Ip=Ns;var wHt=_(T(),1);var ZHt=_(T(),1);var SHt=_(T(),1);function H0(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new ye,this.setValue(e)}Object.defineProperties(H0.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});H0.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};H0.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=c(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))}};H0.prototype.equals=function(e){return this===e||e instanceof H0&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};H0.prototype.valueOf=function(){return this._value};H0.prototype.toString=function(){return String(this._value)};var Qn=H0;function MXe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];c(a)&&(a(),this[n]=void 0),r!==void 0&&(!c(r)||!c(r.getValue))&&c(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),c(r)&&c(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function NXe(e){return new Qn(e)}function kXe(e,t,n){return MXe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??NXe)}var fe=kXe;function bE(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(bE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),image:fe("image"),scale:fe("scale"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),color:fe("color"),rotation:fe("rotation"),alignedAxis:fe("alignedAxis"),sizeInMeters:fe("sizeInMeters"),width:fe("width"),height:fe("height"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),imageSubRegion:fe("imageSubRegion"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});bE.prototype.clone=function(e){return c(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 bE(this)};bE.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 cc=bE;var Czt=_(T(),1);var AHt=_(T(),1);function Rx(){this._array=[],this._hash={}}Object.defineProperties(Rx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});Rx.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new L("key is required to be a string or number.");return c(this._hash[e])};Rx.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new L("key is required to be a string or number.");let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};Rx.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new L("key is required to be a string or number.");return this._hash[e]};Rx.prototype.remove=function(e){if(c(e)&&typeof e!="string"&&typeof e!="number")throw new L("key is required to be a string or number.");let t=this._hash[e],n=c(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};Rx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Zt=Rx;var UHt=_(T(),1);function fd(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(fd.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}}});fd.packedLength=2;fd.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,t[n++]=e.near,t[n]=e.far,t};fd.unpack=function(e,t,n){if(!c(e))throw new L("array is required");return t=t??0,c(n)||(n=new fd),n.near=e[t++],n.far=e[t],n};fd.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.far===t.far};fd.clone=function(e,t){if(c(e))return c(t)||(t=new fd),t.near=e.near,t.far=e.far,t};fd.prototype.clone=function(e){return fd.clone(this,e)};fd.prototype.equals=function(e){return fd.equals(this,e)};var vt=fd;var YHt=_(T(),1);function Vu(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Vu.clone=function(e,t){if(c(e))return c(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Vu(e.near,e.nearValue,e.far,e.farValue)};Vu.packedLength=4;Vu.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Vu.unpack=function(e,t,n){if(!c(e))throw new L("array is required");return t=t??0,c(n)||(n=new Vu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Vu.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Vu.prototype.clone=function(e){return Vu.clone(this,e)};Vu.prototype.equals=function(e){return Vu.equals(this,e)};var Nt=Vu;var zHt=_(T(),1),Gx={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,CLIP_TO_GROUND:7},ze=Object.freeze(Gx);function Lu(e){return e===Gx.CLAMP_TO_GROUND||e===Gx.CLAMP_TO_3D_TILE||e===Gx.CLAMP_TO_TERRAIN}function lC(e){return e===Gx.RELATIVE_TO_GROUND||e===Gx.RELATIVE_TO_3D_TILE||e===Gx.RELATIVE_TO_TERRAIN}var JHt=_(T(),1),UXe={CENTER:0,LEFT:1,RIGHT:-1},xi=Object.freeze(UXe);var jHt=_(T(),1),OXe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Mn=Object.freeze(OXe);var $Ht=_(T(),1),DXe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),ut=DXe;var izt=_(T(),1);function vm(){L.throwInstantiationError()}Object.defineProperties(vm.prototype,{isConstant:{get:L.throwInstantiationError},definitionChanged:{get:L.throwInstantiationError}});vm.prototype.getValue=L.throwInstantiationError;vm.prototype.equals=L.throwInstantiationError;vm.equals=function(e,t){return e===t||c(e)&&e.equals(t)};vm.arrayEquals=function(e,t){if(e===t)return!0;if(!c(e)||!c(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!vm.equals(e[i],t[i]))return!1;return!0};vm.isConstant=function(e){return!c(e)||e.isConstant};vm.getValueOrUndefined=function(e,t,n){return c(e)?e.getValue(t,n):void 0};vm.getValueOrDefault=function(e,t,n,i){return c(e)?e.getValue(t,i)??n:n};vm.getValueOrClonedDefault=function(e,t,n,i){let o;return c(e)&&(o=e.getValue(t,i)),c(o)||(o=n.clone(o)),o};var J=vm;var rzt=_(T(),1),BXe={LEFT:-1,NONE:0,RIGHT:1},Ar=Object.freeze(BXe);var YXe=Y.WHITE,HXe=m.ZERO,zXe=ze.NONE,KXe=D.ZERO,JXe=1,QXe=0,jXe=m.ZERO,qXe=xi.CENTER,$Xe=Mn.CENTER,eIe=!1,tIe=Ar.NONE,nIe=new m,iIe=new Y,oIe=new m,rIe=new D,sIe=new Nt,aIe=new Nt,cIe=new Nt,lIe=new je,dIe=new vt;function sne(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function z0(e,t){if(!c(e))throw new L("entityCluster is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(z0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}z0.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l,d=r.billboard,u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),f;if(u&&(f=J.getValueOrUndefined(s._position,e,nIe),l=J.getValueOrUndefined(a._image,e),u=c(f)&&c(l)),!u){vY(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0),c(d)||(d=n.getBillboard(s),d.id=s,r.billboard=d,r.textureValue=void 0),d.show=u,r.textureValue!==l&&(d.image=l,r.textureValue=l),d.position=f,d.color=J.getValueOrDefault(a._color,e,YXe,iIe),d.eyeOffset=J.getValueOrDefault(a._eyeOffset,e,HXe,oIe),d.heightReference=J.getValueOrDefault(a._heightReference,e,zXe),d.pixelOffset=J.getValueOrDefault(a._pixelOffset,e,KXe,rIe),d.scale=J.getValueOrDefault(a._scale,e,JXe),d.rotation=J.getValueOrDefault(a._rotation,e,QXe),d.alignedAxis=J.getValueOrDefault(a._alignedAxis,e,jXe),d.horizontalOrigin=J.getValueOrDefault(a._horizontalOrigin,e,qXe),d.verticalOrigin=J.getValueOrDefault(a._verticalOrigin,e,$Xe),d.width=J.getValueOrUndefined(a._width,e),d.height=J.getValueOrUndefined(a._height,e),d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,sIe),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,aIe),d.pixelOffsetScaleByDistance=J.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,cIe),d.sizeInMeters=J.getValueOrDefault(a._sizeInMeters,e,eIe),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,dIe),d.disableDepthTestDistance=J.getValueOrUndefined(a._disableDepthTestDistance,e),d.splitDirection=J.getValueOrDefault(a._splitDirection,e,tIe);let p=J.getValueOrUndefined(a._imageSubRegion,e,lIe);c(p)&&d.setImageSubRegion(d.image,p)}return!0};z0.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.billboard))return ut.FAILED;let i=n.billboard;if(i.heightReference===ze.NONE)t.center=m.clone(i.position,t.center);else{if(!c(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};z0.prototype.isDestroyed=function(){return!1};z0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(z0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return he(this)};z0.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],c(r._billboard)&&c(r._position)&&s.set(r.id,new sne(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._billboard)&&c(r._position)?s.contains(r.id)||s.set(r.id,new sne(r)):(vY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],vY(s.get(r.id),r,a),s.remove(r.id)};function vY(e,t,n){c(e)&&(e.billboard=void 0,n.removeBillboard(t))}var yE=z0;var $rn=_(T(),1);var Azt=_(T(),1);var uIe=new m;function mh(e){e=e??z.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(C.typeOf.object("min",t),C.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=m.clone(t),this._max=m.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}mh.fromDimensions=function(e){e=e??z.EMPTY_OBJECT;let t=e.dimensions;C.typeOf.object("dimensions",t),C.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),C.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),C.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=m.multiplyByScalar(t,.5,new m);return new mh({minimum:m.negate(n,new m),maximum:n,offsetAttribute:e.offsetAttribute})};mh.fromAxisAlignedBoundingBox=function(e){return C.typeOf.object("boundindBox",e),new mh({minimum:e.minimum,maximum:e.maximum})};mh.packedLength=2*m.packedLength+1;mh.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,m.pack(e._min,t,n),m.pack(e._max,t,n+m.packedLength),t[n+m.packedLength*2]=e._offsetAttribute??-1,t};var cne=new m,lne=new m,ane={minimum:cne,maximum:lne,offsetAttribute:void 0};mh.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=m.unpack(e,t,cne),o=m.unpack(e,t+m.packedLength,lne),r=e[t+m.packedLength*2];return c(n)?(n._min=m.clone(i,n._min),n._max=m.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(ane.offsetAttribute=r===-1?void 0:r,new mh(ane))};mh.createGeometry=function(e){let t=e._min,n=e._max;if(m.equals(t,n))return;let i=new fn,o=new Uint16Array(12*2),r=new Float64Array(8*3);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 Ee({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=m.subtract(n,t,uIe),a=m.magnitude(s)*.5;if(c(e._offsetAttribute)){let l=r.length,d=e._offsetAttribute===$t.NONE?0:1,u=new Uint8Array(l/3).fill(d);i.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new dt({attributes:i,indices:o,primitiveType:ve.LINES,boundingSphere:new ue(m.ZERO,a),offsetAttribute:e._offsetAttribute})};var Fm=mh;var Dzt=_(T(),1);function dC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([Y.floatToByte(e),Y.floatToByte(t),Y.floatToByte(n),Y.floatToByte(i)])}Object.defineProperties(dC.prototype,{componentDatatype:{get:function(){return q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});dC.fromColor=function(e){if(!c(e))throw new L("color is required.");return new dC(e.red,e.green,e.blue,e.alpha)};dC.toValue=function(e,t){if(!c(e))throw new L("color is required.");return c(t)?e.toBytes(t):new Uint8Array(e.toBytes())};dC.equals=function(e,t){return e===t||c(e)&&c(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 Yt=dC;var Kzt=_(T(),1);function gE(e,t){if(e=e??0,t=t??Number.MAX_VALUE,t<=e)throw new L("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(gE.prototype,{componentDatatype:{get:function(){return q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});gE.fromDistanceDisplayCondition=function(e){if(!c(e))throw new L("distanceDisplayCondition is required.");if(e.far<=e.near)throw new L("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new gE(e.near,e.far)};gE.toValue=function(e,t){if(!c(e))throw new L("distanceDisplayCondition is required.");return c(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=gE;var eKt=_(T(),1);function mIe(e){if(e=e??z.EMPTY_OBJECT,!c(e.geometry))throw new L("options.geometry is required.");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=mIe;var uKt=_(T(),1);var aKt=_(T(),1);function jo(e){e=e??z.EMPTY_OBJECT,this.start=c(e.start)?ee.clone(e.start):new ee,this.stop=c(e.stop)?ee.clone(e.stop):new ee,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(jo.prototype,{isEmpty:{get:function(){let e=ee.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var uC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};jo.fromIso8601=function(e,t){C.typeOf.object("options",e),C.typeOf.string("options.iso8601",e.iso8601);let n=e.iso8601.split("/");if(n.length!==2)throw new L("options.iso8601 is an invalid ISO 8601 interval.");let i=ee.fromIso8601(n[0]),o=ee.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return c(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(uC.start=i,uC.stop=o,uC.isStartIncluded=r,uC.isStopIncluded=s,uC.data=a,new jo(uC))};jo.toIso8601=function(e,t){return C.typeOf.object("timeInterval",e),`${ee.toIso8601(e.start,t)}/${ee.toIso8601(e.stop,t)}`};jo.clone=function(e,t){if(c(e))return c(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new jo(e)};jo.equals=function(e,t,n){return e===t||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equals(e.start,t.start)&&ee.equals(e.stop,t.stop)&&(e.data===t.data||c(n)&&n(e.data,t.data)))};jo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&ee.equalsEpsilon(e.start,t.start,n)&&ee.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||c(i)&&i(e.data,t.data)))};jo.intersect=function(e,t,n,i){if(C.typeOf.object("left",e),!c(t))return jo.clone(jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,l=ee.greaterThanOrEquals(s,o)&&ee.greaterThanOrEquals(r,s),d=!l&&ee.lessThanOrEquals(s,o)&&ee.lessThanOrEquals(o,a);if(!l&&!d)return jo.clone(jo.EMPTY,n);let u=e.isStartIncluded,f=e.isStopIncluded,p=t.isStartIncluded,y=t.isStopIncluded,h=ee.lessThan(r,a);return c(n)||(n=new jo),n.start=l?s:o,n.isStartIncluded=u&&p||!ee.equals(s,o)&&(l&&p||d&&u),n.stop=h?r:a,n.isStopIncluded=h?f:f&&y||!ee.equals(a,r)&&y,n.data=c(i)?i(e.data,t.data):e.data,n};jo.contains=function(e,t){if(C.typeOf.object("timeInterval",e),C.typeOf.object("julianDate",t),e.isEmpty)return!1;let n=ee.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=ee.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};jo.prototype.clone=function(e){return jo.clone(this,e)};jo.prototype.equals=function(e,t){return jo.equals(this,e,t)};jo.prototype.equalsEpsilon=function(e,t,n){return jo.equalsEpsilon(this,e,t,n)};jo.prototype.toString=function(){return jo.toIso8601(this)};jo.EMPTY=Object.freeze(new jo({start:new ee,stop:new ee,isStartIncluded:!1,isStopIncluded:!1}));var Zn=jo;var dne=Object.freeze(ee.fromIso8601("0000-01-01T00:00:00Z")),une=Object.freeze(ee.fromIso8601("9999-12-31T24:00:00Z")),fIe=Object.freeze(new Zn({start:dne,stop:une})),hIe={MINIMUM_VALUE:dne,MAXIMUM_VALUE:une,MAXIMUM_INTERVAL:fIe},Ye=hIe;var bKt=_(T(),1);function xE(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(xE.prototype,{componentDatatype:{get:function(){return q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});xE.fromCartesian3=function(e){return C.defined("offset",e),new xE(e.x,e.y,e.z)};xE.toValue=function(e,t){return C.defined("offset",e),c(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var $i=xE;var TKt=_(T(),1);function l5(e){e=e??!0,this.value=l5.toValue(e)}Object.defineProperties(l5.prototype,{componentDatatype:{get:function(){return q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});l5.toValue=function(e,t){if(!c(e))throw new L("show is required.");return c(t)?(t[0]=e,t):new Uint8Array([e])};var Tn=l5;var AQt=_(T(),1);var CKt=_(T(),1),_E=`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 LKt=_(T(),1),TE=`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;
v_normalEC = czm_normal * normal;
v_tangentEC = czm_normal * tangent;
v_bitangentEC = czm_normal * bitangent;
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var RKt=_(T(),1),SE=`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 EKt=_(T(),1),CE=`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;
v_normalEC = czm_normal * normal;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var IKt=_(T(),1),VE=`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 wKt=_(T(),1),LE=`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;
v_normalEC = czm_normal * normal;
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var eJt=_(T(),1);var DKt=_(T(),1);var FKt=_(T(),1);var pIe={ADD:oe.FUNC_ADD,SUBTRACT:oe.FUNC_SUBTRACT,REVERSE_SUBTRACT:oe.FUNC_REVERSE_SUBTRACT,MIN:oe.MIN,MAX:oe.MAX},Pa=Object.freeze(pIe);var NKt=_(T(),1);var bIe={ZERO:oe.ZERO,ONE:oe.ONE,SOURCE_COLOR:oe.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:oe.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:oe.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:oe.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:oe.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:oe.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:oe.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:oe.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:oe.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:oe.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:oe.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:oe.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:oe.SRC_ALPHA_SATURATE},Co=Object.freeze(bIe);var yIe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE,functionDestinationAlpha:Co.ONE})},un=Object.freeze(yIe);var HKt=_(T(),1);var gIe={FRONT:oe.FRONT,BACK:oe.BACK,FRONT_AND_BACK:oe.FRONT_AND_BACK},_i=Object.freeze(gIe);function mC(e){e=e??z.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(mC.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}}});mC.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),c(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
`)};mC.prototype.isTranslucent=function(){return c(this.material)&&this.material.isTranslucent()||!c(this.material)&&this.translucent};mC.prototype.getRenderState=function(){let e=this.isTranslucent(),t=He(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};mC.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:_i.BACK}),c(n)&&(i=St(n,i,!0)),i};var no=mC;var VQt=_(T(),1);var nJt=_(T(),1),ZE=`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 oJt=_(T(),1),RE=`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 sJt=_(T(),1),GE=`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;
float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);
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 cJt=_(T(),1),EE=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));
vec4 color = mix(lightColor, darkColor, b);
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var dJt=_(T(),1),XE=`uniform sampler2D heights;
uniform sampler2D colors;
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);
if (height < minHeight || height > maxHeight) {
material.diffuse = vec3(0.0);
material.alpha = 0.0;
return material;
}
int idxBelow = 0;
int idxAbove = heightsDimensions.x;
float heightBelow = minHeight;
float heightAbove = maxHeight;
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);
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 mJt=_(T(),1),IE=`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
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 hJt=_(T(),1),WE=`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 bJt=_(T(),1),wE=`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 gJt=_(T(),1),PE=`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;
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
const float fuzz = 1.2;
vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
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
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
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 _Jt=_(T(),1),vE=`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 SJt=_(T(),1),FE=`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
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);
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 VJt=_(T(),1),AE=`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;
float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
float maskIndex = floor(dashPosition * maskLength);
float maskTest = floor(dashPattern / pow(2.0, maskIndex));
vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
if (fragColor.a < 0.005) {
discard;
}
fragColor = czm_gammaCorrect(fragColor);
material.emission = fragColor.rgb;
material.alpha = fragColor.a;
return material;
}
`;var ZJt=_(T(),1),ME=`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 GJt=_(T(),1),NE=`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);
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 XJt=_(T(),1),kE=`uniform vec4 color;
uniform vec4 rimColor;
uniform float width;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
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 WJt=_(T(),1),UE=`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 PJt=_(T(),1),OE=`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);
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 FJt=_(T(),1),DE=`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 MJt=_(T(),1),BE=`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;
float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
float specularMapValue = texture(specularMap, materialInput.st).r;
vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
normalTangentSpace.xy /= fade;
normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
normalTangentSpace = normalize(normalTangentSpace);
float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
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??Jt.LINEAR,this._magnificationFilter=e.magnificationFilter??di.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,xIe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),c(Je._uniformList[this.type])||(Je._uniformList[this.type]=Object.keys(this._uniforms))}Je._uniformList={};Je.fromType=function(e,t){if(!c(Je._materialCache.getMaterial(e)))throw new L(`material with type '${e}' does not exist.`);let n=new Je({fabric:{type:e}});if(c(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Je.prototype.isTranslucent=function(){if(c(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 l=i[t];n=l.id;let d=l.image,u;Array.isArray(d)&&(u=d.slice(1,d.length).map(function(g){return g.bufferView}),d=d[0]);let f=new en({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;c(d.internalFormat)?p=new Pt({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:f}):p=new Pt({context:e,source:d,sampler:f});let y=this._textures[n];c(y)&&y!==this._defaultTexture&&y.destroy(),this._textures[n]=p;let h=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(h)){let g=this.uniforms[h];g.x=p._width,g.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let l=r[t];n=l.id;let d=l.images,u=new Uo({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new en({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let l in a)a.hasOwnProperty(l)&&a[l].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 he(this)};function xIe(e,t){e=e??z.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=He(e.fabric??z.EMPTY_OBJECT),t._template.uniforms=He(t._template.uniforms??z.EMPTY_OBJECT),t._template.materials=He(t._template.materials??z.EMPTY_OBJECT),t.type=c(t._template.type)?t._template.type:Hn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Je._materialCache.getMaterial(t.type);if(c(i)){let r=He(i.fabric,!0);t._template=St(t._template,r,!0),n=i.translucent}CIe(t),c(i)||Je._materialCache.addMaterial(t.type,t),LIe(t),EIe(t),IIe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=e.translucent??n,c(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function FY(e,t,n,i){if(c(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function mne(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){let o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new L(n)}function _Ie(e,t){let n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new L(n)}var TIe=["type","materials","uniforms","components","source"],SIe=["diffuse","specular","shininess","normal","emission","alpha"];function CIe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(c(o)&&c(t.source))throw new L("fabric: cannot have source and components in the same template.");FY(t,TIe,mne,!0),FY(o,SIe,mne,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);FY(n,r,_Ie,!1)}function VIe(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 LIe(e){let t=e._template.components,n=e._template.source;if(c(n))e.shaderSource+=`${n}
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
{
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
`,c(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&&VIe(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 fne={mat2:Ii,mat3:te,mat4:M},ZIe=/\.ktx2$/i;function RIe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!c(r)||r===Je.DefaultImageId;t=r;let l=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&c(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!c(l)||l===i.defaultTexture){let p=new en({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Pt({context:i,source:r,sampler:p}),n._textures[e]=l;return}l.copyFrom({source:r})}else c(l)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Pt&&r!==l){n._texturePaths[e]=void 0;let p=n._textures[e];c(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&c(l)&&a&&(l!==n._defaultTexture&&l.destroy(),l=void 0),c(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=l._width,u.y=l._height)),a)return;let f=r instanceof Ge;if(!c(n._texturePaths[e])||f&&r.url!==n._texturePaths[e].url||!f&&r!==n._texturePaths[e]){if(typeof r=="string"||f){let p=f?r:Ge.createIfNeeded(r),y;ZIe.test(p.url)?y=Ll(p.url):y=p.fetchImage(),Promise.resolve(y).then(function(h){n._loadedImages.push({id:e,image:h})}).catch(function(){c(l)&&l!==n._defaultTexture&&l.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function GIe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Uo){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(c(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Je.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ge.createIfNeeded(i.positiveX).fetchImage(),Ge.createIfNeeded(i.negativeX).fetchImage(),Ge.createIfNeeded(i.positiveY).fetchImage(),Ge.createIfNeeded(i.negativeY).fetchImage(),Ge.createIfNeeded(i.positiveZ).fetchImage(),Ge.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function EIe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&hne(e,n)}function hne(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=XIe(o);if(!c(r))throw new L(`fabric: uniform '${t}' has invalid type.`);let s;if(r==="channels"){if(s=YE(e,t,o,!1),s===0&&n)throw new L(`strict: shader source does not use channels '${t}'.`)}else{if(r==="sampler2D"){let d=`${t}Dimensions`;WIe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},hne(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let l=`${t}_${e._count++}`;if(s=YE(e,t,l),s===1&&n)throw new L(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,r==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(RIe(t));else if(r==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(GIe(t));else if(r.indexOf("mat")!==-1){let d=new fne[r];e._uniforms[l]=function(){return fne[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function XIe(e){let t=e.type;if(!c(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ge||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([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 IIe(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++}`;YE(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`;if(YE(e,i,a)===0&&t)throw new L(`strict: shader source does not use material '${i}'.`)}}function YE(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(l,d,u){return d||u?l:(o+=1,n)}),o}function WIe(e,t,n){return YE(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 Y(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 D(1,1),color:new Y(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 D(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 D(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 D(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 D(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 D(1,1)},source:RE},translucent:!1});Je.NormalMapType="NormalMap";Je._materialCache.addMaterial(Je.NormalMapType,{fabric:{type:Je.NormalMapType,uniforms:{image:Je.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:vE},translucent:!1});Je.GridType="Grid";Je._materialCache.addMaterial(Je.GridType,{fabric:{type:Je.GridType,uniforms:{color:new Y(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:PE},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 Y(1,1,1,.5),oddColor:new Y(0,0,1,.5),offset:0,repeat:5},source:OE},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 Y(1,1,1,.5),darkColor:new Y(0,0,0,.5),repeat:new D(5,5)},source:GE},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 Y(1,1,0,.75),darkColor:new Y(0,1,1,.75),repeat:new D(5,5)},source:EE},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 Y(.2,.3,.6,1),blendColor:new Y(0,1,.699,1),specularMap:Je.DefaultImageId,normalMap:Je.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:BE},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 Y(1,0,0,.7),rimColor:new Y(1,1,1,.4),width:.3},source:kE},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 Y(1,0,0,1),fadeOutColor:new Y(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:wE},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 Y(1,1,1,1)},source:FE},translucent:!0});Je.PolylineDashType="PolylineDash";Je._materialCache.addMaterial(Je.PolylineDashType,{fabric:{type:Je.PolylineDashType,uniforms:{color:new Y(1,0,1,1),gapColor:new Y(0,0,0,0),dashLength:16,dashPattern:255},source:AE},translucent:!0});Je.PolylineGlowType="PolylineGlow";Je._materialCache.addMaterial(Je.PolylineGlowType,{fabric:{type:Je.PolylineGlowType,uniforms:{color:new Y(0,.5,1,1),glowPower:.25,taperPower:1},source:ME},translucent:!0});Je.PolylineOutlineType="PolylineOutline";Je._materialCache.addMaterial(Je.PolylineOutlineType,{fabric:{type:Je.PolylineOutlineType,uniforms:{color:new Y(1,1,1,1),outlineColor:new Y(1,0,0,1),outlineWidth:1},source:NE},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 Y(1,0,0,1),width:1},source:IE},translucent:!1});Je.ElevationRampType="ElevationRamp";Je._materialCache.addMaterial(Je.ElevationRampType,{fabric:{type:Je.ElevationRampType,uniforms:{image:Je.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:WE},translucent:!1});Je.SlopeRampMaterialType="SlopeRamp";Je._materialCache.addMaterial(Je.SlopeRampMaterialType,{fabric:{type:Je.SlopeRampMaterialType,uniforms:{image:Je.DefaultImageId},source:UE},translucent:!1});Je.AspectRampMaterialType="AspectRamp";Je._materialCache.addMaterial(Je.AspectRampMaterialType,{fabric:{type:Je.AspectRampMaterialType,uniforms:{image:Je.DefaultImageId},source:ZE},translucent:!1});Je.ElevationBandType="ElevationBand";Je._materialCache.addMaterial(Je.ElevationBandType,{fabric:{type:Je.ElevationBandType,uniforms:{heights:Je.DefaultImageId,colors:Je.DefaultImageId},source:XE},translucent:!0});Je.WaterMaskType="WaterMask";Je._materialCache.addMaterial(Je.WaterMaskType,{fabric:{type:Je.WaterMaskType,source:DE,uniforms:{waterColor:new Y(1,1,1,1),landColor:new Y(0,0,0,0)}},translucent:!1});var zi=Je;function Ex(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Ex.MaterialSupport.TEXTURED;this.material=c(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=no.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(Ex.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}}});Ex.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Ex.prototype.isTranslucent=no.prototype.isTranslucent;Ex.prototype.getRenderState=no.prototype.getRenderState;Ex.MaterialSupport={BASIC:Object.freeze({vertexFormat:We.POSITION_AND_NORMAL,vertexShaderSource:CE,fragmentShaderSource:SE}),TEXTURED:Object.freeze({vertexFormat:We.POSITION_NORMAL_AND_ST,vertexShaderSource:LE,fragmentShaderSource:VE}),ALL:Object.freeze({vertexFormat:We.ALL,vertexShaderSource:TE,fragmentShaderSource:_E})};var so=Ex;var ejt=_(T(),1);var NQt=_(T(),1),HE=`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 UQt=_(T(),1),zE=`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;
v_normalEC = czm_normal * normal;
v_color = color;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var DQt=_(T(),1),Xx=`in vec4 v_color;
void main()
{
out_FragColor = czm_gammaCorrect(v_color);
}
`;var YQt=_(T(),1),KE=`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 Wp(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?KE:zE,r=i?Xx:HE,s=i?Wp.FLAT_VERTEX_FORMAT:Wp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Wp.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}}});Wp.VERTEX_FORMAT=We.POSITION_AND_NORMAL;Wp.FLAT_VERTEX_FORMAT=We.POSITION_ONLY;Wp.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Wp.prototype.isTranslucent=no.prototype.isTranslucent;Wp.prototype.getRenderState=no.prototype.getRenderState;var an=Wp;var cjt=_(T(),1);function fC(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(fC.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});fC.prototype.getType=function(e){return"Color"};var wIe=new ee;fC.prototype.getValue=function(e,t){return c(e)||(e=ee.now(wIe)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Y.WHITE,t.color),t};fC.prototype.equals=function(e){return this===e||e instanceof fC&&J.equals(this._color,e._color)};var Ut=fC;var aqt=_(T(),1);var N6t=_(T(),1);var Wjt=_(T(),1);var gjt=_(T(),1);function K0(e){e=e??z.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??re.default,this._rectangle=e.rectangle??de.MAX_VALUE,this._projection=new Xi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(K0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});K0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};K0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};K0.prototype.rectangleToNativeRectangle=function(e,t){C.defined("rectangle",e);let n=w.toDegrees(e.west),i=w.toDegrees(e.south),o=w.toDegrees(e.east),r=w.toDegrees(e.north);return c(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new de(n,i,o,r)};K0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=w.toDegrees(o.west),o.south=w.toDegrees(o.south),o.east=w.toDegrees(o.east),o.north=w.toDegrees(o.north),o};K0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,l=e*a+o.west,d=(e+1)*a+o.west,u=o.height/s,f=o.north-t*u,p=o.north-(t+1)*u;return c(i)||(i=new de(l,p,d,f)),i.west=l,i.south=p,i.east=d,i.north=f,i};K0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,l=e.longitude;i.east<i.west&&(l+=w.TWO_PI);let d=(l-i.west)/s|0;d>=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),c(n)?(n.x=d,n.y=u,n):new D(d,u)};var Ki=K0;var pne=new m,bne=new m,yne=new pe,AY=new m,PIe=new m,gne=new ue,vIe=new Ki,JE=[new pe,new pe,new pe,new pe],QE=new D,Vr={};Vr.initialize=function(){let e=Vr._initPromise;return c(e)||(e=Ge.fetchJson(on("Assets/approximateTerrainHeights.json")).then(function(t){Vr._terrainHeights=t}),Vr._initPromise=e),e};Vr.getMinimumMaximumHeights=function(e,t){if(C.defined("rectangle",e),!c(Vr._terrainHeights))throw new L("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??re.default;let n=xne(e),i=Vr._defaultMinTerrainHeight,o=Vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Vr._terrainHeights[r];c(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(de.northeast(e,yne),pne),t.cartographicToCartesian(de.southwest(e,yne),bne),m.midpoint(bne,pne,AY);let a=t.scaleToGeodeticSurface(AY,PIe);if(c(a)){let l=m.distance(AY,a);i=Math.min(i,-l)}else i=Vr._defaultMinTerrainHeight}return i=Math.max(Vr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Vr.getBoundingSphere=function(e,t){if(C.defined("rectangle",e),!c(Vr._terrainHeights))throw new L("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??re.default;let n=xne(e),i=Vr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Vr._terrainHeights[r];c(s)&&(i=s[1])}let o=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,gne),ue.union(o,gne,o)};function xne(e){pe.fromRadians(e.east,e.north,0,JE[0]),pe.fromRadians(e.west,e.north,0,JE[1]),pe.fromRadians(e.east,e.south,0,JE[2]),pe.fromRadians(e.west,e.south,0,JE[3]);let t=0,n=0,i=0,o=0,r=Vr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let l=0;l<4;++l){let d=JE[l];if(vIe.positionToTileXY(d,s,QE),l===0)i=QE.x,o=QE.y;else if(i!==QE.x||o!==QE.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}}Vr._terrainHeightsMaxLevel=6;Vr._defaultMaxTerrainHeight=9e3;Vr._defaultMinTerrainHeight=-1e5;Vr._terrainHeights=void 0;Vr._initPromise=void 0;Object.defineProperties(Vr,{initialized:{get:function(){return c(Vr._terrainHeights)}}});var ui=Vr;var y4t=_(T(),1);var $jt=_(T(),1);var Mjt=_(T(),1);function Nc(e,t,n){this.minimum=m.clone(e??m.ZERO),this.maximum=m.clone(t??m.ZERO),c(n)?n=m.clone(n):n=m.midpoint(this.minimum,this.maximum,new m),this.center=n}Nc.fromCorners=function(e,t,n){return C.defined("minimum",e),C.defined("maximum",t),c(n)||(n=new Nc),n.minimum=m.clone(e,n.minimum),n.maximum=m.clone(t,n.maximum),n.center=m.midpoint(e,t,n.center),n};Nc.fromPoints=function(e,t){if(c(t)||(t=new Nc),!c(e)||e.length===0)return t.minimum=m.clone(m.ZERO,t.minimum),t.maximum=m.clone(m.ZERO,t.maximum),t.center=m.clone(m.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,l=e.length;for(let f=1;f<l;f++){let p=e[f],y=p.x,h=p.y,g=p.z;n=Math.min(y,n),r=Math.max(y,r),i=Math.min(h,i),s=Math.max(h,s),o=Math.min(g,o),a=Math.max(g,a)}let d=t.minimum;d.x=n,d.y=i,d.z=o;let u=t.maximum;return u.x=r,u.y=s,u.z=a,t.center=m.midpoint(d,u,t.center),t};Nc.clone=function(e,t){if(c(e))return c(t)?(t.minimum=m.clone(e.minimum,t.minimum),t.maximum=m.clone(e.maximum,t.maximum),t.center=m.clone(e.center,t.center),t):new Nc(e.minimum,e.maximum,e.center)};Nc.equals=function(e,t){return e===t||c(e)&&c(t)&&m.equals(e.center,t.center)&&m.equals(e.minimum,t.minimum)&&m.equals(e.maximum,t.maximum)};var d5=new m;Nc.intersectPlane=function(e,t){C.defined("box",e),C.defined("plane",t),d5=m.subtract(e.maximum,e.minimum,d5);let n=m.multiplyByScalar(d5,.5,d5),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=m.dot(e.center,i)+t.distance;return r-o>0?zt.INSIDE:r+o<0?zt.OUTSIDE:zt.INTERSECTING};Nc.prototype.clone=function(e){return Nc.clone(this,e)};Nc.prototype.intersectPlane=function(e){return Nc.intersectPlane(this,e)};Nc.prototype.equals=function(e){return Nc.equals(this,e)};var J0=Nc;var MY=new ce;function fh(e,t){if(C.defined("origin",e),t=t??re.default,e=t.scaleToGeodeticSurface(e),!c(e))throw new L("origin must not be at the center of the ellipsoid.");let n=wt.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=m.fromCartesian4(M.getColumn(n,0,MY)),this._yAxis=m.fromCartesian4(M.getColumn(n,1,MY));let i=m.fromCartesian4(M.getColumn(n,2,MY));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(fh.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 FIe=new J0;fh.fromPoints=function(e,t){C.defined("cartesians",e);let n=J0.fromPoints(e,FIe);return new fh(n.center,t)};var _ne=new bn,u5=new m;fh.prototype.projectPointOntoPlane=function(e,t){C.defined("cartesian",e);let n=_ne;n.origin=e,m.normalize(e,n.direction);let i=qn.rayPlane(n,this._plane,u5);if(c(i)||(m.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,u5)),c(i)){let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return c(t)?(t.x=r,t.y=s,t):new D(r,s)}};fh.prototype.projectPointsOntoPlane=function(e,t){C.defined("cartesians",e),c(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);c(r)&&(t[n]=r,n++)}return t.length=n,t};fh.prototype.projectPointToNearestOnPlane=function(e,t){C.defined("cartesian",e),c(t)||(t=new D);let n=_ne;n.origin=e,m.clone(this._plane.normal,n.direction);let i=qn.rayPlane(n,this._plane,u5);c(i)||(m.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,u5));let o=m.subtract(i,this._origin,i),r=m.dot(this._xAxis,o),s=m.dot(this._yAxis,o);return t.x=r,t.y=s,t};fh.prototype.projectPointsToNearestOnPlane=function(e,t){C.defined("cartesians",e),c(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 AIe=new m;fh.prototype.projectPointOntoEllipsoid=function(e,t){C.defined("cartesian",e),c(t)||(t=new m);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=AIe;return m.multiplyByScalar(o,e.x,s),t=m.add(i,s,t),m.multiplyByScalar(r,e.y,s),m.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};fh.prototype.projectPointsOntoEllipsoid=function(e,t){C.defined("cartesians",e);let n=e.length;c(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 $r=fh;function ki(e,t){this.center=m.clone(e??m.ZERO),this.halfAxes=te.clone(t??te.ZERO)}ki.packedLength=m.packedLength+te.packedLength;ki.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,m.pack(e.center,t,n),te.pack(e.halfAxes,t,n+m.packedLength),t};ki.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new ki),m.unpack(e,t,n.center),te.unpack(e,t+m.packedLength,n.halfAxes),n};var MIe=new m,NIe=new m,kIe=new m,UIe=new m,OIe=new m,DIe=new m,BIe=new te,YIe={unitary:new te,diagonal:new te};ki.fromPoints=function(e,t){if(c(t)||(t=new ki),!c(e)||e.length===0)return t.halfAxes=te.ZERO,t.center=m.ZERO,t;let n,i=e.length,o=m.clone(e[0],MIe);for(n=1;n<i;n++)m.add(o,e[n],o);let r=1/i;m.multiplyByScalar(o,r,o);let s=0,a=0,l=0,d=0,u=0,f=0,p;for(n=0;n<i;n++)p=m.subtract(e[n],o,NIe),s+=p.x*p.x,a+=p.x*p.y,l+=p.x*p.z,d+=p.y*p.y,u+=p.y*p.z,f+=p.z*p.z;s*=r,a*=r,l*=r,d*=r,u*=r,f*=r;let y=BIe;y[0]=s,y[1]=a,y[2]=l,y[3]=a,y[4]=d,y[5]=u,y[6]=l,y[7]=u,y[8]=f;let h=te.computeEigenDecomposition(y,YIe),g=te.clone(h.unitary,t.halfAxes),x=te.getColumn(g,0,UIe),S=te.getColumn(g,1,OIe),V=te.getColumn(g,2,DIe),Z=-Number.MAX_VALUE,R=-Number.MAX_VALUE,E=-Number.MAX_VALUE,I=Number.MAX_VALUE,v=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],Z=Math.max(m.dot(x,p),Z),R=Math.max(m.dot(S,p),R),E=Math.max(m.dot(V,p),E),I=Math.min(m.dot(x,p),I),v=Math.min(m.dot(S,p),v),P=Math.min(m.dot(V,p),P);x=m.multiplyByScalar(x,.5*(I+Z),x),S=m.multiplyByScalar(S,.5*(v+R),S),V=m.multiplyByScalar(V,.5*(P+E),V);let F=m.add(x,S,t.center);m.add(F,V,F);let N=kIe;return N.x=Z-I,N.y=R-v,N.z=E-P,m.multiplyByScalar(N,.5,N),te.multiplyByScale(t.halfAxes,N,t.halfAxes),t};var Zne=new m,HIe=new m;function Tne(e,t,n,i,o,r,s,a,l,d,u){if(!c(o)||!c(r)||!c(s)||!c(a)||!c(l)||!c(d))throw new L("all extents (minimum/maximum X/Y/Z) are required.");c(u)||(u=new ki);let f=u.halfAxes;te.setColumn(f,0,t,f),te.setColumn(f,1,n,f),te.setColumn(f,2,i,f);let p=Zne;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(l+d)/2;let y=HIe;y.x=(r-o)/2,y.y=(a-s)/2,y.z=(d-l)/2;let h=u.center;return p=te.multiplyByVector(f,p,p),m.add(e,p,h),te.multiplyByScale(f,y,f),u}var Sne=new pe,zIe=new m,KIe=new pe,JIe=new pe,QIe=new pe,jIe=new pe,qIe=new pe,$Ie=new m,Cne=new m,eWe=new m,Vne=new m,tWe=new m,nWe=new D,iWe=new D,oWe=new D,rWe=new D,sWe=new D,aWe=new m,cWe=new m,lWe=new m,dWe=new m,uWe=new D,mWe=new m,fWe=new m,hWe=new m,pWe=new cn(m.UNIT_X,0);ki.fromRectangle=function(e,t,n,i,o){if(!c(e))throw new L("rectangle is required");if(e.width<0||e.width>w.TWO_PI)throw new L("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>w.PI)throw new L("Rectangle height must be between 0 and pi");if(c(i)&&!w.equalsEpsilon(i.radii.x,i.radii.y,w.EPSILON15))throw new L("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=t??0,n=n??0,i=i??re.default;let r,s,a,l,d,u,f;if(e.width<=w.PI){let v=de.center(e,Sne),P=i.cartographicToCartesian(v,zIe),F=new $r(P,i);f=F.plane;let N=v.longitude,b=e.south<0&&e.north>0?0:v.latitude,G=pe.fromRadians(N,e.north,n,KIe),X=pe.fromRadians(e.west,e.north,n,JIe),W=pe.fromRadians(e.west,b,n,QIe),A=pe.fromRadians(e.west,e.south,n,jIe),k=pe.fromRadians(N,e.south,n,qIe),B=i.cartographicToCartesian(G,$Ie),O=i.cartographicToCartesian(X,Cne),H=i.cartographicToCartesian(W,eWe),U=i.cartographicToCartesian(A,Vne),K=i.cartographicToCartesian(k,tWe),Q=F.projectPointToNearestOnPlane(B,nWe),ie=F.projectPointToNearestOnPlane(O,iWe),j=F.projectPointToNearestOnPlane(H,oWe),$=F.projectPointToNearestOnPlane(U,rWe),ne=F.projectPointToNearestOnPlane(K,sWe);return r=Math.min(ie.x,j.x,$.x),s=-r,l=Math.max(ie.y,Q.y),a=Math.min($.y,ne.y),X.height=A.height=t,O=i.cartographicToCartesian(X,Cne),U=i.cartographicToCartesian(A,Vne),d=Math.min(cn.getPointDistance(f,O),cn.getPointDistance(f,U)),u=n,Tne(F.origin,F.xAxis,F.yAxis,F.zAxis,r,s,a,l,d,u,o)}let p=e.south>0,y=e.north<0,h=p?e.south:y?e.north:0,g=de.center(e,Sne).longitude,x=m.fromRadians(g,h,n,i,aWe);x.z=0;let V=Math.abs(x.x)<w.EPSILON10&&Math.abs(x.y)<w.EPSILON10?m.UNIT_X:m.normalize(x,cWe),Z=m.UNIT_Z,R=m.cross(V,Z,lWe);f=cn.fromPointNormal(x,V,pWe);let E=m.fromRadians(g+w.PI_OVER_TWO,h,n,i,dWe);s=m.dot(cn.projectPointOntoPlane(f,E,uWe),R),r=-s,l=m.fromRadians(0,e.north,y?t:n,i,mWe).z,a=m.fromRadians(0,e.south,p?t:n,i,fWe).z;let I=m.fromRadians(e.east,h,n,i,hWe);return d=cn.getPointDistance(f,I),u=0,Tne(x,R,Z,V,r,s,a,l,d,u,o)};ki.fromTransformation=function(e,t){return C.typeOf.object("transformation",e),c(t)||(t=new ki),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=te.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};ki.clone=function(e,t){if(c(e))return c(t)?(m.clone(e.center,t.center),te.clone(e.halfAxes,t.halfAxes),t):new ki(e.center,e.halfAxes)};ki.intersectPlane=function(e,t){if(!c(e))throw new L("box is required.");if(!c(t))throw new L("plane is required.");let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,l=Math.abs(r*o[te.COLUMN0ROW0]+s*o[te.COLUMN0ROW1]+a*o[te.COLUMN0ROW2])+Math.abs(r*o[te.COLUMN1ROW0]+s*o[te.COLUMN1ROW1]+a*o[te.COLUMN1ROW2])+Math.abs(r*o[te.COLUMN2ROW0]+s*o[te.COLUMN2ROW1]+a*o[te.COLUMN2ROW2]),d=m.dot(i,n)+t.distance;return d<=-l?zt.OUTSIDE:d>=l?zt.INSIDE:zt.INTERSECTING};var Rne=new m,Gne=new m,Ene=new m,bWe=new m,Lne=new m,yWe=new m;ki.distanceSquaredTo=function(e,t){if(!c(e))throw new L("box is required.");if(!c(t))throw new L("cartesian is required.");let n=m.subtract(t,e.center,Zne),i=e.halfAxes,o=te.getColumn(i,0,Rne),r=te.getColumn(i,1,Gne),s=te.getColumn(i,2,Ene),a=m.magnitude(o),l=m.magnitude(r),d=m.magnitude(s),u=!0,f=!0,p=!0;a>0?m.divideByScalar(o,a,o):u=!1,l>0?m.divideByScalar(r,l,r):f=!1,d>0?m.divideByScalar(s,d,s):p=!1;let y=!u+!f+!p,h,g,x;if(y===1){let R=o;h=r,g=s,f?p||(R=s,g=o):(R=r,h=o),x=m.cross(h,g,Lne),R===o?o=x:R===r?r=x:R===s&&(s=x)}else if(y===2){h=o,f?h=r:p&&(h=s);let R=m.UNIT_Y;R.equalsEpsilon(h,w.EPSILON3)&&(R=m.UNIT_X),g=m.cross(h,R,bWe),m.normalize(g,g),x=m.cross(h,g,Lne),m.normalize(x,x),h===o?(r=g,s=x):h===r?(s=g,o=x):h===s&&(o=g,r=x)}else y===3&&(o=m.UNIT_X,r=m.UNIT_Y,s=m.UNIT_Z);let S=yWe;S.x=m.dot(n,o),S.y=m.dot(n,r),S.z=m.dot(n,s);let V=0,Z;return S.x<-a?(Z=S.x+a,V+=Z*Z):S.x>a&&(Z=S.x-a,V+=Z*Z),S.y<-l?(Z=S.y+l,V+=Z*Z):S.y>l&&(Z=S.y-l,V+=Z*Z),S.z<-d?(Z=S.z+d,V+=Z*Z):S.z>d&&(Z=S.z-d,V+=Z*Z),V};var gWe=new m,xWe=new m;ki.computePlaneDistances=function(e,t,n,i){if(!c(e))throw new L("box is required.");if(!c(t))throw new L("position is required.");if(!c(n))throw new L("direction is required.");c(i)||(i=new Ia);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,l=te.getColumn(a,0,Rne),d=te.getColumn(a,1,Gne),u=te.getColumn(a,2,Ene),f=m.add(l,d,gWe);m.add(f,u,f),m.add(f,s,f);let p=m.subtract(f,t,xWe),y=m.dot(n,p);return o=Math.min(y,o),r=Math.max(y,r),m.add(s,l,f),m.add(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.add(s,l,f),m.subtract(f,d,f),m.add(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.add(s,l,f),m.subtract(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.add(f,d,f),m.add(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.add(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.subtract(f,d,f),m.add(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),m.subtract(s,l,f),m.subtract(f,d,f),m.subtract(f,u,f),m.subtract(f,t,p),y=m.dot(n,p),o=Math.min(y,o),r=Math.max(y,r),i.start=o,i.stop=r,i};var _We=new m,TWe=new m,SWe=new m;ki.computeCorners=function(e,t){C.typeOf.object("box",e),c(t)||(t=[new m,new m,new m,new m,new m,new m,new m,new m]);let n=e.center,i=e.halfAxes,o=te.getColumn(i,0,_We),r=te.getColumn(i,1,TWe),s=te.getColumn(i,2,SWe);return m.clone(n,t[0]),m.subtract(t[0],o,t[0]),m.subtract(t[0],r,t[0]),m.subtract(t[0],s,t[0]),m.clone(n,t[1]),m.subtract(t[1],o,t[1]),m.subtract(t[1],r,t[1]),m.add(t[1],s,t[1]),m.clone(n,t[2]),m.subtract(t[2],o,t[2]),m.add(t[2],r,t[2]),m.subtract(t[2],s,t[2]),m.clone(n,t[3]),m.subtract(t[3],o,t[3]),m.add(t[3],r,t[3]),m.add(t[3],s,t[3]),m.clone(n,t[4]),m.add(t[4],o,t[4]),m.subtract(t[4],r,t[4]),m.subtract(t[4],s,t[4]),m.clone(n,t[5]),m.add(t[5],o,t[5]),m.subtract(t[5],r,t[5]),m.add(t[5],s,t[5]),m.clone(n,t[6]),m.add(t[6],o,t[6]),m.add(t[6],r,t[6]),m.subtract(t[6],s,t[6]),m.clone(n,t[7]),m.add(t[7],o,t[7]),m.add(t[7],r,t[7]),m.add(t[7],s,t[7]),t};var CWe=new te;ki.computeTransformation=function(e,t){C.typeOf.object("box",e),c(t)||(t=new M);let n=e.center,i=te.multiplyByUniformScale(e.halfAxes,2,CWe);return M.fromRotationTranslation(i,n,t)};var VWe=new ue;ki.isOccluded=function(e,t){if(!c(e))throw new L("box is required.");if(!c(t))throw new L("occluder is required.");let n=ue.fromOrientedBoundingBox(e,VWe);return!t.isBoundingSphereVisible(n)};ki.prototype.intersectPlane=function(e){return ki.intersectPlane(this,e)};ki.prototype.distanceSquaredTo=function(e){return ki.distanceSquaredTo(this,e)};ki.prototype.computePlaneDistances=function(e,t,n){return ki.computePlaneDistances(this,e,t,n)};ki.prototype.computeCorners=function(e){return ki.computeCorners(this,e)};ki.prototype.computeTransformation=function(e){return ki.computeTransformation(this,e)};ki.prototype.isOccluded=function(e){return ki.isOccluded(this,e)};ki.equals=function(e,t){return e===t||c(e)&&c(t)&&m.equals(e.center,t.center)&&te.equals(e.halfAxes,t.halfAxes)};ki.prototype.clone=function(e){return ki.clone(this,e)};ki.prototype.equals=function(e){return ki.equals(this,e)};var Xn=ki;var C4t=_(T(),1);var m5={};m5.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new L("scale must be a finite number.");if(!Number.isFinite(n))throw new L("relativeHeight must be a finite number.");return(e-n)*t+n};var LWe=new pe;m5.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,LWe);if(!c(r))return m.clone(e,o);let s=m5.getHeight(r.height,n,i);return m.fromRadians(r.longitude,r.latitude,s,t,o)};var Lr=m5;var x6t=_(T(),1);var L4t=_(T(),1),jE=`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;
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);
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);
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
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 R4t=_(T(),1),Q0=`#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 E4t=_(T(),1),Xne={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Xne.NUMBER_OF_CLASSIFICATION_TYPES=3;var Un=Object.freeze(Xne);var W4t=_(T(),1);var ZWe={NEVER:oe.NEVER,LESS:oe.LESS,EQUAL:oe.EQUAL,LESS_OR_EQUAL:oe.LEQUAL,GREATER:oe.GREATER,NOT_EQUAL:oe.NOTEQUAL,GREATER_OR_EQUAL:oe.GEQUAL,ALWAYS:oe.ALWAYS},lc=Object.freeze(ZWe);var f7t=_(T(),1);var F4t=_(T(),1);function RWe(e,t){if(!c(e))throw new L("array is required.");if(!c(t)||t<1)throw new L("numberOfArrays must be greater than 0.");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 qE=RWe;var j4t=_(T(),1);function wp(e,t,n){if(!c(e))throw new L("context is required");if(!c(t))throw new L("attributes is required");if(!c(n))throw new L("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=GWe(t),o=e.floatingPointTexture,r=i===Ue.FLOAT&&!o,s=EWe(t,r),a=XWe(s,t,r),l=Math.floor(mt.maximumTextureSize/a),d=Math.min(n,l),u=a*d,f=Math.ceil(n/d),p=1/u,y=p*.5,h=1/f,g=h*.5;this._textureDimensions=new D(u,f),this._textureStep=new ce(p,y,h,g),this._pixelDatatype=r?Ue.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let x=4*u*f;this._batchValues=i===Ue.FLOAT&&!r?new Float32Array(x):new Uint8Array(x),this._batchValuesDirty=!1}Object.defineProperties(wp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function GWe(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?Ue.FLOAT:Ue.UNSIGNED_BYTE}function Wne(e,t){let n=e[t].componentsPerAttribute;return n===2?D:n===3?m:n===4?ce:Number}function EWe(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 XWe(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 $E=new ce;function IWe(e,t,n){let i=ce.unpack(e,t,$E),o=ce.unpackFloat(i);i=ce.unpack(e,t+4,$E);let r=ce.unpackFloat(i);i=ce.unpack(e,t+8,$E);let s=ce.unpackFloat(i);i=ce.unpack(e,t+12,$E);let a=ce.unpackFloat(i);return ce.fromElements(o,r,s,a,n)}function WWe(e,t,n){let i=ce.packFloat(e.x,$E);ce.pack(i,t,n),i=ce.packFloat(e.y,i),ce.pack(i,t,n+4),i=ce.packFloat(e.z,i),ce.pack(i,t,n+8),i=ce.packFloat(e.w,i),ce.pack(i,t,n+12)}var Ine=new ce;wp.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new L("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new L("attributeIndex is out of range");let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?a=IWe(this._batchValues,s,Ine):a=ce.unpack(this._batchValues,s,Ine);let l=Wne(i,t);return c(l.fromCartesian4)?l.fromCartesian4(a,n):c(l.clone)?l.clone(a,n):a.x};var wWe=[void 0,void 0,new D,new m,new ce],PWe=new ce;wp.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new L("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new L("attributeIndex is out of range");if(!c(n))throw new L("value is required.");let i=this._attributes,o=wWe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Wne(this._attributes,t);if(c(s.equals)?s.equals(r,n):r===n)return;let l=PWe;l.x=c(n.x)?n.x:n,l.y=c(n.y)?n.y:0,l.z=c(n.z)?n.z:0,l.w=c(n.w)?n.w:0;let d=this._offsets[t],f=4*this._stride*e+4*d;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?WWe(l,this._batchValues,f):ce.pack(l,this._batchValues,f),this._batchValuesDirty=!0};function vWe(e,t){let n=e._textureDimensions;e._texture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:en.NEAREST,flipY:!1})}function FWe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}wp.prototype.update=function(e){c(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,c(this._texture)||vWe(this,e.context),FWe(this))};wp.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 AWe(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 MWe(e){return e===1?"float":`vec${e}`}function NWe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function kWe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=MWe(o),a=NWe(o),l=e._offsets[t],d=`${s} ${r}(float batchId) 
{ 
    vec2 st = computeSt(batchId); 
    st.x += batchTextureStep.x * float(${l}); 
`;return e._packFloats&&i.componentDatatype!==Ue.UNSIGNED_BYTE?d+=`vec4 textureValue; 
textureValue.x = czm_unpackFloat(texture(batchTexture, st)); 
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0))); 
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); 
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); 
`:d+=`    vec4 textureValue = texture(batchTexture, st); 
`,d+=`    ${s} value = textureValue${a}; 
`,e._pixelDatatype===Ue.UNSIGNED_BYTE&&i.componentDatatype===q.UNSIGNED_BYTE&&!i.normalize?d+=`value *= 255.0; 
`:e._pixelDatatype===Ue.FLOAT&&i.componentDatatype===q.UNSIGNED_BYTE&&i.normalize&&(d+=`value /= 255.0; 
`),d+=`    return value; 
} 
`,d}wp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; 
`;t+=`${AWe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=kWe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};wp.prototype.isDestroyed=function(){return!1};wp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),he(this)};var Ix=wp;var T8t=_(T(),1);var r8t=_(T(),1);function El(e){this._ellipsoid=e??re.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(El.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});El.mercatorAngleToGeodeticLatitude=function(e){return w.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};El.geodeticLatitudeToMercatorAngle=function(e){e>El.MaximumLatitude?e=El.MaximumLatitude:e<-El.MaximumLatitude&&(e=-El.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};El.MaximumLatitude=El.mercatorAngleToGeodeticLatitude(Math.PI);El.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=El.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new m(i,o,r)};El.prototype.unproject=function(e,t){if(!c(e))throw new L("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=El.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new pe(i,o,r)};var Wi=El;function UWe(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)c(e[r].geometry)&&An.transformToWorldCoordinates(e[r]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function NY(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ee({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 OWe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];c(i.geometry)?NY(i.geometry,n):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&(NY(i.westHemisphereGeometry,n),NY(i.eastHemisphereGeometry,n))}}function DWe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,l,d,u,f=t.length;for(l=0;l<f;++l)if(c(t[l].geometry)){u=t[l].geometry.primitiveType;break}for(l=1;l<f;++l)if(c(t[l].geometry)&&t[l].geometry.primitiveType!==u)throw new L("All instance geometries must have the same primitiveType.");if(UWe(t,a,o),!o)for(l=0;l<f;++l)c(t[l].geometry)&&An.splitLongitude(t[l]);if(OWe(t),r)for(l=0;l<f;++l){let y=t[l];c(y.geometry)?(An.reorderForPostVertexCache(y.geometry),An.reorderForPreVertexCache(y.geometry)):c(y.westHemisphereGeometry)&&c(y.eastHemisphereGeometry)&&(An.reorderForPostVertexCache(y.westHemisphereGeometry),An.reorderForPreVertexCache(y.westHemisphereGeometry),An.reorderForPostVertexCache(y.eastHemisphereGeometry),An.reorderForPreVertexCache(y.eastHemisphereGeometry))}let p=An.combineInstances(t);for(f=p.length,l=0;l<f;++l){d=p[l];let y=d.attributes;if(o)for(let h in y)y.hasOwnProperty(h)&&y[h].componentDatatype===q.DOUBLE&&An.encodeAttribute(d,h,`${h}3DHigh`,`${h}3DLow`);else for(let h in y)if(y.hasOwnProperty(h)&&y[h].componentDatatype===q.DOUBLE){let g=`${h}3D`,x=`${h}2D`;An.projectTo2D(d,h,g,x,n),c(d.boundingSphere)&&h==="position"&&(d.boundingSphereCV=ue.fromVertices(d.attributes.position2D.values)),An.encodeAttribute(d,g,`${g}High`,`${g}Low`),An.encodeAttribute(d,x,`${x}High`,`${x}Low`)}s&&An.compressVertices(d)}if(!i){let y=[];for(f=p.length,l=0;l<f;++l)d=p[l],y=y.concat(An.fitToUnsignedShortIndices(d));p=y}return p}function kY(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let l=e.length;for(let d=0;d<l;++d){let f=e[d][t];if(!c(f))continue;let p=f.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function BWe(e,t){let n=[];return kY(e,"geometry",t,n),kY(e,"westHemisphereGeometry",t,n),kY(e,"eastHemisphereGeometry",t,n),n}var Pp={};Pp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=DWe(e),t.length>0&&(n=An.createAttributeLocations(t[0]),e.createPickOffsets&&(r=BWe(i,t))),c(i[0].attributes)&&c(i[0].attributes.offset)&&(s=new Array(o),a=!0));let l=new Array(o),d=new Array(o);for(let u=0;u<o;++u){let f=i[u],p=f.geometry;c(p)&&(l[u]=p.boundingSphere,d[u]=p.boundingSphereCV,a&&(s[u]=f.geometry.offsetAttribute));let y=f.eastHemisphereGeometry,h=f.westHemisphereGeometry;c(y)&&c(h)&&(c(y.boundingSphere)&&c(h.boundingSphere)&&(l[u]=ue.union(y.boundingSphere,h.boundingSphere)),c(y.boundingSphereCV)&&c(h.boundingSphereCV)&&(d[u]=ue.union(y.boundingSphereCV,h.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:l,boundingSpheresCV:d}};function YWe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];c(o)&&c(o.values)&&t.push(o.values.buffer)}c(e.indices)&&t.push(e.indices.buffer)}function HWe(e,t){let n=e.length;for(let i=0;i<n;++i)YWe(e[i],t)}function zWe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!c(o))continue;let r=o.attributes;t+=7+2*ue.packedLength+(c(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&c(r[s])){let a=r[s];t+=5+a.values.length}}return t}Pp.packCreateGeometryResults=function(e,t){let n=new Float64Array(zWe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let l=e[a],d=c(l);if(n[s++]=d?1:0,!d)continue;n[s++]=l.primitiveType,n[s++]=l.geometryType,n[s++]=l.offsetAttribute??-1;let u=c(l.boundingSphere)?1:0;n[s++]=u,u&&ue.pack(l.boundingSphere,n,s),s+=ue.packedLength;let f=c(l.boundingSphereCV)?1:0;n[s++]=f,f&&ue.pack(l.boundingSphereCV,n,s),s+=ue.packedLength;let p=l.attributes,y=[];for(let g in p)p.hasOwnProperty(g)&&c(p[g])&&(y.push(g),c(o[g])||(o[g]=i.length,i.push(g)));n[s++]=y.length;for(let g=0;g<y.length;g++){let x=y[g],S=p[x];n[s++]=o[x],n[s++]=S.componentDatatype,n[s++]=S.componentsPerAttribute,n[s++]=S.normalize?1:0,n[s++]=S.values.length,n.set(S.values,s),s+=S.values.length}let h=c(l.indices)?l.indices.length:0;n[s++]=h,h>0&&(n.set(l.indices,s),s+=h)}return t.push(n.buffer),{stringTable:i,packedData:n}};Pp.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 l=n[s++],d=n[s++],u=n[s++];u===-1&&(u=void 0);let f,p;n[s++]===1&&(f=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.packedLength;let g,x,S,V=new fn,Z=n[s++];for(i=0;i<Z;i++){let E=t[n[s++]],I=n[s++];S=n[s++];let v=n[s++]!==0;g=n[s++],x=q.createTypedArray(I,g);for(let P=0;P<g;P++)x[P]=n[s++];V[E]=new Ee({componentDatatype:I,componentsPerAttribute:S,normalize:v,values:x})}let R;if(g=n[s++],g>0){let E=x.length/S;for(R=Me.createTypedArray(E,g),i=0;i<g;i++)R[i]=n[s++]}o[r++]=new dt({primitiveType:l,geometryType:d,boundingSphere:f,boundingSphereCV:p,indices:R,attributes:V,offsetAttribute:u})}return o};function KWe(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,c(s.attributes)&&c(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 JWe(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,c(t[o])&&(s={offset:new $i(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Pp.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:KWe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Xi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Pp.unpackCombineGeometryParameters=function(e){let t=JWe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let l=Pp.unpackCreateGeometryResults(n[a]),d=l.length;for(let u=0;u<d;u++){let f=l[u],p=t[o];p.geometry=f,++o}}let r=re.clone(e.ellipsoid),s=e.isGeographic?new Xi(r):new Wi(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 wne(e){let t=e.length,n=1+(ue.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];c(s)?(i[o++]=1,ue.pack(e[r],i,o)):i[o++]=0,o+=ue.packedLength}return i}function Pne(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}Pp.packCombineGeometryResults=function(e,t){c(e.geometries)&&HWe(e.geometries,t);let n=wne(e.boundingSpheres),i=wne(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}};Pp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Pne(e.boundingSpheres),boundingSpheresCV:Pne(e.boundingSpheresCV)}};var Wx=Pp;var C8t=_(T(),1),QWe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Zr=Object.freeze(QWe);var L8t=_(T(),1),hd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};hd.NUMBER_OF_SHADOW_MODES=4;hd.castShadows=function(e){return e===hd.ENABLED||e===hd.CAST_ONLY};hd.receiveShadows=function(e){return e===hd.ENABLED||e===hd.RECEIVE_ONLY};hd.fromCastReceive=function(e,t){return e&&t?hd.ENABLED:e?hd.CAST_ONLY:t?hd.RECEIVE_ONLY:hd.DISABLED};var Sn=Object.freeze(hd);function Rr(e){if(e=e??z.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,c(this.rtcCenter)&&(!c(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new L("Relative-to-center rendering only supports one geometry instance.");this.shadows=e.shadows??Sn.DISABLED,this._translucent=void 0,this._state=Zr.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(Rr.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 jWe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&c(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let l=e[a].attributes[o];if(!c(l)||r.componentDatatype!==l.componentDatatype||r.componentsPerAttribute!==l.componentsPerAttribute||r.normalize!==l.normalize){s=!1;break}}s&&n.push(o)}return n}var qWe=new D,$We=new m,Dne=new ce;function Bne(e){let t=e.length;if(t===1)return e[0];if(t===2)return D.unpack(e,0,qWe);if(t===3)return m.unpack(e,0,$We);if(t===4)return ce.unpack(e,0,Dne)}function ewe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=jWe(i),s=r.length,a=[],l={},d={},u,p=i[0].attributes,y,h,g;for(y=0;y<s;++y)h=r[y],g=p[h],l[h]=y,a.push({functionName:`czm_batchTable_${h}`,componentDatatype:g.componentDatatype,componentsPerAttribute:g.componentsPerAttribute,normalize:g.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}),d.center3DHigh=a.length-5,d.center3DLow=a.length-4,d.center2DHigh=a.length-3,d.center2DLow=a.length-2,d.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:q.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let x=a.length,S=new Ix(t,a,o);for(y=0;y<o;++y){let V=i[y];p=V.attributes;for(let v=0;v<s;++v){h=r[v],g=p[h];let P=Bne(g.value),F=l[h];S.setBatchedAttribute(y,F,P)}let Z={primitive:V.pickPrimitive??e};c(V.id)&&(Z.id=V.id);let R=t.createPickId(Z);e._pickIds.push(R);let E=R.color,I=Dne;I.x=Y.floatToByte(E.red),I.y=Y.floatToByte(E.green),I.z=Y.floatToByte(E.blue),I.w=Y.floatToByte(E.alpha),S.setBatchedAttribute(y,x-1,I)}e._batchTable=S,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function twe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ee({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function nwe(e){let t=e.attributes,n=new fn;for(let o in t)t.hasOwnProperty(o)&&c(t[o])&&(n[o]=twe(t[o]));let i;if(c(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new dt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ue.clone(e.boundingSphere)})}function iwe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var owe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Rr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=owe.exec(t))!==null;){let a=i[1],l=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;l!=="vec4 czm_computePosition()"&&(o+=`${l};
`),c(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+=`${l}
{
    return u_modifiedModelView * position;
}

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

`:(r+=`in vec3 ${a}2DHigh;
in vec3 ${a}2DLow;
`,s+=`${l}
{
    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(`
`)};Rr._appendShowToShader=function(e,t){return c(e._batchTableAttributeIndices.show)?`${Be.replaceMain(t,"czm_non_show_main")}
void main() 
{ 
    czm_non_show_main(); 
    gl_Position *= czm_batchTable_show(batchId); 
}`:t};Rr._updateColorAttribute=function(e,t,n){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;if(n&&!c(e._batchTableAttributeIndices.depthFailColor))throw new L("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");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 vne(e){return`${Be.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor; 
void main() 
{ 
    czm_non_pick_main(); 
    v_pickColor = czm_batchTable_pickColor(batchId); 
}`}function Fne(e){return`in vec4 v_pickColor;
${e}`}Rr._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};Rr._appendOffsetToShader=function(e,t){if(!c(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};Rr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=Be.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 Ane(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",l="compressedAttributes",d=`in ${a} ${l};`,u="",f="";if(i){u+=`vec2 st;
`;let h=s>1?`${l}.x`:l;f+=`    st = czm_decompressTextureCoordinates(${h});
`}n&&o&&r?(u+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,f+=`    czm_octDecode(${l}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(u+=`vec3 normal;
`,f+=`    normal = czm_octDecode(${l}${s>1?`.${i?"y":"x"}`:""});
`),o&&(u+=`vec3 tangent;
`,f+=`    tangent = czm_octDecode(${l}.${i&&n?"z":"y"});
`),r&&(u+=`vec3 bitangent;
`,f+=`    bitangent = czm_octDecode(${l}.${i&&n?"z":"y"});
`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=Be.replaceMain(p,"czm_non_compressed_main");let y=`void main() 
{ 
${f}    czm_non_compressed_main(); 
}`;return[d,u,p,y].join(`
`)}function rwe(e){let t=Be.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
    czm_non_depth_clamp_main();
    gl_Position = czm_depthClamp(gl_Position);}
`,t}function swe(e){let t=Be.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 Mne(e,t){let n=e.vertexAttributes;for(let i in n)if(n.hasOwnProperty(i)&&!c(t[i]))throw new L(`Appearance/Geometry mismatch.  The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry.  Use the appearance's vertexFormat property when constructing the geometry.`)}function awe(e,t){return function(){return e[t]}}var UY=Math.max(Ot.hardwareConcurrency-1,1),f5,cwe=new gi("combineGeometry");function lwe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Zr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,l=[],d=[];for(o=0;o<a;++o){if(i=n[o].geometry,s.push(n[o].id),c(i._workerName)&&c(i._workerPath)||!c(i._workerName)&&!c(i._workerPath))throw new L("Must define either _workerName or _workerPath for asynchronous geometry.");d.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!c(f5))for(f5=new Array(UY),o=0;o<UY;o++)f5[o]=new gi("createGeometry");let u;for(d=qE(d,UY),o=0;o<d.length;o++){let f=0,p=d[o],y=p.length;for(r=0;r<y;++r)u=p[r],i=u.geometry,c(i.constructor.pack)&&(u.offset=f,f+=i.constructor.packedLength??i.packedLength);let h;if(f>0){let g=new Float64Array(f);for(h=[g.buffer],r=0;r<y;++r)u=p[r],i=u.geometry,c(i.constructor.pack)&&(i.constructor.pack(i,g,u.offset),u.geometry=g)}l.push(f5[o].scheduleTask({subTasks:d[o]},h))}e._state=Zr.CREATING,Promise.all(l).then(function(f){e._createGeometryResults=f,e._state=Zr.CREATED}).catch(function(f){tX(e,t,Zr.FAILED,f)})}else if(e._state===Zr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let l=t.scene3DOnly,d=t.mapProjection,u=cwe.scheduleTask(Wx.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Zr.COMBINING,Promise.resolve(u).then(function(f){let p=Wx.unpackCombineGeometryResults(f);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=M.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Zr.COMBINED):tX(e,t,Zr.FAILED,void 0)}).catch(function(f){tX(e,t,Zr.FAILED,f)})}}function dwe(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,l=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,y;c(p.attributes)&&c(p.primitiveType)?y=nwe(p):y=p.constructor.createGeometry(p),o[l++]=iwe(s,y),r.push(s.id)}o.length=l;let d=t.scene3DOnly,u=t.mapProjection,f=Wx.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=f.geometries,e._attributeLocations=f.attributeLocations,e.modelMatrix=M.clone(f.modelMatrix,e.modelMatrix),e._pickOffsets=f.pickOffsets,e._offsetInstanceExtend=f.offsetInstanceExtend,e._instanceBoundingSpheres=f.boundingSpheres,e._instanceBoundingSpheresCV=f.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Zr.COMBINED):tX(e,t,Zr.FAILED,void 0)}function uwe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!c(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!c(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ue;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let g=a[i],x=e._batchTable.getBatchedAttribute(i,n,new m);g=r[i].clone(g),Kne(g,x,o[i])}let l=[],d=[],u=[];for(i=0;i<s;++i){let g=a[i];g.center.x-g.radius>0||ue.intersectPlane(g,cn.ORIGIN_ZX_PLANE)!==zt.INTERSECTING?l.push(g):(d.push(g),u.push(g))}let f=l[0],p=u[0],y=d[0];for(i=1;i<l.length;i++)f=ue.union(f,l[i]);for(i=1;i<u.length;i++)p=ue.union(p,u[i]);for(i=1;i<d.length;i++)y=ue.union(y,d[i]);let h=[];for(c(f)&&h.push(f),c(p)&&h.push(p),c(y)&&h.push(y),i=0;i<h.length;i++){let g=h[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=g,e._boundingSphereCV[i]=ue.projectTo2D(g,t.mapProjection,e._boundingSphereCV[i])}Rr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Nne=new Bn,Yne=new pe,Hne=new m,zne=new ue;function mwe(e,t){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,l=i.radius,d=t.mapProjection,u=d.ellipsoid,f=e._batchTable,p=e._instanceBoundingSpheres,y=p.length;for(let h=0;h<y;++h){let g=p[h];if(!c(g))continue;let x=e.modelMatrix;c(x)&&(g=ue.transform(g,x,zne));let S=g.center,V=g.radius,Z=Bn.fromCartesian(S,Nne);if(f.setBatchedAttribute(h,o,Z.high),f.setBatchedAttribute(h,r,Z.low),!t.scene3DOnly){let R=u.cartesianToCartographic(S,Yne),E=d.project(R,Hne);Z=Bn.fromCartesian(E,Nne),f.setBatchedAttribute(h,s,Z.high),f.setBatchedAttribute(h,a,Z.low)}f.setBatchedAttribute(h,l,V)}e._batchTableBoundingSpheresUpdated=!0}var OY=new m,fwe=new m;function kne(e,t){if(!c(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,l=a.length;for(let d=0;d<l;++d){let u=a[d];if(!c(u))continue;let f=s.getBatchedAttribute(d,e._batchTableAttributeIndices.offset);if(m.equals(f,m.ZERO)){s.setBatchedAttribute(d,i,m.ZERO);continue}let p=e.modelMatrix;c(p)&&(u=ue.transform(u,p,zne));let y=u.center;y=r.scaleToGeodeticSurface(y,fwe);let h=r.cartesianToCartographic(y,Yne),g=o.project(h,Hne),x=m.add(f,y,OY);h=r.cartesianToCartographic(x,h);let S=o.project(h,OY),V=m.subtract(S,g,OY),Z=V.x;V.x=V.z,V.z=V.y,V.y=Z,s.setBatchedAttribute(d,i,V)}e._batchTableOffsetsUpdated=!0}function hwe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let l=0;l<a;++l){let d=i[l];if(s.push(ni.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:Ne.STATIC_DRAW,interleave:e._interleave})),c(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,d);else if(e._boundingSpheres.push(ue.clone(d.boundingSphere)),e._boundingSphereWC.push(new ue),!o){let u=d.boundingSphereCV.center,f=u.x,p=u.y,y=u.z;u.x=y,u.y=f,u.z=p,e._boundingSphereCV.push(ue.clone(d.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,tX(e,t,Zr.COMPLETE,void 0)}function pwe(e,t,n,i){let o=n.getRenderState(),r;i?(r=He(o,!1),r.cull={enabled:!0,face:_i.BACK},e._frontFaceRS=Oe.fromCache(r),r.cull.face=_i.FRONT,e._backFaceRS=Oe.fromCache(r)):(e._frontFaceRS=Oe.fromCache(o),e._backFaceRS=e._frontFaceRS),r=He(o,!1),c(e._depthFailAppearance)&&(r.depthTest.enabled=!1),c(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=He(o,!1),r.depthTest.func=lc.GREATER,i?(r.cull={enabled:!0,face:_i.BACK},e._frontFaceDepthFailRS=Oe.fromCache(r),r.cull.face=_i.FRONT,e._backFaceDepthFailRS=Oe.fromCache(r)):(e._frontFaceDepthFailRS=Oe.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function bwe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Rr._appendOffsetToShader(e,r),r=Rr._appendShowToShader(e,r),r=Rr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=vne(r),r=Rr._updateColorAttribute(e,r,!1),r=Ane(e,r),r=Rr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Fne(s),e._sp=tn.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Mne(e._sp,o),c(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Rr._appendShowToShader(e,r),r=Rr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=vne(r),r=Rr._updateColorAttribute(e,r,!0),r=Ane(e,r),r=Rr._modifyShaderPosition(e,r,t.scene3DOnly),r=rwe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=Fne(s),s=swe(s),e._spDepthFail=tn.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Mne(e._spDepthFail,o))}var eX=new M,Une=new m;function One(e,t,n,i){let o=c(n)?n._uniforms:void 0,r={},s=t.uniforms;if(c(s)){for(let l in s)if(s.hasOwnProperty(l)){if(c(o)&&c(o[l]))throw new L(`Appearance and material have a uniform with the same name: ${l}`);r[l]=awe(s,l)}}let a=St(r,o);return a=e._batchTable.getUniformMapCallback()(a),c(e.rtcCenter)&&(a.u_modifiedModelView=function(){let l=i.context.uniformState.view;return M.multiply(l,e._modelMatrix,eX),M.multiplyByPoint(eX,e.rtcCenter,Une),M.setTranslation(eX,Une,eX),eX}),a}function ywe(e,t,n,i,o,r,s,a){let l=One(e,t,n,a),d;c(e._depthFailAppearance)&&(d=One(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Xe.TRANSLUCENT:Xe.OPAQUE,f=o?2:1;f*=c(e._depthFailAppearance)?2:1,r.length=e._va.length*f;let p=r.length,y=0;for(let h=0;h<p;++h){let g;o&&(g=r[h],c(g)||(g=r[h]=new et({owner:e,primitiveType:e._primitiveType})),g.vertexArray=e._va[y],g.renderState=e._backFaceRS,g.shaderProgram=e._sp,g.uniformMap=l,g.pass=u,++h),g=r[h],c(g)||(g=r[h]=new et({owner:e,primitiveType:e._primitiveType})),g.vertexArray=e._va[y],g.renderState=e._frontFaceRS,g.shaderProgram=e._sp,g.uniformMap=l,g.pass=u,c(e._depthFailAppearance)&&(o&&(++h,g=r[h],c(g)||(g=r[h]=new et({owner:e,primitiveType:e._primitiveType})),g.vertexArray=e._va[y],g.renderState=e._backFaceDepthFailRS,g.shaderProgram=e._spDepthFail,g.uniformMap=d,g.pass=u),++h,g=r[h],c(g)||(g=r[h]=new et({owner:e,primitiveType:e._primitiveType})),g.vertexArray=e._va[y],g.renderState=e._frontFaceDepthFailRS,g.shaderProgram=e._spDepthFail,g.uniformMap=d,g.pass=u),++y}}Rr._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],c(s)&&(e._boundingSphereWC[o]=ue.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ue.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ue.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(c(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let l=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;l.radius=s.radius+u}};function gwe(e,t,n,i,o,r,s,a){if(t.mode!==se.SCENE3D&&!M.equals(o,M.IDENTITY))throw new L("Primitive.modelMatrix is only supported in 3D mode.");Rr._updateBoundingVolumes(e,t,o);let l;t.mode===se.SCENE3D?l=e._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===se.SCENE2D&&c(e._boundingSphere2D)?l=e._boundingSphere2D:c(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);let d=t.commandList,u=t.passes;if(u.render||u.pick){let f=e.allowPicking,p=Sn.castShadows(e.shadows),y=Sn.receiveShadows(e.shadows),h=n.length,g=a?2:1;g*=c(e._depthFailAppearance)?2:1;for(let x=0;x<h;++x){let S=Math.floor(x/g),V=n[x];V.modelMatrix=o,V.boundingVolume=l[S],V.cull=r,V.debugShowBoundingVolume=s,V.castShadows=p,V.receiveShadows=y,f?V.pickId="v_pickColor":V.pickId=void 0,d.push(V)}}}Rr.prototype.update=function(e){if(!c(this.geometryInstances)&&this._va.length===0||c(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!c(this.appearance)||e.mode!==se.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(c(this._error))throw this._error;if(c(this.rtcCenter)&&!e.scene3DOnly)throw new L("RTC rendering is only available for 3D only scenes.");if(this._state===Zr.FAILED)return;let t=e.context;if(c(this._batchTable)||ewe(this,t),this._batchTable.attributes.length>0){if(mt.maximumVertexTextureImageUnits===0)throw new le("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!==Zr.COMPLETE&&this._state!==Zr.COMBINED&&(this.asynchronous?lwe(this,e):dwe(this,e)),this._state===Zr.COMBINED&&(mwe(this,e),kne(this,e),hwe(this,e)),!this.show||this._state!==Zr.COMPLETE)return;this._batchTableOffsetsUpdated||kne(this,e),this._recomputeBoundingSpheres&&uwe(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=c(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 l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),c(this._material)&&this._material.update(t);let d=n.closed&&l;o&&(this._createRenderStatesFunction??pwe)(this,t,n,d),r&&(this._createShaderProgramFunction??bwe)(this,e,n),(o||r)&&(this._createCommandsFunction??ywe)(this,n,i,l,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??gwe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var xwe=new ue,_we=new ue;function Kne(e,t,n){if(n===$t.TOP){let i=ue.clone(e,xwe),o=ue.clone(e,_we);o.center=m.add(o.center,t,o.center),e=ue.union(i,o,e)}else n===$t.ALL&&(e.center=m.add(e.center,t,e.center));return e}function Twe(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 c(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function Swe(e,t,n,i,o){return function(r){if(!c(r)||!c(r.length)||r.length<1||r.length>4)throw new L("value must be and array with length between 1 and 4.");let s=Bne(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var Cwe=new m;function Vwe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(c(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;c(r)&&Kne(i,m.fromArray(r.get(),0,Cwe),e._offsetInstanceExtend[n]),c(o)&&(i=ue.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function Lwe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Rr.prototype.getGeometryInstanceAttributes=function(e){if(!c(e))throw new L("id is required");if(!c(this._batchTable))throw new L("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(c(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d<r;++d){let u=(i+d)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let l={};for(let d in a)if(a.hasOwnProperty(d)){let u=a[d];l[d]={get:Twe(s,n,u),set:Swe(s,n,u,this,d)}}return Vwe(this,l,n),Lwe(this,l,n),Object.defineProperties(t,l),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Rr.prototype.isDestroyed=function(){return!1};Rr.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,he(this)};function tX(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Zr.COMPLETE||e._state===Zr.FAILED})}var In=Rr;var A7t=_(T(),1);var g7t=_(T(),1);function Zwe(e){if(e=e??z.EMPTY_OBJECT,!c(e.componentDatatype))throw new L("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new L("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new L("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.value))throw new L("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var dc=Zwe;var _7t=_(T(),1),hC=`#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;
float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
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
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
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 PICK
#ifdef CULL_FRAGMENTS
if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
out_FragColor.a = 1.0;
czm_writeDepthClamp();
}
#else // CULL_FRAGMENTS
out_FragColor.a = 1.0;
#endif // CULL_FRAGMENTS
#else // PICK
#ifdef CULL_FRAGMENTS
if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
discard;
}
#endif
#ifdef NORMAL_EC
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
out_FragColor.rgb *= out_FragColor.a;
#else // PER_INSTANCE_COLOR
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
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
out_FragColor.rgb *= out_FragColor.a;
#endif // PER_INSTANCE_COLOR
czm_writeDepthClamp();
#endif // PICK
}
`;function Zu(e,t,n){C.typeOf.bool("extentsCulling",e),C.typeOf.bool("planarExtents",t),C.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new DY;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new DY;if(o.requiresTextureCoordinates=e,n instanceof an)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}Zu.prototype.createFragmentShader=function(e){C.typeOf.bool("columbusView2D",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 an&&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 an||(o=t.material.shaderSource),new Be({defines:i,sources:[o,hC]})};Zu.prototype.createPickFragmentShader=function(e){C.typeOf.bool("columbusView2D",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 Be({defines:n,sources:[hC],pickColorQualifier:"in"})};Zu.prototype.createVertexShader=function(e,t,n,i){return C.defined("defines",e),C.typeOf.string("vertexShaderSource",t),C.typeOf.bool("columbusView2D",n),C.defined("mapProjection",i),nie(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Zu.prototype.createPickVertexShader=function(e,t,n,i){return C.defined("defines",e),C.typeOf.string("vertexShaderSource",t),C.typeOf.bool("columbusView2D",n),C.defined("mapProjection",i),nie(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Jne=new m,Qne=new pe,jne={high:0,low:0};function nie(e,t,n,i,o,r,s,a){let l=i.slice();if(a.eastMostYhighDefine===""){let d=Qne;d.longitude=w.PI,d.latitude=0,d.height=0;let u=s.project(d,Jne),f=Bn.encode(u.x,jne);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${f.high.toFixed(`${f.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${f.low.toFixed(`${f.low}`.length+1)}`;let p=Qne;p.longitude=-w.PI,p.latitude=0,p.height=0;let y=s.project(p,Jne);f=Bn.encode(y.x,jne),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${f.high.toFixed(`${f.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${f.low.toFixed(`${f.low}`.length+1)}`}return n&&(l.push(a.eastMostYhighDefine),l.push(a.eastMostYlowDefine),l.push(a.westMostYhighDefine),l.push(a.westMostYlowDefine)),c(r)&&r instanceof an&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new Be({defines:l,sources:[o]})}function DY(){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(DY.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 qne(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)/D.distance(t,e)}var Rwe=[new D,new D,new D,new D];function iie(e,t){let n=Rwe,i=D.unpack(t,0,n[0]),o=D.unpack(t,2,n[1]),r=D.unpack(t,4,n[2]);e.uMaxVmax=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/qne(i,o,r),a=1/qne(i,r,o);e.uvMinAndExtents=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var oie=new pe,rie=new m,Gwe=new m,Ewe=new m,h5={high:0,low:0};function sie(e,t,n){let i=oie;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,rie);i.latitude=e.north;let r=t.project(i,Gwe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,Ewe),a=[0,0,0,0],l=[0,0,0,0],d=Bn.encode(o.x,h5);a[0]=d.high,l[0]=d.low,d=Bn.encode(o.y,h5),a[1]=d.high,l[1]=d.low,d=Bn.encode(r.y,h5),a[2]=d.high,l[2]=d.low,d=Bn.encode(s.x,h5),a[3]=d.high,l[3]=d.low,n.planes2D_HIGH=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}var Xwe=new M,Iwe=new M,$ne=new m,Wwe=new pe,wwe=[new pe,new pe,new pe,new pe,new pe,new pe,new pe,new pe];function Pwe(e,t,n,i,o,r){let s=de.center(e,Wwe);s.height=n;let a=pe.toCartesian(s,t,$ne),l=wt.eastNorthUpToFixedFrame(a,t,Xwe),d=M.inverse(l,Iwe),u=e.west,f=e.east,p=e.north,y=e.south,h=wwe;h[0].latitude=y,h[0].longitude=u,h[1].latitude=p,h[1].longitude=u,h[2].latitude=p,h[2].longitude=f,h[3].latitude=y,h[3].longitude=f;let g=(u+f)*.5,x=(p+y)*.5;h[4].latitude=y,h[4].longitude=g,h[5].latitude=p,h[5].longitude=g,h[6].latitude=x,h[6].longitude=u,h[7].latitude=x,h[7].longitude=f;let S=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,Z=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){h[P].height=n;let F=pe.toCartesian(h[P],t,$ne);M.multiplyByPoint(d,F,F),F.z=0,S=Math.min(S,F.x),V=Math.max(V,F.x),Z=Math.min(Z,F.y),R=Math.max(R,F.y)}let E=i;E.x=S,E.y=Z,E.z=0,M.multiplyByPoint(l,E,E);let I=o;I.x=V,I.y=Z,I.z=0,M.multiplyByPoint(l,I,I),m.subtract(I,E,o);let v=r;v.x=S,v.y=R,v.z=0,M.multiplyByPoint(l,v,v),m.subtract(v,E,r)}var vwe=new m,Fwe=new m,Awe=new Bn;Zu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){C.typeOf.object("boundingRectangle",e),C.defined("textureCoordinateRotationPoints",t),C.typeOf.object("ellipsoid",n),C.typeOf.object("projection",i);let r=rie,s=vwe,a=Fwe;Pwe(e,n,o??0,r,s,a);let l={};iie(l,t);let d=Bn.fromCartesian(r,Awe);return l.southWest_HIGH=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.high,[0,0,0])}),l.southWest_LOW=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(d.low,[0,0,0])}),l.eastward=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(s,[0,0,0])}),l.northward=new dc({componentDatatype:q.FLOAT,componentsPerAttribute:3,normalize:!1,value:m.pack(a,[0,0,0])}),sie(e,i,l),l};var Mwe=new m;function eie(e,t,n,i){let o=oie;o.latitude=e,o.longitude=t,o.height=0;let r=pe.toCartesian(o,n,Mwe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=w.fastApproximateAtan2(s,r.z),l=w.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=l,i}var tie=new D;Zu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){C.typeOf.object("boundingRectangle",e),C.defined("textureCoordinateRotationPoints",t),C.typeOf.object("ellipsoid",n),C.typeOf.object("projection",i);let o=eie(e.south,e.west,n,tie),r=o.x,s=o.y,a=eie(e.north,e.east,n,tie),l=a.x,d=a.y,u=0;s>d&&(u=w.PI-s,s=-w.PI,d+=u),r-=w.EPSILON5,s-=w.EPSILON5,l+=w.EPSILON5,d+=w.EPSILON5;let f=1/(d-s),p=1/(l-r),y={sphericalExtents:new dc({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,f]}),longitudeRotation:new dc({componentDatatype:q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return iie(y,t),sie(e,i,y),y};Zu.hasAttributesForTextureCoordinatePlanes=function(e){return c(e.southWest_HIGH)&&c(e.southWest_LOW)&&c(e.northward)&&c(e.eastward)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};Zu.hasAttributesForSphericalExtents=function(e){return c(e.sphericalExtents)&&c(e.longitudeRotation)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};function Nwe(e){return Math.max(e.width,e.height)>Zu.MAX_WIDTH_FOR_PLANAR_EXTENTS}Zu.shouldUseSphericalCoordinates=function(e){return C.typeOf.object("rectangle",e),Nwe(e)};Zu.MAX_WIDTH_FOR_PLANAR_EXTENTS=w.toRadians(1);var pd=Zu;var z7t=_(T(),1);var k7t=_(T(),1);var kwe={NEVER:oe.NEVER,LESS:oe.LESS,EQUAL:oe.EQUAL,LESS_OR_EQUAL:oe.LEQUAL,GREATER:oe.GREATER,NOT_EQUAL:oe.NOTEQUAL,GREATER_OR_EQUAL:oe.GEQUAL,ALWAYS:oe.ALWAYS},On=Object.freeze(kwe);var D7t=_(T(),1);var Uwe={ZERO:oe.ZERO,KEEP:oe.KEEP,REPLACE:oe.REPLACE,INCREMENT:oe.INCR,DECREMENT:oe.DECR,INVERT:oe.INVERT,INCREMENT_WRAP:oe.INCR_WRAP,DECREMENT_WRAP:oe.DECR_WRAP},ft=Object.freeze(Uwe);var p5={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};p5.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:On.ALWAYS,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},backFunction:On.ALWAYS,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},reference:p5.CESIUM_3D_TILE_MASK,mask:p5.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(p5);function wx(e){e=e??z.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.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(wx.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}}});wx.isSupported=function(e){return e.context.stencilBuffer};function pC(e,t){let n=t?On.EQUAL:On.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:n,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},depthMask:!1}}function YY(e){return{stencilTest:{enabled:e,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var Owe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Dwe(e,t,n,i){if(c(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Oe.fromCache(pC(o,!1)),e._rsStencilDepthPass3DTiles=Oe.fromCache(pC(o,!0)),e._rsColorPass=Oe.fromCache(YY(o,!1)),e._rsPickPass=Oe.fromCache(Owe)}function Bwe(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=Be.replaceMain(s,"czm_non_compressed_main");let a=`void main() 
{ 
${r}    czm_non_compressed_main(); 
}`;return[i,o,s,a].join(`
`)}}function Ywe(e,t){let n=t.context,i=e._primitive,o=jE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=Bwe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",l=new Be({defines:[a],sources:[o]}),d=new Be({sources:[Q0]}),u=e._primitive._attributeLocations,f=new pd(s,r,e.appearance);if(e._spStencil=tn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let h=Be.createPickVertexShaderSource(o);h=In._appendShowToShader(i,h),h=In._updatePickColorAttribute(h);let g=f.createPickFragmentShader(!1),x=f.createPickVertexShader([a],h,!1,t.mapProjection);if(e._spPick=tn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:x,fragmentShaderSource:g,attributeLocations:u}),s){let S=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!c(S)){let V=f.createPickFragmentShader(!0),Z=f.createPickVertexShader([a],h,!0,t.mapProjection);S=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:Z,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=S}}else e._spPick=tn.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),l=new Be({defines:[a],sources:[o]}),e._sp=tn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:u});let p=f.createFragmentShader(!1),y=f.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=tn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:y,fragmentShaderSource:p,attributeLocations:u}),s){let h=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!c(h)){let g=f.createFragmentShader(!0),x=f.createVertexShader([a],o,!0,t.mapProjection);h=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:x,fragmentShaderSource:g,attributeLocations:u})}e._spColor2D=h}}function Hwe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o<i;o+=2){let y=n._va[a++];r=t[o],c(r)||(r=t[o]=new et({owner:e,primitiveType:n._primitiveType})),r.vertexArray=y,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=l,r.pass=Xe.TERRAIN_CLASSIFICATION,s=et.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],c(r)||(r=t[o+1]=new et({owner:e,primitiveType:n._primitiveType})),r.vertexArray=y,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Xe.TERRAIN_CLASSIFICATION;let g=e.appearance.material;if(c(g)&&(l=St(l,g._uniforms)),r.uniformMap=l,s=et.shallowClone(r,r.derivedCommands.tileset),s.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let x=et.shallowClone(r,r.derivedCommands.appearance2D);x.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=x,x=et.shallowClone(s,s.derivedCommands.appearance2D),x.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=x}}let u=e._commandsIgnoreShow,f=e._spStencil,p=0;i=u.length=i/2;for(let y=0;y<i;++y){let h=u[y]=et.shallowClone(t[p],u[y]);h.shaderProgram=f,h.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function zwe(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 l,d,u,f=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),y=e._needs2DShader;for(l=0;l<o;l+=2){let h=i._va[f++];if(n&&(a=r[s++],h=i._va[a.index]),d=t[l],c(d)||(d=t[l]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=h,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Xe.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=et.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[l+1],c(d)||(d=t[l+1]=new et({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=h,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Xe.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=et.shallowClone(d,d.derivedCommands.tileset),u.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,y){let g=et.shallowClone(d,d.derivedCommands.pick2D);g.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=g,g=et.shallowClone(u,u.derivedCommands.pick2D),g.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=g}}}function Kwe(e,t,n,i,o,r,s){Hwe(e,r),zwe(e,s)}function aie(e,t){return Math.floor(e%t/2)}function BY(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function cie(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function Jwe(e,t,n,i,o,r,s,a){let l=e._primitive;In._updateBoundingVolumes(l,t,o);let d;t.mode===se.SCENE3D?d=l._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?d=l._boundingSphereCV:t.mode===se.SCENE2D&&c(l._boundingSphere2D)?d=l._boundingSphere2D:c(l._boundingSphereMorph)&&(d=l._boundingSphereMorph);let u=e.classificationType,f=u!==Un.CESIUM_3D_TILE,p=u!==Un.TERRAIN,y=t.passes,h,g,x;if(y.render){let S=n.length;for(h=0;h<S;++h)g=d[aie(h,S)],f&&(x=n[h],BY(x,t,o,r,g,s)),p&&(x=n[h].derivedCommands.tileset,BY(x,t,o,r,g,s));if(t.invertClassification){let V=e._commandsIgnoreShow,Z=V.length;for(h=0;h<Z;++h)g=d[h],x=V[h],BY(x,t,o,r,g,s)}}if(y.pick){let S=i.length,V=l._pickOffsets;for(h=0;h<S;++h){let Z=V[aie(h,S)];g=d[Z.index],f&&(x=i[h],cie(x,t,o,r,g)),p&&(x=i[h].derivedCommands.tileset,cie(x,t,o,r,g))}}}wx.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;let t=this.appearance;c(t)&&c(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!c(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,l,d=!1,u=!0,f,p=!1,y=!1;for(r>0&&(l=o[0].attributes,p=pd.hasAttributesForSphericalExtents(l),y=pd.hasAttributesForTextureCoordinatePlanes(l),f=l.color),s=0;s<r;s++){a=o[s];let g=a.attributes.color;if(c(g))d=!0;else if(d)throw new L("All GeometryInstances must have color attributes to use per-instance color.");u=u&&c(g)&&Yt.equals(f,g)}if(!u&&!p&&!y)throw new L("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(d&&!c(t)&&(t=new an({flat:!0}),this.appearance=t),!d&&t instanceof an)throw new L("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(c(t.material)&&!p&&!y)throw new L("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!p&&!y,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=y,this._hasPerColorAttribute=d;let h=new Array(r);for(s=0;s<r;++s)a=o[s],h[s]=new Rt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=h,c(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(g,x){n._createBoundingVolumeFunction(g,x)}),i._createRenderStatesFunction=function(g,x,S,V){Dwe(n,x)},i._createShaderProgramFunction=function(g,x,S){Ywe(n,x)},i._createCommandsFunction=function(g,x,S,V,Z,R,E){Kwe(n,void 0,void 0,!0,!1,R,E)},c(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(g,x,S,V,Z,R,E,I){n._updateAndQueueCommandsFunction(g,x,S,V,Z,R,E,I)}:i._updateAndQueueCommandsFunction=function(g,x,S,V,Z,R,E,I){Jwe(n,x,S,V,Z,R,E,I)},this._primitive=new In(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Oe.fromCache(pC(!1,!1)),this._rsStencilDepthPass3DTiles=Oe.fromCache(pC(!1,!0)),this._rsColorPass=Oe.fromCache(YY(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Oe.fromCache(pC(!0,!1)),this._rsStencilDepthPass3DTiles=Oe.fromCache(pC(!0,!0)),this._rsColorPass=Oe.fromCache(YY(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&c(t.material))throw new L("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof an)throw new L("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};wx.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new L("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};wx.prototype.isDestroyed=function(){return!1};wx.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,he(this)};var bC=wx;var Qwe={u_globeMinimumAltitude:function(){return 55e3}};function Xl(e){e=e??z.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!c(t)&&c(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(c(a)&&c(a.color)){t=new an({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Un.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=ui._defaultMaxTerrainHeight,this._minTerrainHeight=ui._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:Qwe}}Object.defineProperties(Xl.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}}});Xl.isSupported=bC.isSupported;function lie(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function die(e){return function(t,n){return e._minHeight}}var jwe=new m,qwe=new m,$we=new m,ePe=new pe,tPe=new de;function b5(e,t){let n=e.mapProjection.ellipsoid;if(!c(t.attributes)||!c(t.attributes.position3DHigh))return c(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,l=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let f=0;f<r;f+=3){let p=m.unpack(i,f,jwe),y=m.unpack(o,f,qwe),h=m.add(p,y,$we),g=n.cartesianToCartographic(h,ePe),x=g.latitude,S=g.longitude;s=Math.min(s,x),a=Math.min(a,S),l=Math.max(l,x),d=Math.max(d,S)}let u=tPe;return u.north=l,u.south=s,u.east=d,u.west=a,u}function nPe(e,t,n){let i=ui.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function iPe(e,t,n){let i=t.mapProjection.ellipsoid,o=b5(t,n),r=Xn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ue.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);m.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function HY(e,t){return Math.floor(e%t/2)}function zY(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==se.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function uie(e,t,n,i,o,r){let s=e._primitive;n.mode!==se.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function oPe(e,t,n,i,o,r,s,a){let l;t.mode===se.SCENE3D?l=e._boundingVolumes:l=e._boundingVolumes2D;let d=e.classificationType,u=d!==Un.CESIUM_3D_TILE,f=d!==Un.TERRAIN,p=t.passes,y=e._primitive,h,g,x;if(p.render){let S=n.length;for(h=0;h<S;++h)g=l[HY(h,S)],u&&(x=n[h],zY(e,x,t,o,r,g,s)),f&&(x=n[h].derivedCommands.tileset,zY(e,x,t,o,r,g,s));if(t.invertClassification){let V=y._commandsIgnoreShow,Z=V.length;for(h=0;h<Z;++h)g=l[h],x=V[h],zY(e,x,t,o,r,g,s)}}if(p.pick){let S=i.length,V;for(e._useFragmentCulling||(V=y._primitive._pickOffsets),h=0;h<S;++h){if(g=l[HY(h,S)],!e._useFragmentCulling){let Z=V[HY(h,S)];g=l[Z.index]}u&&(x=i[h],uie(e,x,t,o,r,g)),f&&(x=i[h].derivedCommands.tileset,uie(e,x,t,o,r,g))}}}Xl.initializeTerrainHeights=function(){return ui.initialize()};Xl.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!ui.initialized){if(!this.asynchronous)throw new L("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");Xl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!c(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],l=a.length,d=new Array(l),u,f;for(u=0;u<l;++u){o=a[u],r=o.geometry;let g=b5(e,r);c(f)?c(g)&&de.union(f,g,f):f=de.clone(g);let x=o.id;if(c(x)&&c(g)){let S=ui.getBoundingSphere(g,i);this._boundingSpheresKeys.push(x),this._boundingSpheres.push(S)}if(s=r.constructor,!c(s)||!c(s.createShadowVolume))throw new L("Not all of the geometry instances have GroundPrimitive support.")}nPe(this,f,i);let p=e.verticalExaggeration,y=e.verticalExaggerationRelativeHeight;this._minHeight=Lr.getHeight(this._minTerrainHeight,p,y),this._maxHeight=Lr.getHeight(this._maxTerrainHeight,p,y);let h=Xl._supportsMaterials(e.context);if(this._useFragmentCulling=h,h){let g,x=!0;for(u=0;u<l;++u)if(o=a[u],r=o.geometry,f=b5(e,r),pd.shouldUseSphericalCoordinates(f)){x=!1;break}for(u=0;u<l;++u){o=a[u],r=o.geometry,s=r.constructor;let S=b5(e,r),V=r.textureCoordinateRotationPoints;x?g=pd.getPlanarTextureCoordinateAttributes(S,V,i,e.mapProjection,this._maxHeight):g=pd.getSphericalExtentGeometryInstanceAttributes(S,V,i,e.mapProjection);let Z=o.attributes;for(let R in Z)Z.hasOwnProperty(R)&&(g[R]=Z[R]);d[u]=new Rt({geometry:s.createShadowVolume(r,die(this),lie(this)),attributes:g,id:o.id})}}else for(u=0;u<l;++u)o=a[u],r=o.geometry,s=r.constructor,d[u]=new Rt({geometry:s.createShadowVolume(r,die(this),lie(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(g,x){iPe(t,g,x)},n._updateAndQueueCommandsFunction=function(g,x,S,V,Z,R,E,I){oPe(t,x,S,V,Z,R,E,I)},this._primitive=new bC(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&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Xl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Xl.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new L("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Xl.prototype.isDestroyed=function(){return!1};Xl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};Xl._supportsMaterials=function(e){return e.depthTexture};Xl.supportsMaterials=function(e){return C.typeOf.object("scene",e),Xl._supportsMaterials(e.frameState.context)};var kc=Xl;var H6t=_(T(),1);function yC(){L.throwInstantiationError()}Object.defineProperties(yC.prototype,{isConstant:{get:L.throwInstantiationError},definitionChanged:{get:L.throwInstantiationError}});yC.prototype.getType=L.throwInstantiationError;yC.prototype.getValue=L.throwInstantiationError;yC.prototype.equals=L.throwInstantiationError;var rPe=new ee;yC.getValue=function(e,t,n){let i;return c(e)||(e=ee.now(rPe)),c(t)&&(i=t.getType(e),c(i))?((!c(n)||n.type!==i)&&(n=zi.fromType(i)),t.getValue(e,n.uniforms),n):((!c(n)||n.type!==zi.ColorType)&&(n=zi.fromType(zi.ColorType)),Y.clone(Y.WHITE,n.uniforms.color),n)};var qo=yC;function Px(e,t,n){C.defined("geometryUpdater",e),C.defined("primitives",t),C.defined("orderedGroundPrimitives",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}Px.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!J.getValueOrDefault(t.show,n,!0)};Px.prototype._setOptions=L.throwInstantiationError;Px.prototype.update=function(e){C.defined("time",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),l=this._options;if(!c(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Ut,f,p=t._getIsClosed(l);if(u)f=new an({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let y=qo.getValue(e,d,this._material);this._material=y,f=new so({material:y,translucent:y.isTranslucent(),closed:p})}if(n)l.vertexFormat=an.VERTEX_FORMAT,this._primitive=o.add(new kc({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:f,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),J.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=f.vertexFormat;let y=this._geometryUpdater.createFillGeometryInstance(e);u&&(f.translucent=y.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:y,appearance:f,asynchronous:!1,shadows:a}))}}if(!n&&c(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=J.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:d,appearance:new an({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};Px.prototype.getBoundingSphere=function(e){if(!c(e))throw new L("result is required.");let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return c(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(ue.clone(o.boundingSphere,e),ut.DONE):c(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(ue.clone(o.boundingSphere,e),ut.DONE):c(n)&&!n.ready||c(i)&&!i.ready?ut.PENDING:ut.FAILED};Px.prototype.isDestroyed=function(){return!1};Px.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),he(this)};var ii=Px;var orn=_(T(),1);var uqt=_(T(),1);var mie={};function nX(e,t){if(!c(e))throw new L("identifier is required.");c(mie[e])||(mie[e]=!0,console.warn(t??e))}nX.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.";nX.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored";nX.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored";nX.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored";var ht=nX;var Uon=_(T(),1);var fqt=_(T(),1),sPe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},vp=Object.freeze(sPe);var Sen=_(T(),1);var d$t=_(T(),1);var pqt=_(T(),1),aPe={NONE:0,GEODESIC:1,RHUMB:2},Kt=Object.freeze(aPe);var _qt=_(T(),1);var fie=w.EPSILON10;function cPe(e,t,n,i){if(C.defined("equalsEpsilon",t),!c(e))return;n=n??!1;let o=c(i),r=e.length;if(r<2)return e;let s,a=e[0],l,d,u=0,f=-1;for(s=1;s<r;++s)l=e[s],t(a,l,fie)?(c(d)||(d=e.slice(0,s),u=s-1,f=0),o&&i.push(s)):(c(d)&&(d.push(l),u=s,o&&(f=i.length)),a=l);return n&&t(e[0],e[r-1],fie)&&(o&&(c(d)?i.splice(f,0,u):i.push(r-1)),c(d)?d.length-=1:d=e.slice(0,-1)),c(d)?d:e}var xo=cPe;var Gqt=_(T(),1);function lPe(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),l=1/Math.sqrt(1+a*a),d=l*a,u=Math.atan2(a,r),f=l*s,p=f*f,y=1-p,h=Math.sqrt(y),g=t/4,x=g*g,S=x*g,V=x*x,Z=1+g-3*x/4+5*S/4-175*V/64,R=1-g+15*x/8-35*S/8,E=1-3*g+35*x/4,I=1-5*g,v=Z*u-R*Math.sin(2*u)*g/2-E*Math.sin(4*u)*x/16-I*Math.sin(6*u)*S/48-Math.sin(8*u)*5*V/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=r,P.sineHeading=s,P.tanU=a,P.cosineU=l,P.sineU=d,P.sigma=u,P.sineAlpha=f,P.sineSquaredAlpha=p,P.cosineSquaredAlpha=y,P.cosineAlpha=h,P.u2Over4=g,P.u4Over16=x,P.u6Over64=S,P.u8Over256=V,P.a0=Z,P.a1=R,P.a2=E,P.a3=I,P.distanceRatio=v}function dPe(e,t){return e*t*(4+e*(4-3*t))/16}function hie(e,t,n,i,o,r,s){let a=dPe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function uPe(e,t,n,i,o,r,s){let a=(t-n)/t,l=r-i,d=Math.atan((1-a)*Math.tan(o)),u=Math.atan((1-a)*Math.tan(s)),f=Math.cos(d),p=Math.sin(d),y=Math.cos(u),h=Math.sin(u),g=f*y,x=f*h,S=p*h,V=p*y,Z=l,R=w.TWO_PI,E=Math.cos(Z),I=Math.sin(Z),v,P,F,N,b;do{E=Math.cos(Z),I=Math.sin(Z);let U=x-V*E;F=Math.sqrt(y*y*I*I+U*U),P=S+g*E,v=Math.atan2(F,P);let K;F===0?(K=0,N=1):(K=g*I/F,N=1-K*K),R=Z,b=P-2*S/N,isFinite(b)||(b=0),Z=l+hie(a,K,N,v,F,P,b)}while(Math.abs(Z-R)>w.EPSILON12);let G=N*(t*t-n*n)/(n*n),X=1+G*(4096+G*(G*(320-175*G)-768))/16384,W=G*(256+G*(G*(74-47*G)-128))/1024,A=b*b,k=W*F*(b+W*(P*(2*A-1)-W*b*(4*F*F-3)*(4*A-3)/6)/4),B=n*X*(v-k),O=Math.atan2(y*I,x-V*E),H=Math.atan2(f*I,x*E-V);e._distance=B,e._startHeading=O,e._endHeading=H,e._uSquared=G}var mPe=new m,KY=new m;function pie(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,KY),mPe),r=m.normalize(i.cartographicToCartesian(n,KY),KY);C.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(m.angleBetween(o,r))-Math.PI),.0125),uPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=pe.clone(t,e._start),e._end=pe.clone(n,e._end),e._start.height=0,e._end.height=0,lPe(e)}function iX(e,t,n){let i=n??re.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,c(e)&&c(t)&&pie(this,e,t,i)}Object.defineProperties(iX.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return C.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return C.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return C.defined("distance",this._distance),this._endHeading}}});iX.prototype.setEndPoints=function(e,t){C.defined("start",e),C.defined("end",t),pie(this,e,t,this._ellipsoid)};iX.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};iX.prototype.interpolateUsingSurfaceDistance=function(e,t){C.defined("distance",this._distance);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),l=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),f=i*i,p=i*f,y=n.u8Over256,h=n.u2Over4,g=n.u6Over64,x=n.u4Over16,S=2*p*y*o/3+i*(1-h+7*x/4-15*g/4+579*y/64-(x-15*g/4+187*y/16)*o-(5*g/4-115*y/16)*r-29*y*s/16)+(h/2-x+71*g/32-85*y/16)*a+(5*x/16-5*g/4+383*y/96)*l-f*((g-11*y/2)*a+5*y*l/2)+(29*g/96-29*y/16)*d+539*y*u/1536,V=Math.asin(Math.sin(S)*n.cosineAlpha),Z=Math.atan(n.a/n.b*Math.tan(V));S=S-n.sigma;let R=Math.cos(2*n.sigma+S),E=Math.sin(S),I=Math.cos(S),v=n.cosineU*I,P=n.sineU*E,N=Math.atan2(E*n.sineHeading,v-P*n.cosineHeading)-hie(n.f,n.sineAlpha,n.cosineSquaredAlpha,S,E,I,R);return c(t)?(t.longitude=this._start.longitude+N,t.latitude=Z,t.height=0,t):new pe(this._start.longitude+N,Z,0)};var Fp=iX;var Aqt=_(T(),1);function QY(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,l=a*i,d=n,u=Math.sin(2*d),f=Math.sin(4*d),p=Math.sin(6*d),y=Math.sin(8*d),h=Math.sin(10*d),g=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*l/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*l/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*l/8388608)*f-(35*r/3072+175*s/12288+3675*a/262144+13475*l/1048576)*p+(315*s/131072+2205*a/524288+43659*l/8388608)*y-(693*a/1310720+6237*l/5242880)*h+1001*l/8388608*g)}function fPe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,l=a*a,d=l*l,u=d*l,f=u*l,p=f*l,y=p*l,h=Math.sin(2*i),g=Math.cos(2*i),x=Math.sin(4*i),S=Math.cos(4*i),V=Math.sin(6*i),Z=Math.cos(6*i),R=Math.sin(8*i),E=Math.cos(8*i),I=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*l/4+7*i*d/64+15*i*u/256+579*i*f/16384+1515*i*p/65536+16837*i*y/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*f/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*y/5242880)*g+(21*i*u/256+483*i*f/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*y/1048576)*S+(151*i*f/4096+4681*i*p/65536+1479*i*y/16384-453*r*y/32768)*Z+(1097*i*p/65536+42783*i*y/1048576)*E+8011*i*y/1048576*v+(3*l/8+3*d/16+213*u/2048-3*o*u/64+255*f/4096-33*o*f/512+20861*p/524288-33*o*p/512+s*p/1024+28273*y/1048576-471*o*y/8192+9*s*y/4096)*h+(21*d/256+21*u/256+533*f/8192-21*o*f/512+197*p/4096-315*o*p/4096+584039*y/16777216-12517*o*y/131072+7*s*y/2048)*x+(151*u/6144+151*f/4096+5019*p/131072-453*o*p/16384+26965*y/786432-8607*o*y/131072)*V+(1097*f/131072+1097*p/65536+225797*y/10485760-1097*o*y/65536)*R+(8011*p/2621440+8011*y/1048576)*I+293393*y/251658240*P}function gC(e,t){if(e===0)return Math.log(Math.tan(.5*(w.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(w.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function hPe(e,t,n,i,o){let r=gC(e._ellipticity,n),s=gC(e._ellipticity,o);return Math.atan2(w.negativePiToPi(i-t),s-r)}function pPe(e,t,n,i,o,r,s){let a=e._heading,l=r-i,d=0;if(w.equalsEpsilon(Math.abs(a),w.PI_OVER_TWO,w.EPSILON8))if(t===n)d=t*Math.cos(o)*w.negativePiToPi(l);else{let u=Math.sin(o);d=t*Math.cos(o)*w.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=QY(e._ellipticity,t,o);d=(QY(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var bPe=new m,JY=new m;function bie(e,t,n,i){let o=m.normalize(i.cartographicToCartesian(t,JY),bPe),r=m.normalize(i.cartographicToCartesian(n,JY),JY);C.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(m.angleBetween(o,r))-Math.PI),.0125);let s=i.maximumRadius,a=i.minimumRadius,l=s*s,d=a*a;e._ellipticitySquared=(l-d)/l,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=pe.clone(t,e._start),e._start.height=0,e._end=pe.clone(n,e._end),e._end.height=0,e._heading=hPe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=pPe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function yie(e,t,n,i,o,r){if(n===0)return pe.clone(e,r);let s=o*o,a,l,d;if(Math.abs(w.PI_OVER_TWO-Math.abs(t))>w.EPSILON8){let u=QY(o,i,e.latitude),f=n*Math.cos(t),p=u+f;if(l=fPe(p,o,i),Math.abs(t)<w.EPSILON10)a=w.negativePiToPi(e.longitude);else{let y=gC(o,e.latitude),h=gC(o,l);d=Math.tan(t)*(h-y),a=w.negativePiToPi(e.longitude+d)}}else{l=e.latitude;let u;if(o===0)u=i*Math.cos(e.latitude);else{let f=Math.sin(e.latitude);u=i*Math.cos(e.latitude)/Math.sqrt(1-s*f*f)}d=n/u,t>0?a=w.negativePiToPi(e.longitude+d):a=w.negativePiToPi(e.longitude-d)}return c(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new pe(a,l,0)}function Ap(e,t,n){let i=n??re.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,c(e)&&c(t)&&bie(this,e,t,i)}Object.defineProperties(Ap.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return C.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return C.defined("distance",this._distance),this._heading}}});Ap.fromStartHeadingDistance=function(e,t,n,i,o){C.defined("start",e),C.defined("heading",t),C.defined("distance",n),C.typeOf.number.greaterThan("distance",n,0);let r=i??re.default,s=r.maximumRadius,a=r.minimumRadius,l=s*s,d=a*a,u=Math.sqrt((l-d)/l);t=w.negativePiToPi(t);let f=yie(e,t,n,r.maximumRadius,u);return!c(o)||c(i)&&!i.equals(o.ellipsoid)?new Ap(e,f,r):(o.setEndPoints(e,f),o)};Ap.prototype.setEndPoints=function(e,t){C.defined("start",e),C.defined("end",t),bie(this,e,t,this._ellipsoid)};Ap.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Ap.prototype.interpolateUsingSurfaceDistance=function(e,t){if(C.typeOf.number("distance",e),!c(this._distance)||this._distance===0)throw new L("EllipsoidRhumbLine must have distinct start and end set.");return yie(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Ap.prototype.findIntersectionWithLongitude=function(e,t){if(C.typeOf.number("intersectionLongitude",e),!c(this._distance)||this._distance===0)throw new L("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=w.negativePiToPi(e),w.equalsEpsilon(Math.abs(e),Math.PI,w.EPSILON14)&&(e=w.sign(r.longitude)*Math.PI),c(t)||(t=new pe),Math.abs(w.PI_OVER_TWO-o)<=w.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(w.equalsEpsilon(Math.abs(w.PI_OVER_TWO-o),w.PI_OVER_TWO,w.EPSILON8))return w.equalsEpsilon(e,r.longitude,w.EPSILON12)?void 0:(t.longitude=e,t.latitude=w.PI_OVER_TWO*w.sign(w.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),l=Math.tan(.5*(w.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,f;do{f=u;let p=n*Math.sin(f),y=(1+p)/(1-p);u=2*Math.atan(l*Math.pow(y/d,n/2))-w.PI_OVER_TWO}while(!w.equalsEpsilon(u,f,w.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};Ap.prototype.findIntersectionWithLatitude=function(e,t){if(C.typeOf.number("intersectionLatitude",e),!c(this._distance)||this._distance===0)throw new L("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=this._start;if(w.equalsEpsilon(Math.abs(i),w.PI_OVER_TWO,w.EPSILON8))return;let r=gC(n,o.latitude),s=gC(n,e),a=Math.tan(i)*(s-r),l=w.negativePiToPi(o.longitude+a);return c(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new pe(l,e,0)};var va=Ap;var oH=[Xi,Wi],yPe=oH.length,Aie=Math.cos(w.toRadians(30)),gie=Math.cos(w.toRadians(150)),Mie=0,Nie=1e3;function q0(e){e=e??z.EMPTY_OBJECT;let t=e.positions;if(!c(t)||t.length<2)throw new L("At least two positions are required.");if(c(e.arcType)&&e.arcType!==Kt.GEODESIC&&e.arcType!==Kt.RHUMB)throw new L("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??Kt.GEODESIC,this._ellipsoid=re.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(q0.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+re.packedLength+1+1}}});q0.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<yPe;i++)if(t instanceof oH[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var gPe=new m,xie=new m,_ie=new m;function iH(e,t,n,i,o){let r=Uc(i,e,0,gPe),s=Uc(i,e,n,xie),a=Uc(i,t,0,_ie),l=Mp(s,r,xie),d=Mp(a,r,_ie);return m.cross(d,l,o),m.normalize(o,o)}var xPe=new pe,_Pe=new m,TPe=new m,SPe=new m;function jY(e,t,n,i,o,r,s,a,l,d,u){if(o===0)return;let f;r===Kt.GEODESIC?f=new Fp(e,t,s):r===Kt.RHUMB&&(f=new va(e,t,s));let p=f.surfaceDistance;if(p<o)return;let y=iH(e,t,i,s,SPe),h=Math.ceil(p/o),g=p/h,x=g,S=h-1,V=a.length;for(let Z=0;Z<S;Z++){let R=f.interpolateUsingSurfaceDistance(x,xPe),E=Uc(s,R,n,_Pe),I=Uc(s,R,i,TPe);m.pack(y,a,V),m.pack(E,l,V),m.pack(I,d,V),u.push(R.latitude),u.push(R.longitude),V+=3,x+=g}}var qY=new pe;function Uc(e,t,n,i){return pe.clone(t,qY),qY.height=n,pe.toCartesian(qY,e,i)}q0.pack=function(e,t,n){C.typeOf.object("value",e),C.defined("array",t);let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];m.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,re.pack(e._ellipsoid,t,i),i+=re.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};q0.unpack=function(e,t,n){C.defined("array",e);let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=m.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,l=e[i++],d=re.unpack(e,i);i+=re.packedLength;let u=e[i++],f=e[i++]===1;return c(n)||(n=new q0({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=l,n._ellipsoid=d,n._projectionIndex=u,n._scene3DOnly=f,n};function Mp(e,t,n){return m.subtract(e,t,n),m.normalize(n,n),n}function Tie(e,t,n,i){return i=Mp(e,t,i),i=m.cross(i,n,i),i=m.normalize(i,i),i=m.cross(n,i,i),i}var CPe=new m,VPe=new m,LPe=new m,kie=new m,ZPe=0,RPe=-1;function $Y(e,t,n,i,o){let r=Mp(n,t,kie),s=Tie(e,t,r,CPe),a=Tie(i,t,r,VPe);if(w.equalsEpsilon(m.dot(s,a),RPe,w.EPSILON5))return o=m.cross(r,s,o),o=m.normalize(o,o),o;o=m.add(a,s,o),o=m.normalize(o,o);let l=m.cross(r,o,LPe);return m.dot(a,l)<ZPe&&(o=m.negate(o,o)),o}var _5=cn.fromPointNormal(m.ZERO,m.UNIT_Y),GPe=new m,EPe=new m,XPe=new m,IPe=new m,WPe=new m,y5=new m,g5=new pe,Sie=new pe,Cie=new pe;q0.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new oH[e._projectionIndex](i),a=Mie,l=Nie,d,u,f=e._positions,p=f.length;p===2&&(n=!1);let y,h,g,x,S=new va(void 0,void 0,i),V,Z,R,E=[f[0]];for(u=0;u<p-1;u++)y=f[u],h=f[u+1],V=qn.lineSegmentPlane(y,h,_5,y5),c(V)&&!m.equalsEpsilon(V,y,w.EPSILON7)&&!m.equalsEpsilon(V,h,w.EPSILON7)&&(e.arcType===Kt.GEODESIC?E.push(m.clone(V)):e.arcType===Kt.RHUMB&&(R=i.cartesianToCartographic(V,g5).longitude,g=i.cartesianToCartographic(y,g5),x=i.cartesianToCartographic(h,Sie),S.setEndPoints(g,x),Z=S.findIntersectionWithLongitude(R,Cie),V=i.cartographicToCartesian(Z,y5),c(V)&&!m.equalsEpsilon(V,y,w.EPSILON7)&&!m.equalsEpsilon(V,h,w.EPSILON7)&&E.push(m.clone(V)))),E.push(h);n&&(y=f[p-1],h=f[0],V=qn.lineSegmentPlane(y,h,_5,y5),c(V)&&!m.equalsEpsilon(V,y,w.EPSILON7)&&!m.equalsEpsilon(V,h,w.EPSILON7)&&(e.arcType===Kt.GEODESIC?E.push(m.clone(V)):e.arcType===Kt.RHUMB&&(R=i.cartesianToCartographic(V,g5).longitude,g=i.cartesianToCartographic(y,g5),x=i.cartesianToCartographic(h,Sie),S.setEndPoints(g,x),Z=S.findIntersectionWithLongitude(R,Cie),V=i.cartographicToCartesian(Z,y5),c(V)&&!m.equalsEpsilon(V,y,w.EPSILON7)&&!m.equalsEpsilon(V,h,w.EPSILON7)&&E.push(m.clone(V)))));let I=E.length,v=new Array(I);for(u=0;u<I;u++){let Q=pe.fromCartesian(E[u],i);Q.height=0,v[u]=Q}if(v=xo(v,pe.equalsEpsilon),I=v.length,I<2)return;let P=[],F=[],N=[],b=[],G=GPe,X=EPe,W=XPe,A=IPe,k=WPe,B=v[0],O=v[1],H=v[I-1];for(G=Uc(i,H,a,G),A=Uc(i,O,a,A),X=Uc(i,B,a,X),W=Uc(i,B,l,W),n?k=$Y(G,X,W,A,k):k=iH(B,O,l,i,k),m.pack(k,F,0),m.pack(X,N,0),m.pack(W,b,0),P.push(B.latitude),P.push(B.longitude),jY(B,O,a,l,o,r,i,F,N,b,P),u=1;u<I-1;++u){G=m.clone(X,G),X=m.clone(A,X);let Q=v[u];Uc(i,Q,l,W),Uc(i,v[u+1],a,A),$Y(G,X,W,A,k),d=F.length,m.pack(k,F,d),m.pack(X,N,d),m.pack(W,b,d),P.push(Q.latitude),P.push(Q.longitude),jY(v[u],v[u+1],a,l,o,r,i,F,N,b,P)}let U=v[I-1],K=v[I-2];if(X=Uc(i,U,a,X),W=Uc(i,U,l,W),n){let Q=v[0];G=Uc(i,K,a,G),A=Uc(i,Q,a,A),k=$Y(G,X,W,A,k)}else k=iH(K,U,l,i,k);if(d=F.length,m.pack(k,F,d),m.pack(X,N,d),m.pack(W,b,d),P.push(U.latitude),P.push(U.longitude),n){for(jY(U,B,a,l,o,r,i,F,N,b,P),d=F.length,u=0;u<3;++u)F[d+u]=F[u],N[d+u]=N[u],b[d+u]=b[u];P.push(B.latitude),P.push(B.longitude)}return o2e(n,s,N,b,F,P,t)};var wPe=new m,PPe=new te,vPe=new Fe;function Vie(e,t,n,i){let o=Mp(n,t,wPe),r=m.dot(o,e);if(r>Aie||r<gie){let s=Mp(i,n,kie),a=r<gie?w.PI_OVER_TWO:-w.PI_OVER_TWO,l=Fe.fromAxisAngle(s,a,vPe),d=te.fromQuaternion(l,PPe);return te.multiplyByVector(d,e,e),!0}return!1}var Lie=new pe,FPe=new m,Zie=new m;function oX(e,t,n,i,o){let r=pe.toCartesian(t,e._ellipsoid,FPe),s=m.add(r,n,Zie),a=!1,l=e._ellipsoid,d=l.cartesianToCartographic(s,Lie);Math.abs(t.longitude-d.longitude)>w.PI_OVER_TWO&&(a=!0,s=m.subtract(r,n,Zie),d=l.cartesianToCartographic(s,Lie)),d.height=0;let u=e.project(d,o);return o=m.subtract(u,i,o),o.z=0,o=m.normalize(o,o),a&&m.negate(o,o),o}var APe=new m,Rie=new m;function Gie(e,t,n,i,o,r){let s=m.subtract(t,e,APe);m.normalize(s,s);let a=n-Mie,l=m.multiplyByScalar(s,a,Rie);m.add(e,l,o);let d=i-Nie;l=m.multiplyByScalar(s,d,Rie),m.add(t,l,r)}var MPe=new m;function x5(e,t){let n=cn.getPointDistance(_5,e),i=cn.getPointDistance(_5,t),o=MPe;w.equalsEpsilon(n,0,w.EPSILON2)?(o=Mp(t,e,o),m.multiplyByScalar(o,w.EPSILON2,o),m.add(e,o,e)):w.equalsEpsilon(i,0,w.EPSILON2)&&(o=Mp(e,t,o),m.multiplyByScalar(o,w.EPSILON2,o),m.add(t,o,t))}function NPe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(w.equalsEpsilon(n,w.PI,w.EPSILON11)){let o=w.sign(t.longitude);return e.longitude=o*(n-w.EPSILON11),1}else if(w.equalsEpsilon(i,w.PI,w.EPSILON11)){let o=w.sign(e.longitude);return t.longitude=o*(i-w.EPSILON11),2}return 0}var Uie=new pe,Oie=new pe,Eie=new m,eH=new m,Xie=new m,Iie=new m,kPe=new m,Wie=new m,UPe=[Uie,Oie],OPe=new de,DPe=new m,BPe=new m,YPe=new m,HPe=new m,zPe=new m,KPe=new m,tH=new m,nH=new m,JPe=new m,QPe=new m,jPe=new m,wie=new m,qPe=new m,$Pe=new m,e2e=new Bn,t2e=new Bn,Pie=new m,n2e=new m,vie=new m,i2e=[new ue,new ue],Die=[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],Fie=Die.length;function o2e(e,t,n,i,o,r,s){let a,l,d=t._ellipsoid,u=n.length/3-1,f=u*8,p=f*4,y=u*36,h=f>65535?new Uint32Array(y):new Uint16Array(y),g=new Float64Array(f*3),x=new Float32Array(p),S=new Float32Array(p),V=new Float32Array(p),Z=new Float32Array(p),R=new Float32Array(p),E,I,v,P;s&&(E=new Float32Array(p),I=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(f*2));let F=r.length/2,N=0,b=Uie;b.height=0;let G=Oie;G.height=0;let X=Eie,W=eH;if(s)for(l=0,a=1;a<F;a++)b.latitude=r[l],b.longitude=r[l+1],G.latitude=r[l+2],G.longitude=r[l+3],X=t.project(b,X),W=t.project(G,W),N+=m.distance(X,W),l+=2;let A=i.length/3;W=m.unpack(i,0,W);let k=0;for(l=3,a=1;a<A;a++)X=m.clone(W,X),W=m.unpack(i,l,W),k+=m.distance(X,W),l+=3;let B;l=3;let O=0,H=0,U=0,K=0,Q=!1,ie=m.unpack(n,0,Iie),j=m.unpack(i,0,eH),$=m.unpack(o,0,Wie);if(e){let Ze=m.unpack(n,n.length-6,Xie);Vie($,Ze,ie,j)&&($=m.negate($,$))}let ne=0,be=0,Ce=0;for(a=0;a<u;a++){let Ze=m.clone(ie,Xie),De=m.clone(j,Eie),Ke=m.clone($,kPe);Q&&(Ke=m.negate(Ke,Ke)),ie=m.unpack(n,l,Iie),j=m.unpack(i,l,eH),$=m.unpack(o,l,Wie),Q=Vie($,Ze,ie,j),b.latitude=r[O],b.longitude=r[O+1],G.latitude=r[O+2],G.longitude=r[O+3];let rt,Xt,Ht,qe;if(s){let bi=NPe(b,G);rt=t.project(b,zPe),Xt=t.project(G,KPe);let sa=Mp(Xt,rt,Pie);sa.y=Math.abs(sa.y),Ht=tH,qe=nH,bi===0||m.dot(sa,m.UNIT_Y)>Aie?(Ht=oX(t,b,Ke,rt,tH),qe=oX(t,G,$,Xt,nH)):bi===1?(qe=oX(t,G,$,Xt,nH),Ht.x=0,Ht.y=w.sign(b.longitude-Math.abs(G.longitude)),Ht.z=0):(Ht=oX(t,b,Ke,rt,tH),qe.x=0,qe.y=w.sign(b.longitude-G.longitude),qe.z=0)}let mn=m.distance(De,j),Dt=Bn.fromCartesian(Ze,e2e),Lt=m.subtract(ie,Ze,JPe),Vi=m.normalize(Lt,wie),ln=m.subtract(De,Ze,QPe);ln=m.normalize(ln,ln);let ge=m.cross(Vi,ln,wie);ge=m.normalize(ge,ge);let Le=m.cross(ln,Ke,qPe);Le=m.normalize(Le,Le);let yn=m.subtract(j,ie,jPe);yn=m.normalize(yn,yn);let bt=m.cross($,yn,$Pe);bt=m.normalize(bt,bt);let ro=mn/k,Xo=ne/k,ra=0,Wr,_s,Ae,st=0,Qe=0;if(s){ra=m.distance(rt,Xt),Wr=Bn.fromCartesian(rt,t2e),_s=m.subtract(Xt,rt,Pie),Ae=m.normalize(_s,n2e);let bi=Ae.x;Ae.x=Ae.y,Ae.y=-bi,st=ra/N,Qe=be/N}for(B=0;B<8;B++){let bi=K+B*4,sa=H+B*2,Qr=bi+3,xl=B<4?1:-1,yo=B===2||B===3||B===6||B===7?1:-1;m.pack(Dt.high,x,bi),x[Qr]=Lt.x,m.pack(Dt.low,S,bi),S[Qr]=Lt.y,m.pack(Le,V,bi),V[Qr]=Lt.z,m.pack(bt,Z,bi),Z[Qr]=ro*xl,m.pack(ge,R,bi);let wr=Xo*yo;wr===0&&yo<0&&(wr=9),R[Qr]=wr,s&&(E[bi]=Wr.high.x,E[bi+1]=Wr.high.y,E[bi+2]=Wr.low.x,E[bi+3]=Wr.low.y,v[bi]=-Ht.y,v[bi+1]=Ht.x,v[bi+2]=qe.y,v[bi+3]=-qe.x,I[bi]=_s.x,I[bi+1]=_s.y,I[bi+2]=Ae.x,I[bi+3]=Ae.y,P[sa]=st*xl,wr=Qe*yo,wr===0&&yo<0&&(wr=9),P[sa+1]=wr)}let $e=YPe,yt=HPe,Bt=DPe,Ln=BPe,Io=de.fromCartographicArray(UPe,OPe),To=ui.getMinimumMaximumHeights(Io,d),Ka=To.minimumTerrainHeight,Ja=To.maximumTerrainHeight;Ce+=Math.abs(Ka),Ce+=Math.abs(Ja),Gie(Ze,De,Ka,Ja,$e,Bt),Gie(ie,j,Ka,Ja,yt,Ln);let Li=m.multiplyByScalar(ge,w.EPSILON5,vie);m.add($e,Li,$e),m.add(yt,Li,yt),m.add(Bt,Li,Bt),m.add(Ln,Li,Ln),x5($e,yt),x5(Bt,Ln),m.pack($e,g,U),m.pack(yt,g,U+3),m.pack(Ln,g,U+6),m.pack(Bt,g,U+9),Li=m.multiplyByScalar(ge,-2*w.EPSILON5,vie),m.add($e,Li,$e),m.add(yt,Li,yt),m.add(Bt,Li,Bt),m.add(Ln,Li,Ln),x5($e,yt),x5(Bt,Ln),m.pack($e,g,U+12),m.pack(yt,g,U+15),m.pack(Ln,g,U+18),m.pack(Bt,g,U+21),O+=2,l+=3,H+=16,U+=24,K+=32,ne+=mn,be+=ra}l=0;let me=0;for(a=0;a<u;a++){for(B=0;B<Fie;B++)h[l+B]=Die[B]+me;me+=8,l+=Fie}let _e=i2e;ue.fromVertices(n,m.ZERO,3,_e[0]),ue.fromVertices(i,m.ZERO,3,_e[1]);let Ve=ue.fromBoundingSpheres(_e);Ve.radius+=Ce/(u*2);let Ie={position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:g}),startHiAndForwardOffsetX:j0(x),startLoAndForwardOffsetY:j0(S),startNormalAndForwardOffsetZ:j0(V),endNormalAndTextureCoordinateNormalizationX:j0(Z),rightNormalAndTextureCoordinateNormalizationY:j0(R)};return s&&(Ie.startHiLo2D=j0(E),Ie.offsetAndRight2D=j0(I),Ie.startEndNormals2D=j0(v),Ie.texcoordNormalization2D=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new dt({attributes:Ie,indices:h,boundingSphere:Ve})}function j0(e){return new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}q0._projectNormal=oX;var vx=q0;var m$t=_(T(),1),rX=`in vec4 v_startPlaneNormalEcAndHalfWidth;
in vec4 v_endPlaneNormalEcAndBatchId;
in vec4 v_rightPlaneEC;
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);
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);
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
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
}
vec3 alignedPlaneNormal;
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
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
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
out_FragColor.rgb *= out_FragColor.a;
czm_writeDepthClamp();
}
`;var h$t=_(T(),1),sX=`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) {
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
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);
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 b$t=_(T(),1),aX=`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;
#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
void main()
{
v_batchId = batchId;
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;
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);
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);
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));
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);
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
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
vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow);
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));
vec3 normalEC = normalize(cross(planeDirection, upOrDown));
vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
positionEc3D.xyz += geodeticSurfaceNormal;
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC;
vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
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));
normalEC = normalize(cross(planeDirection, upOrDown));
geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
positionEc2D.xyz += geodeticSurfaceNormal;
normalEC *= sign(texcoordNormalization2D.x);
#ifndef PER_INSTANCE_COLOR
v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
#endif
positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC;
gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
#ifdef ANGLE_VARYING
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 g$t=_(T(),1),cX=`in vec3 position3DHigh;
in vec3 position3DLow;
#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;
#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);
v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
vec4 startPlaneEC;
startPlaneEC.xyz =  czm_normal * vec3(0.0, startEndNormals2D.xy);
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
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);
vec4 startPlaneEC;
startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
vec4 endPlaneEC;
endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
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
vec4 positionRelativeToEye = czm_computePosition();
vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;
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));
vec3 normalEC = normalize(cross(planeDirection, upOrDown));
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));
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 = width / dot(normalEC, v_rightPlaneEC.xyz);
#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
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 I$t=_(T(),1);var _$t=_(T(),1),lX=`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 S$t=_(T(),1),bd=`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);
float endPoint0Distance =  czm_currentFrustum.x + p0.z;
float denominator = -direction.z;
if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
{
culledByNearPlane = true;
}
else if (endPoint0Distance > 0.0)
{
float t = endPoint0Distance / denominator;
if (t < 0.0 || t > magnitude)
{
culledByNearPlane = true;
}
else
{
p0 = p0 + t * direction;
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)
{
#ifdef POLYLINE_DASH
vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
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;
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 (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;
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);
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 rH=`${bd}
${lX}`,r2e=Xx;Ot.isInternetExplorer()||(rH=`#define CLIP_POLYLINE 
${rH}`);function Fx(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Fx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??rH,this._fragmentShaderSource=e.fragmentShaderSource??r2e,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Fx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Fx.VERTEX_FORMAT=We.POSITION_ONLY;Fx.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Fx.prototype.isTranslucent=no.prototype.isTranslucent;Fx.prototype.getRenderState=no.prototype.getRenderState;var es=Fx;var H$t=_(T(),1);var w$t=_(T(),1),dX=`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 v$t=_(T(),1),Ax=`#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 sH=`${bd}
${dX}`,s2e=Ax;Ot.isInternetExplorer()||(sH=`#define CLIP_POLYLINE 
${sH}`);function Mx(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Mx.VERTEX_FORMAT;this.material=c(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??sH,this._fragmentShaderSource=e.fragmentShaderSource??s2e,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Mx.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}}});Mx.VERTEX_FORMAT=We.POSITION_AND_ST;Mx.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Mx.prototype.isTranslucent=no.prototype.isTranslucent;Mx.prototype.getRenderState=no.prototype.getRenderState;var ua=Mx;function Np(e){e=e??z.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;c(t)||(t=new ua),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.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=Bie(!1),this._renderState3DTiles=Bie(!0),this._renderStateMorph=Oe.fromCache({cull:{enabled:!0,face:_i.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Np.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}}});Np.initializeTerrainHeights=function(){return ui.initialize()};function a2e(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(cX);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(aX);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(rX),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",f="";c(n.material)?(f=c(n.material)?n.material.shaderSource:"",f.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),f.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],y=new Be({defines:d,sources:[s]}),h=new Be({defines:p,sources:[f,l]});e._sp=tn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:y,fragmentShaderSource:h,attributeLocations:r});let g=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!c(g)){let S=new Be({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});g=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:S,fragmentShaderSource:h,attributeLocations:r})}e._sp2D=g;let x=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!c(x)){let S=new Be({defines:d.concat([`MAX_TERRAIN_HEIGHT ${ui._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});l=o._batchTable.getVertexShaderCallback()(sX);let V=new Be({defines:p,sources:[f,l]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:S,fragmentShaderSource:V,attributeLocations:r})}e._spMorph=x}function Bie(e){return Oe.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:On.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function c2e(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof es?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let f=0;f<a;f++){let p=s._va[f],y=o[f];c(y)||(y=o[f]=new et({owner:e,primitiveType:s._primitiveType})),y.vertexArray=p,y.renderState=e._renderState,y.shaderProgram=e._sp,y.uniformMap=u,y.pass=Xe.TERRAIN_CLASSIFICATION,y.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let h=et.shallowClone(y,y.derivedCommands.tileset);h.renderState=e._renderState3DTiles,h.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=h;let g=et.shallowClone(y,y.derivedCommands.color2D);g.shaderProgram=e._sp2D,y.derivedCommands.color2D=g;let x=et.shallowClone(h,h.derivedCommands.color2D);x.shaderProgram=e._sp2D,h.derivedCommands.color2D=x;let S=et.shallowClone(y,y.derivedCommands.colorMorph);S.renderState=e._renderStateMorph,S.shaderProgram=e._spMorph,S.pickId="czm_batchTable_pickColor(v_batchId)",y.derivedCommands.colorMorph=S}}function Yie(e,t,n,i,o,r,s){n.mode===se.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==se.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function l2e(e,t,n,i,o,r,s){let a=e._primitive;In._updateBoundingVolumes(a,t,o);let l;t.mode===se.SCENE3D?l=a._boundingSphereWC:t.mode===se.COLUMBUS_VIEW?l=a._boundingSphereCV:t.mode===se.SCENE2D&&c(a._boundingSphere2D)?l=a._boundingSphere2D:c(a._boundingSphereMorph)&&(l=a._boundingSphereMorph);let d=t.mode===se.MORPHING,u=e.classificationType,f=u!==Un.CESIUM_3D_TILE,p=u!==Un.TERRAIN&&!d,y,h=t.passes;if(h.render||h.pick&&a.allowPicking){let g=n.length;for(let x=0;x<g;++x){let S=l[x];f&&(y=n[x],Yie(e,y,t,o,r,S,s)),p&&(y=n[x].derivedCommands.tileset,Yie(e,y,t,o,r,S,s))}}}Np.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!ui.initialized){if(!this.asynchronous)throw new L("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");Np.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!c(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,!c(a)||!c(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let l=o[t];a={};let d=l.attributes;for(let u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);c(a.width)||(a.width=new dc({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,vx.setProjectionAndEllipsoid(l.geometry,e.mapProjection),s[t]=new Rt({geometry:l.geometry,attributes:a,id:l.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,d,u){a2e(n,d,u)},i._createCommandsFunction=function(l,d,u,f,p,y,h){c2e(n,d,u,f,y,h)},i._updateAndQueueCommandsFunction=function(l,d,u,f,p,y,h,g){l2e(n,d,u,f,p,y,h)},this._primitive=new In(i)}if(this.appearance instanceof es&&!this._hasPerInstanceColors)throw new L("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&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Np.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new L("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};Np.isSupported=function(e){return e.frameState.context.depthTexture};Np.prototype.isDestroyed=function(){return!1};Np.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,he(this)};var Am=Np;var Ken=_(T(),1);var ken=_(T(),1);var Wen=_(T(),1);var d2e=new D(1,1),u2e=!1,m2e=Y.WHITE;function xC(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(xC.prototype,{isConstant:{get:function(){return J.isConstant(this._image)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:fe("image"),repeat:fe("repeat"),color:fe("color"),transparent:fe("transparent")});xC.prototype.getType=function(e){return"Image"};var f2e=new ee;xC.prototype.getValue=function(e,t){return c(e)||(e=ee.now(f2e)),c(t)||(t={}),t.image=J.getValueOrUndefined(this._image,e),t.repeat=J.getValueOrClonedDefault(this._repeat,e,d2e,t.repeat),t.color=J.getValueOrClonedDefault(this._color,e,m2e,t.color),J.getValueOrDefault(this._transparent,e,u2e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};xC.prototype.equals=function(e){return this===e||e instanceof xC&&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 $0=xC;function h2e(e){if(e instanceof Y)return new Ut(e);if(typeof e=="string"||e instanceof Ge||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new $0;return t.image=e,t}throw new L(`Unable to infer material type: ${e}`)}function p2e(e,t){return fe(e,t,h2e)}var wo=p2e;function uX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(uX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),dimensions:fe("dimensions"),heightReference:fe("heightReference"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});uX.prototype.clone=function(e){return c(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 uX(this)};uX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Nx=uX;var ftn=_(T(),1);var Qen=_(T(),1),b2e={FIXED:0,INERTIAL:1},Ui=Object.freeze(b2e);var otn=_(T(),1);function _C(){L.throwInstantiationError()}Object.defineProperties(_C.prototype,{isConstant:{get:L.throwInstantiationError},definitionChanged:{get:L.throwInstantiationError},referenceFrame:{get:L.throwInstantiationError}});_C.prototype.getValue=L.throwInstantiationError;_C.prototype.getValueInReferenceFrame=L.throwInstantiationError;_C.prototype.equals=L.throwInstantiationError;var Hie=new te;_C.convertToReferenceFrame=function(e,t,n,i,o){if(!c(t))return t;if(c(o)||(o=new m),n===i)return m.clone(t,o);let r=wt.computeIcrfToCentralBodyFixedMatrix(e,Hie);if(n===Ui.INERTIAL)return te.multiplyByVector(r,t,o);if(n===Ui.FIXED)return te.multiplyByVector(te.transpose(r,Hie),t,o)};var Mm=_C;function kx(e,t){this._definitionChanged=new ye,this._value=m.clone(e),this._referenceFrame=t??Ui.FIXED}Object.defineProperties(kx.prototype,{isConstant:{get:function(){return!c(this._value)||this._referenceFrame===Ui.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var y2e=new ee;kx.prototype.getValue=function(e,t){return c(e)||(e=ee.now(y2e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};kx.prototype.setValue=function(e,t){let n=!1;m.equals(this._value,e)||(n=!0,this._value=m.clone(e)),c(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};kx.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");return Mm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};kx.prototype.equals=function(e){return this===e||e instanceof kx&&m.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Oc=kx;var Ttn=_(T(),1);function mX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(mX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});mX.prototype.clone=function(e){return c(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 mX(this)};mX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Ux=mX;var Vtn=_(T(),1);function g2e(e){return e}function x2e(e,t){return fe(e,t,g2e)}var Dc=x2e;var Wtn=_(T(),1);function fX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(fX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),length:fe("length"),topRadius:fe("topRadius"),bottomRadius:fe("bottomRadius"),heightReference:fe("heightReference"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),slices:fe("slices"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});fX.prototype.clone=function(e){return c(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 fX(this)};fX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Ox=fX;var ktn=_(T(),1);function hX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(hX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),semiMajorAxis:fe("semiMajorAxis"),semiMinorAxis:fe("semiMinorAxis"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});hX.prototype.clone=function(e){return c(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 hX(this)};hX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Dx=hX;var Ktn=_(T(),1);function pX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(pX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),radii:fe("radii"),innerRadii:fe("innerRadii"),minimumClock:fe("minimumClock"),maximumClock:fe("maximumClock"),minimumCone:fe("minimumCone"),maximumCone:fe("maximumCone"),heightReference:fe("heightReference"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),stackPartitions:fe("stackPartitions"),slicePartitions:fe("slicePartitions"),subdivisions:fe("subdivisions"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});pX.prototype.clone=function(e){return c(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 pX(this)};pX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Bx=pX;var tnn=_(T(),1);function bX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(bX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),text:fe("text"),font:fe("font"),style:fe("style"),scale:fe("scale"),showBackground:fe("showBackground"),backgroundColor:fe("backgroundColor"),backgroundPadding:fe("backgroundPadding"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),fillColor:fe("fillColor"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),scaleByDistance:fe("scaleByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance")});bX.prototype.clone=function(e){return c(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 bX(this)};bX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Nm=bX;var wnn=_(T(),1);var pnn=_(T(),1);var snn=_(T(),1);var _2e=new m(1,1,1),T2e=m.ZERO,S2e=Fe.IDENTITY;function zie(e,t,n){this.translation=m.clone(e??T2e),this.rotation=Fe.clone(t??S2e),this.scale=m.clone(n??_2e)}zie.prototype.equals=function(e){return this===e||c(e)&&m.equals(this.translation,e.translation)&&Fe.equals(this.rotation,e.rotation)&&m.equals(this.scale,e.scale)};var ey=zie;var aH=new ey;function yX(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(yX.prototype,{isConstant:{get:function(){return J.isConstant(this._translation)&&J.isConstant(this._rotation)&&J.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:fe("translation"),rotation:fe("rotation"),scale:fe("scale")});var C2e=new ee;yX.prototype.getValue=function(e,t){return c(e)||(e=ee.now(C2e)),c(t)||(t=new ey),t.translation=J.getValueOrClonedDefault(this._translation,e,aH.translation,t.translation),t.rotation=J.getValueOrClonedDefault(this._rotation,e,aH.rotation,t.rotation),t.scale=J.getValueOrClonedDefault(this._scale,e,aH.scale,t.scale),t};yX.prototype.equals=function(e){return this===e||e instanceof yX&&J.equals(this._translation,e._translation)&&J.equals(this._rotation,e._rotation)&&J.equals(this._scale,e._scale)};var Yx=yX;var Vnn=_(T(),1);function kp(e,t){this._propertyNames=[],this._definitionChanged=new ye,c(e)&&this.merge(e,t)}Object.defineProperties(kp.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}}});kp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function V2e(e){return new Qn(e)}kp.prototype.addProperty=function(e,t,n){let i=this._propertyNames;if(!c(e))throw new L("propertyName is required.");if(i.indexOf(e)!==-1)throw new L(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,fe(e,!0,n??V2e)),c(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};kp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new L("propertyName is required.");if(n===-1)throw new L(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var L2e=new ee;kp.prototype.getValue=function(e,t){c(e)||(e=ee.now(L2e)),c(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};kp.prototype.merge=function(e,t){if(!c(e))throw new L("source is required.");let n=this._propertyNames,i=c(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],l=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),l!==void 0&&(a!==void 0?c(a)&&c(a.merge)&&a.merge(l):c(l)&&c(l.merge)&&c(l.clone)?this[s]=l.clone():this[s]=l)}};function Z2e(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}kp.prototype.equals=function(e){return this===e||e instanceof kp&&Z2e(this,e)};var Bc=kp;function Kie(e){return new Yx(e)}function R2e(e){return new Bc(e,Kie)}function G2e(e){return new Bc(e)}function E2e(e){return new Bc(e)}function gX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(gX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),scale:fe("scale"),enableVerticalExaggeration:fe("enableVerticalExaggeration"),minimumPixelSize:fe("minimumPixelSize"),maximumScale:fe("maximumScale"),incrementallyLoadTextures:fe("incrementallyLoadTextures"),runAnimations:fe("runAnimations"),clampAnimations:fe("clampAnimations"),shadows:fe("shadows"),heightReference:fe("heightReference"),silhouetteColor:fe("silhouetteColor"),silhouetteSize:fe("silhouetteSize"),color:fe("color"),colorBlendMode:fe("colorBlendMode"),colorBlendAmount:fe("colorBlendAmount"),imageBasedLightingFactor:fe("imageBasedLightingFactor"),environmentMapOptions:fe("environmentMapOptions",void 0,E2e),lightColor:fe("lightColor"),distanceDisplayCondition:fe("distanceDisplayCondition"),nodeTransformations:fe("nodeTransformations",void 0,R2e),articulations:fe("articulations",void 0,G2e),clippingPlanes:fe("clippingPlanes"),customShader:fe("customShader")});gX.prototype.clone=function(e){return c(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 gX(this)};gX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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(c(t)){let i=this.nodeTransformations;c(i)?i.merge(t):this.nodeTransformations=new Bc(t,Kie)}let n=e.articulations;if(c(n)){let i=this.articulations;c(i)?i.merge(n):this.articulations=new Bc(n)}};var Up=gX;var knn=_(T(),1);function xX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(xX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),maximumScreenSpaceError:fe("maximumScreenSpaceError")});xX.prototype.clone=function(e){return c(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new xX(this)};xX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var Hx=xX;var Knn=_(T(),1);function _X(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(_X.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),leadTime:fe("leadTime"),trailTime:fe("trailTime"),width:fe("width"),resolution:fe("resolution"),material:wo("material"),distanceDisplayCondition:fe("distanceDisplayCondition")});_X.prototype.clone=function(e){return c(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 _X(this)};_X.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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=_X;var nin=_(T(),1);function TX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(TX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),plane:fe("plane"),dimensions:fe("dimensions"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});TX.prototype.clone=function(e){return c(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 TX(this)};TX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 SX=TX;var lin=_(T(),1);function CX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(CX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),pixelSize:fe("pixelSize"),heightReference:fe("heightReference"),color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});CX.prototype.clone=function(e){return c(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 CX(this)};CX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 zx=CX;var Sin=_(T(),1);var min=_(T(),1);function X2e(e,t){this.positions=c(e)?e:[],this.holes=c(t)?t:[]}var Fa=X2e;function I2e(e){return Array.isArray(e)&&(e=new Fa(e)),new Qn(e)}function VX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(VX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),hierarchy:fe("hierarchy",void 0,I2e),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),perPositionHeight:fe("perPositionHeight"),closeTop:fe("closeTop"),closeBottom:fe("closeBottom"),arcType:fe("arcType"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex"),textureCoordinates:fe("textureCoordinates")});VX.prototype.clone=function(e){return c(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 VX(this)};VX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 km=VX;var Xin=_(T(),1);function LX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(LX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),granularity:fe("granularity"),material:wo("material"),depthFailMaterial:wo("depthFailMaterial"),arcType:fe("arcType"),clampToGround:fe("clampToGround"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});LX.prototype.clone=function(e){return c(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 LX(this)};LX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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=LX;var Min=_(T(),1);function ZX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(ZX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),shape:fe("shape"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});ZX.prototype.clone=function(e){return c(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 ZX(this)};ZX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Kx=ZX;var Hin=_(T(),1);function RX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(RX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),coordinates:fe("coordinates"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});RX.prototype.clone=function(e){return c(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 RX(this)};RX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Um=RX;var eon=_(T(),1);function GX(e){this._definitionChanged=new ye,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??z.EMPTY_OBJECT)}Object.defineProperties(GX.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),minimumHeights:fe("minimumHeights"),maximumHeights:fe("maximumHeights"),granularity:fe("granularity"),fill:fe("fill"),material:wo("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});GX.prototype.clone=function(e){return c(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 GX(this)};GX.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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 Dp=GX;var W2e=new pe,cH=[];function w2e(e){return new Oc(e)}function P2e(e){return fe(e,void 0,w2e)}function ks(e,t){return fe(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Ru(e){e=e??z.EMPTY_OBJECT;let t=e.id;c(t)||(t=Hn()),this._availability=void 0,this._id=t,this._definitionChanged=new ye,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??vp.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...cH],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function lH(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)&&lH(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Ru.prototype,{availability:Dc("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Dc("name"),show:{get:function(){return this._show},set:function(e){if(!c(e))throw new L("value is required.");if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&lH(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Dc("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!c(this.entityCollection)||this.entityCollection.show)&&(!c(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(c(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,c(e)&&e._children.push(this);let i=this.isShowing;n!==i&&lH(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:ks("billboard",cc),box:ks("box",Nx),corridor:ks("corridor",Ux),cylinder:ks("cylinder",Ox),description:fe("description"),ellipse:ks("ellipse",Dx),ellipsoid:ks("ellipsoid",Bx),label:ks("label",Nm),model:ks("model",Up),tileset:ks("tileset",Hx),orientation:fe("orientation"),path:ks("path",Op),plane:ks("plane",SX),point:ks("point",zx),polygon:ks("polygon",km),polyline:ks("polyline",uc),polylineVolume:ks("polylineVolume",Kx),properties:ks("properties",Bc),position:P2e("position"),rectangle:ks("rectangle",Um),viewFrom:fe("viewFrom"),wall:ks("wall",Dp)});Ru.registerEntityType=function(e,t){Object.defineProperties(Ru.prototype,{[e]:ks(e,t)}),cH.includes(e)||cH.push(e)};Ru.prototype.isAvailable=function(e){if(!c(e))throw new L("time is required.");let t=this._availability;return!c(t)||t.contains(e)};Ru.prototype.addProperty=function(e){let t=this._propertyNames;if(!c(e))throw new L("propertyName is required.");if(t.indexOf(e)!==-1)throw new L(`${e} is already a registered property.`);if(e in this)throw new L(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,Dc(e,!0))};Ru.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new L("propertyName is required.");if(n===-1)throw new L(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]};Ru.prototype.merge=function(e){if(!c(e))throw new L("source is required.");this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=c(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];!c(s)&&t.indexOf(r)===-1&&this.addProperty(r),c(a)&&(c(s)?c(s.merge)&&s.merge(a):c(a.merge)&&c(a.clone)?this[r]=a.clone():this[r]=a)}};var Jie=new te,Qie=new m,jie=new Fe;Ru.prototype.computeModelMatrix=function(e,t){C.typeOf.object("time",e);let n=J.getValueOrUndefined(this._position,e,Qie);if(!c(n))return;let i=J.getValueOrUndefined(this._orientation,e,jie);return c(i)?t=M.fromRotationTranslation(te.fromQuaternion(i,Jie),n,t):t=wt.eastNorthUpToFixedFrame(n,void 0,t),t};Ru.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){C.typeOf.object("time",e);let r=J.getValueOrDefault(t,e,ze.NONE),s=J.getValueOrUndefined(this._position,e,Qie);if(r===ze.NONE||!c(s)||m.equalsEpsilon(s,m.ZERO,w.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,W2e);r===ze.CLIP_TO_GROUND?a.height<n&&(a.height=n):Lu(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let l=J.getValueOrUndefined(this._orientation,e,jie);return c(l)?o=M.fromRotationTranslation(te.fromQuaternion(l,Jie),s,o):o=wt.eastNorthUpToFixedFrame(s,void 0,o),o};Ru.supportsMaterialsforEntitiesOnTerrain=function(e){return kc.supportsMaterials(e)};Ru.supportsPolylinesOnTerrain=function(e){return Am.isSupported(e)};var $o=Ru;var v2e=new Ut(Y.WHITE),F2e=new Qn(!0),A2e=new Qn(!0),M2e=new Qn(!1),N2e=new Qn(Y.BLACK),k2e=new Qn(Sn.DISABLED),U2e=new Qn(new vt),O2e=new Qn(Un.BOTH);function Yc(e){C.defined("options.entity",e.entity),C.defined("options.scene",e.scene),C.defined("options.geometryOptions",e.geometryOptions),C.defined("options.geometryPropertyName",e.geometryPropertyName),C.defined("options.observedPropertyNames",e.observedPropertyNames);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 ye,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=$o.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Yc.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||!c(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||!c(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}}});Yc.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Yc.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Yc.prototype.createFillGeometryInstance=L.throwInstantiationError;Yc.prototype.createOutlineGeometryInstance=L.throwInstantiationError;Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){he(this)};Yc.prototype._isHidden=function(e,t){let n=t.show;return c(n)&&n.isConstant&&!n.getValue(Ye.MINIMUM_VALUE)};Yc.prototype._isOnTerrain=function(e,t){return!1};Yc.prototype._getIsClosed=function(e){return!0};Yc.prototype._isDynamic=L.throwInstantiationError;Yc.prototype._setStaticOptions=L.throwInstantiationError;Yc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=c(r)&&r.isConstant?r.getValue(Ye.MINIMUM_VALUE):!0,a=o.outline,l=c(a);if(l&&a.isConstant&&(l=a.getValue(Ye.MINIMUM_VALUE)),!s&&!l){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let d=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??v2e,this._fillProperty=r??A2e,this._showProperty=d??F2e,this._showOutlineProperty=o.outline??M2e,this._outlineColorProperty=l?o.outlineColor??N2e:void 0,this._shadowsProperty=o.shadows??k2e,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??U2e,this._classificationTypeProperty=o.classificationType??O2e,this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Ut);if(l&&u&&(ht(ht.geometryOutlines),l=!1),this._onTerrain=u,this._outlineEnabled=l,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 f=o.outlineWidth;this._outlineWidth=c(f)?f.getValue(Ye.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Yc.prototype.createDynamicUpdater=function(e,t){if(C.defined("primitives",e),C.defined("groundPrimitives",t),!this._dynamic)throw new L("This instance does not represent dynamic geometry.");return new this.constructor.DynamicGeometryUpdater(this,e,t)};var oi=Yc;var Ern=_(T(),1);var drn=_(T(),1);function TC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new ye,this.setCallback(e,t)}Object.defineProperties(TC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var D2e=new ee;TC.prototype.getValue=function(e,t){return c(e)||(e=ee.now(D2e)),this._callback(e,t)};TC.prototype.setCallback=function(e,t){if(!c(e))throw new L("callback is required.");if(!c(t))throw new L("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};TC.prototype.equals=function(e){return this===e||e instanceof TC&&this._callback===e._callback&&this._isConstant===e._isConstant};var Om=TC;var Crn=_(T(),1);var qie=new m;function SC(e,t,n,i){C.defined("scene",e),C.defined("positionProperty",t),this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new m,this._cartographicPosition=new pe,this._normal=new m,this._definitionChanged=new ye,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(c(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ye.MINIMUM_VALUE,qie);if(!c(r)||m.equals(r,m.ZERO)||!c(e.globe))return;this._position=m.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(SC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});SC.prototype._updateClamping=function(){c(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(m.equals(t,m.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);c(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 B2e=new ee;SC.prototype.getValue=function(e,t){c(e)||(e=ee.now(B2e));let n=J.getValueOrDefault(this._heightReference,e,ze.NONE),i=J.getValueOrDefault(this._extrudedHeightReference,e,ze.NONE);if(n===ze.NONE&&!lC(i))return this._position=m.clone(m.ZERO,this._position),m.clone(m.ZERO,t);if(this._positionProperty.isConstant&&n!==ze.CLIP_TO_GROUND)return m.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,qie);if(!c(r)||m.equals(r,m.ZERO)||!c(o.globe))return m.clone(m.ZERO,t);if(m.equalsEpsilon(this._position,r,w.EPSILON10)&&n!==ze.CLIP_TO_GROUND)return m.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=m.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===ze.CLIP_TO_GROUND){let l=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=l.height?m.multiplyByScalar(s,this._terrainHeight-l.height,t):m.clone(m.ZERO,t)}return m.multiplyByScalar(s,this._terrainHeight,t)};SC.prototype.isDestroyed=function(){return!1};SC.prototype.destroy=function(){return c(this._removeEventListener)&&this._removeEventListener(),c(this._removeModeListener)&&this._removeModeListener(),c(this._removeCallbackFunc)&&this._removeCallbackFunc(),he(this)};var Jx=SC;function Y2e(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(c(r)){let s=new Om(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Jx(this._scene,s,r)}}var Bp=Y2e;var $ie=m.ZERO,eoe=new m,H2e=new m,toe=new Y;function z2e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function yd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new z2e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}c(Object.create)&&(yd.prototype=Object.create(oi.prototype),yd.prototype.constructor=yd);Object.defineProperties(yd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});yd.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new Tn(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 Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,toe)),c(a)||(a=Y.WHITE),s.color=Yt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,$ie,eoe))),new Rt({id:t,geometry:Wa.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};yd.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,toe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,$ie,eoe))),new Rt({id:t,geometry:Fm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};yd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};yd.prototype._isHidden=function(e,t){return!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};yd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};yd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ye.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==ze.NONE?$t.ALL:void 0};yd.prototype._onEntityPropertyChanged=Bp;yd.DynamicGeometryUpdater=CC;function CC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(CC.prototype=Object.create(ii.prototype),CC.prototype.constructor=CC);CC.prototype._isHidden=function(e,t,n){let i=J.getValueOrUndefined(e.position,n,H2e),o=this._options.dimensions;return!c(i)||!c(o)||ii.prototype._isHidden.call(this,e,t,n)};CC.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,ze.NONE),o=this._options;o.dimensions=J.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==ze.NONE?$t.ALL:void 0};var EX=yd;var asn=_(T(),1);function Qx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Ui.FIXED,this._definitionChanged=new ye,this.setCallback(e,t)}Object.defineProperties(Qx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var K2e=new ee;Qx.prototype.getValue=function(e,t){return c(e)||(e=ee.now(K2e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Qx.prototype.setCallback=function(e,t){if(!c(e))throw new L("callback is required.");if(!c(t))throw new L("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Qx.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._callback(e,n);return Mm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Qx.prototype.equals=function(e){return this===e||e instanceof Qx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var XX=Qx;var m4n=_(T(),1);var e4n=_(T(),1);var hsn=_(T(),1);var lsn=_(T(),1);/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */var{entries:uoe,setPrototypeOf:noe,isFrozen:J2e,getPrototypeOf:Q2e,getOwnPropertyDescriptor:j2e}=Object,{freeze:zc,seal:Gu,create:moe}=Object,{apply:pH,construct:bH}=typeof Reflect<"u"&&Reflect;zc||(zc=function(t){return t});Gu||(Gu=function(t){return t});pH||(pH=function(t,n,i){return t.apply(n,i)});bH||(bH=function(t,n){return new t(...n)});var T5=gd(Array.prototype.forEach),ioe=gd(Array.prototype.pop),IX=gd(Array.prototype.push),C5=gd(String.prototype.toLowerCase),dH=gd(String.prototype.toString),ooe=gd(String.prototype.match),WX=gd(String.prototype.replace),q2e=gd(String.prototype.indexOf),$2e=gd(String.prototype.trim),Dm=gd(Object.prototype.hasOwnProperty),Hc=gd(RegExp.prototype.test),wX=eve(TypeError);function gd(e){return 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 pH(e,t,i)}}function eve(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return bH(e,n)}}function wi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:C5;noe&&noe(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(J2e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function tve(e){for(let t=0;t<e.length;t++)Dm(e,t)||(e[t]=null);return e}function jx(e){let t=moe(null);for(let[n,i]of uoe(e))Dm(e,n)&&(Array.isArray(i)?t[n]=tve(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=jx(i):t[n]=i);return t}function PX(e,t){for(;e!==null;){let i=j2e(e,t);if(i){if(i.get)return gd(i.get);if(typeof i.value=="function")return gd(i.value)}e=Q2e(e)}function n(){return null}return n}var roe=zc(["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","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),uH=zc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),mH=zc(["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"]),nve=zc(["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"]),fH=zc(["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"]),ive=zc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),soe=zc(["#text"]),aoe=zc(["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","face","for","headers","height","hidden","high","href","hreflang","id","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","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),hH=zc(["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","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"]),coe=zc(["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"]),S5=zc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ove=Gu(/\{\{[\w\W]*|[\w\W]*\}\}/gm),rve=Gu(/<%[\w\W]*|[\w\W]*%>/gm),sve=Gu(/\$\{[\w\W]*}/gm),ave=Gu(/^data-[\-\w.\u00B7-\uFFFF]+$/),cve=Gu(/^aria-[\-\w]+$/),foe=Gu(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lve=Gu(/^(?:\w+script|data):/i),dve=Gu(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),hoe=Gu(/^html$/i),uve=Gu(/^[a-z][.\w]*(-[.\w]+)+$/i),loe=Object.freeze({__proto__:null,ARIA_ATTR:cve,ATTR_WHITESPACE:dve,CUSTOM_ELEMENT:uve,DATA_ATTR:ave,DOCTYPE_NAME:hoe,ERB_EXPR:rve,IS_ALLOWED_URI:foe,IS_SCRIPT_OR_DATA:lve,MUSTACHE_EXPR:ove,TMPLIT_EXPR:sve}),vX={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},mve=function(){return typeof window>"u"?null:window},fve=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}},doe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function poe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mve(),t=dn=>poe(dn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==vX.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:d,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:p,trustedTypes:y}=e,h=l.prototype,g=PX(h,"cloneNode"),x=PX(h,"remove"),S=PX(h,"nextSibling"),V=PX(h,"childNodes"),Z=PX(h,"parentNode");if(typeof s=="function"){let dn=n.createElement("template");dn.content&&dn.content.ownerDocument&&(n=dn.content.ownerDocument)}let R,E="",{implementation:I,createNodeIterator:v,createDocumentFragment:P,getElementsByTagName:F}=n,{importNode:N}=i,b=doe();t.isSupported=typeof uoe=="function"&&typeof Z=="function"&&I&&I.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:G,ERB_EXPR:X,TMPLIT_EXPR:W,DATA_ATTR:A,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:H}=loe,{IS_ALLOWED_URI:U}=loe,K=null,Q=wi({},[...roe,...uH,...mH,...fH,...soe]),ie=null,j=wi({},[...aoe,...hH,...coe,...S5]),$=Object.seal(moe(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}})),ne=null,be=null,Ce=!0,me=!0,_e=!1,Ve=!0,Ie=!1,Ze=!0,De=!1,Ke=!1,rt=!1,Xt=!1,Ht=!1,qe=!1,mn=!0,Dt=!1,Lt="user-content-",Vi=!0,ln=!1,ge={},Le=null,yn=wi({},["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"]),bt=null,ro=wi({},["audio","video","img","source","image","track"]),Xo=null,ra=wi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wr="http://www.w3.org/1998/Math/MathML",_s="http://www.w3.org/2000/svg",Ae="http://www.w3.org/1999/xhtml",st=Ae,Qe=!1,$e=null,yt=wi({},[Wr,_s,Ae],dH),Bt=wi({},["mi","mo","mn","ms","mtext"]),Ln=wi({},["annotation-xml"]),Io=wi({},["title","style","font","a","script"]),To=null,Ka=["application/xhtml+xml","text/html"],Ja="text/html",Li=null,bi=null,sa=n.createElement("form"),Qr=function(Re){return Re instanceof RegExp||Re instanceof Function},xl=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(bi&&bi===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=jx(Re),To=Ka.indexOf(Re.PARSER_MEDIA_TYPE)===-1?Ja:Re.PARSER_MEDIA_TYPE,Li=To==="application/xhtml+xml"?dH:C5,K=Dm(Re,"ALLOWED_TAGS")?wi({},Re.ALLOWED_TAGS,Li):Q,ie=Dm(Re,"ALLOWED_ATTR")?wi({},Re.ALLOWED_ATTR,Li):j,$e=Dm(Re,"ALLOWED_NAMESPACES")?wi({},Re.ALLOWED_NAMESPACES,dH):yt,Xo=Dm(Re,"ADD_URI_SAFE_ATTR")?wi(jx(ra),Re.ADD_URI_SAFE_ATTR,Li):ra,bt=Dm(Re,"ADD_DATA_URI_TAGS")?wi(jx(ro),Re.ADD_DATA_URI_TAGS,Li):ro,Le=Dm(Re,"FORBID_CONTENTS")?wi({},Re.FORBID_CONTENTS,Li):yn,ne=Dm(Re,"FORBID_TAGS")?wi({},Re.FORBID_TAGS,Li):{},be=Dm(Re,"FORBID_ATTR")?wi({},Re.FORBID_ATTR,Li):{},ge=Dm(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,Ce=Re.ALLOW_ARIA_ATTR!==!1,me=Re.ALLOW_DATA_ATTR!==!1,_e=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,Ve=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ie=Re.SAFE_FOR_TEMPLATES||!1,Ze=Re.SAFE_FOR_XML!==!1,De=Re.WHOLE_DOCUMENT||!1,Xt=Re.RETURN_DOM||!1,Ht=Re.RETURN_DOM_FRAGMENT||!1,qe=Re.RETURN_TRUSTED_TYPE||!1,rt=Re.FORCE_BODY||!1,mn=Re.SANITIZE_DOM!==!1,Dt=Re.SANITIZE_NAMED_PROPS||!1,Vi=Re.KEEP_CONTENT!==!1,ln=Re.IN_PLACE||!1,U=Re.ALLOWED_URI_REGEXP||foe,st=Re.NAMESPACE||Ae,Bt=Re.MATHML_TEXT_INTEGRATION_POINTS||Bt,Ln=Re.HTML_INTEGRATION_POINTS||Ln,$=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&Qr(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&Qr(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(me=!1),Ht&&(Xt=!0),ge&&(K=wi({},soe),ie=[],ge.html===!0&&(wi(K,roe),wi(ie,aoe)),ge.svg===!0&&(wi(K,uH),wi(ie,hH),wi(ie,S5)),ge.svgFilters===!0&&(wi(K,mH),wi(ie,hH),wi(ie,S5)),ge.mathMl===!0&&(wi(K,fH),wi(ie,coe),wi(ie,S5))),Re.ADD_TAGS&&(K===Q&&(K=jx(K)),wi(K,Re.ADD_TAGS,Li)),Re.ADD_ATTR&&(ie===j&&(ie=jx(ie)),wi(ie,Re.ADD_ATTR,Li)),Re.ADD_URI_SAFE_ATTR&&wi(Xo,Re.ADD_URI_SAFE_ATTR,Li),Re.FORBID_CONTENTS&&(Le===yn&&(Le=jx(Le)),wi(Le,Re.FORBID_CONTENTS,Li)),Vi&&(K["#text"]=!0),De&&wi(K,["html","head","body"]),K.table&&(wi(K,["tbody"]),delete ne.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw wX('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wX('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=Re.TRUSTED_TYPES_POLICY,E=R.createHTML("")}else R===void 0&&(R=fve(y,o)),R!==null&&typeof E=="string"&&(E=R.createHTML(""));zc&&zc(Re),bi=Re}},yo=wi({},[...uH,...mH,...nve]),wr=wi({},[...fH,...ive]),gp=function(Re){let It=Z(Re);(!It||!It.tagName)&&(It={namespaceURI:st,tagName:"template"});let gn=C5(Re.tagName),xr=C5(It.tagName);return $e[Re.namespaceURI]?Re.namespaceURI===_s?It.namespaceURI===Ae?gn==="svg":It.namespaceURI===Wr?gn==="svg"&&(xr==="annotation-xml"||Bt[xr]):!!yo[gn]:Re.namespaceURI===Wr?It.namespaceURI===Ae?gn==="math":It.namespaceURI===_s?gn==="math"&&Ln[xr]:!!wr[gn]:Re.namespaceURI===Ae?It.namespaceURI===_s&&!Ln[xr]||It.namespaceURI===Wr&&!Bt[xr]?!1:!wr[gn]&&(Io[gn]||!yo[gn]):!!(To==="application/xhtml+xml"&&$e[Re.namespaceURI]):!1},jr=function(Re){IX(t.removed,{element:Re});try{Z(Re).removeChild(Re)}catch{x(Re)}},du=function(Re,It){try{IX(t.removed,{attribute:It.getAttributeNode(Re),from:It})}catch{IX(t.removed,{attribute:null,from:It})}if(It.removeAttribute(Re),Re==="is")if(Xt||Ht)try{jr(It)}catch{}else try{It.setAttribute(Re,"")}catch{}},Qa=function(Re){let It=null,gn=null;if(rt)Re="<remove></remove>"+Re;else{let Ga=ooe(Re,/^[\r\n\t ]+/);gn=Ga&&Ga[0]}To==="application/xhtml+xml"&&st===Ae&&(Re='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Re+"</body></html>");let xr=R?R.createHTML(Re):Re;if(st===Ae)try{It=new p().parseFromString(xr,To)}catch{}if(!It||!It.documentElement){It=I.createDocument(st,"template",null);try{It.documentElement.innerHTML=Qe?E:xr}catch{}}let qa=It.body||It.documentElement;return Re&&gn&&qa.insertBefore(n.createTextNode(gn),qa.childNodes[0]||null),st===Ae?F.call(It,De?"html":"body")[0]:De?It.documentElement:qa},ex=function(Re){return v.call(Re.ownerDocument||Re,Re,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},aa=function(Re){return Re instanceof f&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof u)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},_l=function(Re){return typeof a=="function"&&Re instanceof a};function ja(dn,Re,It){T5(dn,gn=>{gn.call(t,Re,It,bi)})}let ds=function(Re){let It=null;if(ja(b.beforeSanitizeElements,Re,null),aa(Re))return jr(Re),!0;let gn=Li(Re.nodeName);if(ja(b.uponSanitizeElement,Re,{tagName:gn,allowedTags:K}),Re.hasChildNodes()&&!_l(Re.firstElementChild)&&Hc(/<[/\w]/g,Re.innerHTML)&&Hc(/<[/\w]/g,Re.textContent)||Re.nodeType===vX.progressingInstruction||Ze&&Re.nodeType===vX.comment&&Hc(/<[/\w]/g,Re.data))return jr(Re),!0;if(!K[gn]||ne[gn]){if(!ne[gn]&&mu(gn)&&($.tagNameCheck instanceof RegExp&&Hc($.tagNameCheck,gn)||$.tagNameCheck instanceof Function&&$.tagNameCheck(gn)))return!1;if(Vi&&!Le[gn]){let xr=Z(Re)||Re.parentNode,qa=V(Re)||Re.childNodes;if(qa&&xr){let Ga=qa.length;for(let Tl=Ga-1;Tl>=0;--Tl){let $f=g(qa[Tl],!0);$f.__removalCount=(Re.__removalCount||0)+1,xr.insertBefore($f,S(Re))}}}return jr(Re),!0}return Re instanceof l&&!gp(Re)||(gn==="noscript"||gn==="noembed"||gn==="noframes")&&Hc(/<\/no(script|embed|frames)/i,Re.innerHTML)?(jr(Re),!0):(Ie&&Re.nodeType===vX.text&&(It=Re.textContent,T5([G,X,W],xr=>{It=WX(It,xr," ")}),Re.textContent!==It&&(IX(t.removed,{element:Re.cloneNode()}),Re.textContent=It)),ja(b.afterSanitizeElements,Re,null),!1)},uu=function(Re,It,gn){if(mn&&(It==="id"||It==="name")&&(gn in n||gn in sa))return!1;if(!(me&&!be[It]&&Hc(A,It))){if(!(Ce&&Hc(k,It))){if(!ie[It]||be[It]){if(!(mu(Re)&&($.tagNameCheck instanceof RegExp&&Hc($.tagNameCheck,Re)||$.tagNameCheck instanceof Function&&$.tagNameCheck(Re))&&($.attributeNameCheck instanceof RegExp&&Hc($.attributeNameCheck,It)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(It))||It==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&Hc($.tagNameCheck,gn)||$.tagNameCheck instanceof Function&&$.tagNameCheck(gn))))return!1}else if(!Xo[It]){if(!Hc(U,WX(gn,O,""))){if(!((It==="src"||It==="xlink:href"||It==="href")&&Re!=="script"&&q2e(gn,"data:")===0&&bt[Re])){if(!(_e&&!Hc(B,WX(gn,O,"")))){if(gn)return!1}}}}}}return!0},mu=function(Re){return Re!=="annotation-xml"&&ooe(Re,H)},fu=function(Re){ja(b.beforeSanitizeAttributes,Re,null);let{attributes:It}=Re;if(!It||aa(Re))return;let gn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ie,forceKeepAttr:void 0},xr=It.length;for(;xr--;){let qa=It[xr],{name:Ga,namespaceURI:Tl,value:$f}=qa,JL=Li(Ga),Pc=Ga==="value"?$f:$2e($f);if(gn.attrName=JL,gn.attrValue=Pc,gn.keepAttr=!0,gn.forceKeepAttr=void 0,ja(b.uponSanitizeAttribute,Re,gn),Pc=gn.attrValue,Dt&&(JL==="id"||JL==="name")&&(du(Ga,Re),Pc=Lt+Pc),Ze&&Hc(/((--!?|])>)|<\/(style|title)/i,Pc)){du(Ga,Re);continue}if(gn.forceKeepAttr||(du(Ga,Re),!gn.keepAttr))continue;if(!Ve&&Hc(/\/>/i,Pc)){du(Ga,Re);continue}Ie&&T5([G,X,W],_q=>{Pc=WX(Pc,_q," ")});let xq=Li(Re.nodeName);if(uu(xq,JL,Pc)){if(R&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Tl)switch(y.getAttributeType(xq,JL)){case"TrustedHTML":{Pc=R.createHTML(Pc);break}case"TrustedScriptURL":{Pc=R.createScriptURL(Pc);break}}try{Tl?Re.setAttributeNS(Tl,Ga,Pc):Re.setAttribute(Ga,Pc),aa(Re)?jr(Re):ioe(t.removed)}catch{}}}ja(b.afterSanitizeAttributes,Re,null)},Ao=function dn(Re){let It=null,gn=ex(Re);for(ja(b.beforeSanitizeShadowDOM,Re,null);It=gn.nextNode();)ja(b.uponSanitizeShadowNode,It,null),ds(It),fu(It),It.content instanceof r&&dn(It.content);ja(b.afterSanitizeShadowDOM,Re,null)};return t.sanitize=function(dn){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},It=null,gn=null,xr=null,qa=null;if(Qe=!dn,Qe&&(dn="<!-->"),typeof dn!="string"&&!_l(dn))if(typeof dn.toString=="function"){if(dn=dn.toString(),typeof dn!="string")throw wX("dirty is not a string, aborting")}else throw wX("toString is not a function");if(!t.isSupported)return dn;if(Ke||xl(Re),t.removed=[],typeof dn=="string"&&(ln=!1),ln){if(dn.nodeName){let $f=Li(dn.nodeName);if(!K[$f]||ne[$f])throw wX("root node is forbidden and cannot be sanitized in-place")}}else if(dn instanceof a)It=Qa("<!---->"),gn=It.ownerDocument.importNode(dn,!0),gn.nodeType===vX.element&&gn.nodeName==="BODY"||gn.nodeName==="HTML"?It=gn:It.appendChild(gn);else{if(!Xt&&!Ie&&!De&&dn.indexOf("<")===-1)return R&&qe?R.createHTML(dn):dn;if(It=Qa(dn),!It)return Xt?null:qe?E:""}It&&rt&&jr(It.firstChild);let Ga=ex(ln?dn:It);for(;xr=Ga.nextNode();)ds(xr),fu(xr),xr.content instanceof r&&Ao(xr.content);if(ln)return dn;if(Xt){if(Ht)for(qa=P.call(It.ownerDocument);It.firstChild;)qa.appendChild(It.firstChild);else qa=It;return(ie.shadowroot||ie.shadowrootmode)&&(qa=N.call(i,qa,!0)),qa}let Tl=De?It.outerHTML:It.innerHTML;return De&&K["!doctype"]&&It.ownerDocument&&It.ownerDocument.doctype&&It.ownerDocument.doctype.name&&Hc(hoe,It.ownerDocument.doctype.name)&&(Tl="<!DOCTYPE "+It.ownerDocument.doctype.name+`>
`+Tl),Ie&&T5([G,X,W],$f=>{Tl=WX(Tl,$f," ")}),R&&qe?R.createHTML(Tl):Tl},t.setConfig=function(){let dn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};xl(dn),Ke=!0},t.clearConfig=function(){bi=null,Ke=!1},t.isValidAttribute=function(dn,Re,It){bi||xl({});let gn=Li(dn),xr=Li(Re);return uu(gn,xr,It)},t.addHook=function(dn,Re){typeof Re=="function"&&IX(b[dn],Re)},t.removeHook=function(dn){return ioe(b[dn])},t.removeHooks=function(dn){b[dn]=[]},t.removeAllHooks=function(){b=doe()},t}var boe=poe();var hve=0,yH={};function hh(e,t){C.typeOf.string("html",e);let n,i=e;c(yH[i])?n=yH[i]:(n=hve++,yH[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(hh.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(!c(this._element)){let e=boe.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}}});hh.equals=function(e,t){return e===t||c(e)&&c(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};hh.prototype.equals=function(e){return hh.equals(this,e)};hh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};hh.getIonCredit=function(e){let t=c(e.collapsible)&&!e.collapsible;return new hh(e.html,t)};hh.clone=function(e){if(c(e))return new hh(e.html,e.showOnScreen)};var Ct=hh;var xsn=_(T(),1);function pve(e,t){if(!c(e)||!c(t))throw new L("identifier and message are required.");ht(e,t)}var Cs=pve;var Nsn=_(T(),1);var Xsn=_(T(),1);function qx(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 ye}Object.defineProperties(qx.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}}});qx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function gH(e){e._cubeMapBuffers=void 0}qx.prototype.update=function(e){let{context:t}=e;if(!qx.isSupported(t))return;if(c(this._texture)){gH(this);return}if(!c(this._texture)&&!this._loading){let u=t.textureCache.getTexture(this._url);c(u)&&(gH(this),this._texture=u,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!c(n)&&!this._loading){let u=this;Ll(this._url).then(function(f){u._cubeMapBuffers=f,u._loading=!1}).catch(function(f){u.isDestroyed()||u._errorEvent.raiseEvent(f)}),this._loading=!0}if(!c(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;c(i)||(i=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT);let o=ke.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let u={};Object.values(Uo.FaceName).forEach(f=>{u[f]=void 0});for(let f=r;f<a;f++)n.push(u)}let l=new en({minificationFilter:Jt.LINEAR_MIPMAP_LINEAR}),d=new Uo({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:l});d.loadMipmaps(n.slice(1)),this._texture=d,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};qx.prototype.isDestroyed=function(){return!1};qx.prototype.destroy=function(){return gH(this),this._texture=this._texture&&this._texture.destroy(),he(this)};var Bm=qx;function FX(e){e=e??z.EMPTY_OBJECT;let t=c(e.imageBasedLightingFactor)?D.clone(e.imageBasedLightingFactor):new D(1,1);C.typeOf.object("options.imageBasedLightingFactor",t),C.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.x",t.x,0),C.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.x",t.x,1),C.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.y",t.y,0),C.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.y",t.y,1),this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;if(c(n)&&(!Array.isArray(n)||n.length!==9))throw new L("options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");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._previousImageBasedLightingFactor=D.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(FX.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){C.typeOf.object("imageBasedLightingFactor",e),C.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),C.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),C.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),C.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=D.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){if(c(e)&&(!Array.isArray(e)||e.length!==9))throw new L("sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");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 c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function bve(e,t){if(Bm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),c(e._specularEnvironmentMaps)){let n=new Bm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}FX.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;D.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=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||c(this._previousSphericalHarmonicCoefficients)!==c(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(bve(this,t),this._specularEnvironmentCubeMapDirty=!1),c(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!c(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!c(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)};FX.prototype.isDestroyed=function(){return!1};FX.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),he(this)};var $x=FX;var $sn=_(T(),1),_H=_(cd(),1);var Bsn=_(T(),1);var xH,yoe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",V5={};V5.defaultAccessToken=yoe;V5.defaultServer=new Ge({url:"https://api.cesium.com/"});V5.getDefaultTokenCredit=function(e){if(e===yoe){if(!c(xH)){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>`;xH=new Ct(t,!0)}return xH}};var Ym=V5;function Kc(e,t){C.defined("endpoint",e),C.defined("endpointResource",t);let n,i=e.externalType,o=c(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:yve};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new le("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ge.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new _H.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}c(Object.create)&&(Kc.prototype=Object.create(Ge.prototype),Kc.prototype.constructor=Kc);Kc.fromAssetId=function(e,t){let n=Kc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Kc(i,n)})};Object.defineProperties(Kc.prototype,{credits:{get:function(){return c(this._ionRoot)?this._ionRoot.credits:c(this._credits)?this._credits:(this._credits=Kc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Kc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Ct.getIonCredit),i=Ym.getDefaultTokenCredit(t.queryParameters.access_token);return c(i)&&n.push(Ct.clone(i)),n};Kc.prototype.clone=function(e){let t=this._ionRoot??this;return c(e)||(e=new Kc(t._ionEndpoint,t._ionEndpointResource)),e=Ge.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Kc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},c(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ge.prototype.fetchImage.call(this,e)};Kc.prototype._makeRequest=function(e){return this._isExternal||new _H.default(this.url).authority()!==this._ionEndpointDomain?Ge.prototype._makeRequest.call(this,e):(c(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Ge.prototype._makeRequest.call(this,e))};Kc._createEndpointResource=function(e,t){C.defined("assetId",e),t=t??z.EMPTY_OBJECT;let n=t.server??Ym.defaultServer,i=t.accessToken??Ym.defaultAccessToken;n=Ge.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return c(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function yve(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!c(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(c(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var xd=Kc;var nan=_(T(),1);function ph(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(ph.prototype,{length:{get:function(){return this._length},set:function(e){C.typeOf.number.greaterThanOrEquals("length",e,0);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}}});ph.prototype.get=function(e){return C.typeOf.number.lessThan("index",e,this._array.length),this._array[e]};ph.prototype.set=function(e,t){C.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t};ph.prototype.peek=function(){return this._array[this._length-1]};ph.prototype.push=function(e){let t=this.length++;this._array[t]=e};ph.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};ph.prototype.reserve=function(e){C.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)};ph.prototype.resize=function(e){C.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e};ph.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Jc=ph;var aan=_(T(),1);var Yp={X:0,Y:1,Z:2};Yp.Y_UP_TO_Z_UP=M.fromRotationTranslation(te.fromArray([1,0,0,0,0,1,0,-1,0]));Yp.Z_UP_TO_Y_UP=M.fromRotationTranslation(te.fromArray([1,0,0,0,0,-1,0,1,0]));Yp.X_UP_TO_Z_UP=M.fromRotationTranslation(te.fromArray([0,0,1,0,1,0,-1,0,0]));Yp.Z_UP_TO_X_UP=M.fromRotationTranslation(te.fromArray([0,0,-1,0,1,0,1,0,0]));Yp.X_UP_TO_Y_UP=M.fromRotationTranslation(te.fromArray([0,1,0,-1,0,0,0,0,1]));Yp.Y_UP_TO_X_UP=M.fromRotationTranslation(te.fromArray([0,-1,0,1,0,0,0,0,1]));Yp.fromName=function(e){return C.typeOf.string("name",e),Yp[e]};var Po=Object.freeze(Yp);var oJn=_(T(),1);var uan=_(T(),1);function goe(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}Object.defineProperties(goe.prototype,{metadata:{get:function(){return this._metadata}}});var e_=goe;var S3n=_(T(),1);var Zan=_(T(),1);var xan=_(T(),1);var ban=_(T(),1);function ty(e,t,n){if(!c(e))throw new L("uint8Array is required.");if(t<0)throw new L("byteOffset cannot be negative.");if(n<0)throw new L("byteLength cannot be negative.");if(t+n>e.byteLength)throw new L("sub-region exceeds array bounds.");return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),ty.decode(e)}ty.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};ty.decodeWithFromCharCode=function(e){let t="",n=gve(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 AX(e,t,n){return t<=e&&e<=n}function gve(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let l=0;l<a;++l){let d=e[l];if(i===0){if(AX(d,0,127)){s.push(d);continue}if(AX(d,194,223)){i=1,t=d&31;continue}if(AX(d,224,239)){d===224&&(o=160),d===237&&(r=159),i=2,t=d&15;continue}if(AX(d,240,244)){d===240&&(o=144),d===244&&(r=143),i=3,t=d&7;continue}throw new le("String decoding failed.")}if(!AX(d,o,r)){t=i=n=0,o=128,r=191,--l;continue}o=128,r=191,t=t<<6|d&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?ty.decode=ty.decodeWithTextDecoder:ty.decode=ty.decodeWithFromCharCode;var Il=ty;function xve(e,t){return t=t??0,Il(e,t,Math.min(4,e.length))}var Hm=xve;function Eu(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,c(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Eu.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 MX=Uint32Array.BYTES_PER_ELEMENT;Eu.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=MX;let l=a.getUint32(o,!0);if(l!==1)throw new le(`Only Composite Tile version 1 is supported. Version ${l} is not.`);o+=MX,o+=MX;let d=a.getUint32(o,!0);o+=MX;let u=n.queryParameters.compositeIndex;c(u)?u=`${u}_`:u="";let f=[];f.length=d;for(let h=0;h<d;++h){let g=Hm(s,o),x=a.getUint32(o+MX*2,!0),S=r[g],V=`${u}${h}`,Z=n.getDerivedResource({queryParameters:{compositeIndex:V}});if(c(S))f[h]=Promise.resolve(S(e,t,Z,i,o));else throw new le(`Unknown tile content type, ${g}, inside Composite tile`);o+=x}let p=await Promise.all(f);return new Eu(e,t,n,p)};Eu.prototype.hasProperty=function(e,t){return!1};Eu.prototype.getFeature=function(e){};Eu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Eu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Eu.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)};Eu.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 l=r[a].pick(e,t,n);if(!c(l))continue;let d=m.distance(e.origin,l);d<o&&(i=l,o=d)}if(c(i))return n};Eu.prototype.isDestroyed=function(){return!1};Eu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return he(this)};var NX=Eu;var ddn=_(T(),1);var Ean=_(T(),1);function _ve(e,t,n){return JSON.parse(Il(e,t,n))}var er=_ve;var Ncn=_(T(),1);var Ban=_(T(),1);function mc(e){C.typeOf.number("options.featuresLength",e.featuresLength),C.typeOf.object("options.owner",e.owner),this._id=Hn();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,mt.maximumTextureSize),r=Math.ceil(t/mt.maximumTextureSize),s=1/o,a=s*.5,l=1/r,d=l*.5;n=new D(o,r),i=new ce(s,a,l,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(mc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return c(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),c(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}}});mc.DEFAULT_COLOR_VALUE=Y.WHITE;mc.DEFAULT_SHOW_VALUE=!0;function xoe(e){let t=e._textureDimensions;return t.x*t.y*4}function _oe(e){if(!c(e._batchValues)){let t=xoe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Toe(e){if(!c(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}function kX(e,t){if(!c(e)||e<0||e>=t)throw new L(`batchId is required and between zero and featuresLength - 1 (${t}`-+").")}mc.prototype.setShow=function(e,t){if(kX(e,this._featuresLength),C.typeOf.bool("show",t),t&&!c(this._showAlphaProperties))return;let n=Toe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=_oe(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};mc.prototype.setAllShow=function(e){C.typeOf.bool("show",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};mc.prototype.getShow=function(e){if(kX(e,this._featuresLength),!c(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Tve=new Array(4);mc.prototype.setColor=function(e,t){if(kX(e,this._featuresLength),C.typeOf.object("color",t),Y.equals(t,mc.DEFAULT_COLOR_VALUE)&&!c(this._batchValues))return;let n=t.toBytes(Tve),i=n[3],o=_oe(this),r=e*4,s=Toe(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 l=s[a+1]!==255,d=s[a]!==0;o[r+3]=d?i:0,s[a+1]=i;let u=i!==255;u&&!l?++this._translucentFeaturesLength:!u&&l&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,c(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};mc.prototype.setAllColor=function(e){C.typeOf.object("color",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};mc.prototype.getColor=function(e,t){if(kX(e,this._featuresLength),C.typeOf.object("result",t),!c(this._batchValues))return Y.clone(mc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return Y.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};mc.prototype.getPickColor=function(e){return kX(e,this._featuresLength),this._pickIds[e]};function Soe(e,t,n){let i=e._textureDimensions;return new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:en.NEAREST})}function Sve(e,t){let n=e._featuresLength;if(!c(e._pickTexture)&&n>0){let i=e._pickIds,o=xoe(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let l=0;l<n;++l){let d=t.createPickId(s.getFeature(l));i.push(d);let u=d.color,f=l*4;r[f]=Y.floatToByte(u.red),r[f+1]=Y.floatToByte(u.green),r[f+2]=Y.floatToByte(u.blue),r[f+3]=Y.floatToByte(u.alpha)}e._pickTexture=Soe(e,t,r),c(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function Cve(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}mc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Sve(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,c(this._batchTexture)||(this._batchTexture=Soe(this,n,this._batchValues),c(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),Cve(this))};mc.prototype.isDestroyed=function(){return!1};mc.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 he(this)};var Qc=mc;var dcn=_(T(),1);var $an=_(T(),1);var Vve={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Lve={SCALAR:void 0,VEC2:D,VEC3:m,VEC4:ce,MAT2:Ii,MAT3:te,MAT4:M};function Zve(e){let t=e.componentType,n;typeof t=="string"?n=q.fromName(t):n=t;let i=Vve[e.type],o=Lve[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return q.createArrayBufferView(n,r,s,i*a)}}}var _d=Zve;function Hp(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,C.typeOf.object("options.extension",e.extension),Rve(this,e.extension,e.binaryBody),Ive(this)}Object.defineProperties(Hp.prototype,{byteLength:{get:function(){return this._byteLength}}});function Rve(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,l=t.classIds,d=t.parentCounts,u=t.parentIds,f=s,p=0;c(l.byteOffset)&&(l.componentType=l.componentType??q.UNSIGNED_SHORT,l.type=rn.SCALAR,r=_d(l),l=r.createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,s),p+=l.byteLength);let y;if(c(d)){for(c(d.byteOffset)&&(d.componentType=d.componentType??q.UNSIGNED_SHORT,d.type=rn.SCALAR,r=_d(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),y=new Uint16Array(s),f=0,i=0;i<s;++i)y[i]=f,f+=d[i];p+=y.byteLength}c(u)&&c(u.byteOffset)&&(u.componentType=u.componentType??q.UNSIGNED_SHORT,u.type=rn.SCALAR,r=_d(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,f),p+=u.byteLength);let h=a.length;for(i=0;i<h;++i){let S=a[i].length,V=a[i].instances,Z=Gve(S,V,n);p+=Eve(Z),a[i].instances=St(Z,V)}let g=new Array(h).fill(0),x=new Uint16Array(s);for(i=0;i<s;++i)o=l[i],x[i]=g[o],++g[o];p+=x.byteLength,e._classes=a,e._classIds=l,e._classIndexes=x,e._parentCounts=d,e._parentIndexes=y,e._parentIds=u,e._byteLength=p}function Gve(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new le("componentType is required.");if(!c(l))throw new le("type is required.");if(!c(n))throw new le(`Property ${o} requires a batch table binary.`);let d=_d(r),u=d.componentsPerAttribute,f=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:f}}}return i}function Eve(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var Xve=[];function Ive(e){let t=Xve;t.length=0;let i=e._classIds.length;for(let o=0;o<i;++o)Coe(e,o,t)}function Coe(e,t,n){let i=e._parentCounts,o=e._parentIds,r=e._parentIndexes,a=e._classIds.length;if(!c(o))return;if(t>=a)throw new L(`Parent index ${t} exceeds the total number of instances: ${a}`);if(n.indexOf(t)>-1)throw new L("Circular dependency detected in the batch table hierarchy.");n.push(t);let l=c(i)?i[t]:1,d=c(i)?r[t]:t;for(let u=0;u<l;++u){let f=o[d+u];f!==t&&Coe(e,f,n)}n.pop(t)}var Wve=[],wve=[],Pve=0;function vve(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,l=Wve;l.length=Math.max(l.length,a);let d=++Pve,u=wve;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),l[t]===d)continue;l[t]=d;let f=n(e,t);if(c(f))return f;let p=o[t],y=s[t];for(let h=0;h<p;++h){let g=r[y+h];g!==t&&u.push(g)}}}function Fve(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(c(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function UX(e,t,n){let i=e._parentCounts,o=e._parentIds;if(c(o)){if(c(i))return vve(e,t,n)}else return n(e,t);return Fve(e,t,n)}Hp.prototype.hasProperty=function(e,t){let n=UX(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(c(s[t]))return!0});return c(n)};Hp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(c(o[e]))return!0}return!1};Hp.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,UX(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};Hp.prototype.getProperty=function(e,t){return UX(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(c(a))return c(a.typedArray)?Ave(a,s):He(a[s],!0)})};function Ave(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Hp.prototype.setProperty=function(e,t,n){let i=UX(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],l=o._classIndexes[r],d=a.instances[t];if(c(d)){if(r!==e)throw new L(`Inherited property "${t}" is read-only.`);return c(d.typedArray)?Mve(d,l,n):d[l]=He(n,!0),!0}});return c(i)};function Mve(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Hp.prototype.isClass=function(e,t){let n=UX(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return c(n)};Hp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var t_=Hp;var mcn=_(T(),1),Nve={HIGHLIGHT:0,REPLACE:1,MIX:2},Wl=Object.freeze(Nve);var TH=Qc.DEFAULT_COLOR_VALUE,SH=Qc.DEFAULT_SHOW_VALUE;function _o(e,t,n,i,o){this.featuresLength=t;let r;c(n)&&(r=n.extensions),this._extensions=r??{};let s=kve(n);this._properties=s,this._batchTableHierarchy=Uve(this,n,i);let a=Loe(t,s,i);this._binaryPropertiesByteLength=Ove(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Qc({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}_o._deprecationWarning=Cs;Object.defineProperties(_o.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function kve(e){let t={};if(!c(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=He(e[n],!0));return t}function Uve(e,t,n){if(!c(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(c(o)&&(_o._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),!!c(i))return new t_({extension:i,binaryBody:n})}function Loe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new le("componentType is required.");if(!c(l))throw new le("type is required.");if(!c(n))throw new le(`Property ${o} requires a batch table binary.`);let d=_d(r),u=d.componentsPerAttribute,f=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:f}}}return i}function Ove(e){if(!c(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}_o.getBinaryProperties=function(e,t,n){return Loe(e,t,n)};_o.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};_o.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};_o.prototype.getShow=function(e){return this._batchTexture.getShow(e)};_o.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};_o.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};_o.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};_o.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var Dve=new Y;_o.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(TH),this.setAllShow(SH);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=c(e.color)?e.color.evaluateColor(o,Dve)??TH:TH,s=c(e.show)?e.show.evaluate(o)??SH:SH;this.setColor(i,r),this.setShow(i,s)}};function Bve(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Yve(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}function VC(e,t){if(!c(e)||e<0||e>=t)throw new L(`batchId is required and must be between zero and featuresLength - 1 (${t}`-+").")}_o.prototype.isClass=function(e,t){VC(e,this.featuresLength),C.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};_o.prototype.isExactClass=function(e,t){return C.typeOf.string("className",t),this.getExactClassName(e)===t};_o.prototype.getExactClassName=function(e){VC(e,this.featuresLength);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};_o.prototype.hasProperty=function(e,t){return VC(e,this.featuresLength),C.typeOf.string("name",t),c(this._properties[t])||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};_o.prototype.hasPropertyBySemantic=function(){return!1};_o.prototype.getPropertyIds=function(e,t){VC(e,this.featuresLength),t=c(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};_o.prototype.getPropertyBySemantic=function(e,t){};_o.prototype.getProperty=function(e,t){if(VC(e,this.featuresLength),C.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(c(i))return Bve(i,e)}let n=this._properties[t];if(c(n))return He(n[e],!0);if(c(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(c(i))return i}};_o.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(VC(e,i),C.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(c(r)){Yve(r,e,n);return}}if(c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];c(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=He(n,!0)};function Hve(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)); 
} 
`}_o.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Zoe(o,n,!1),s;return mt.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}
${Hve(i)}${s}`}};function Voe(e,t){return e=Be.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 zve(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d<e.length;++d){let u=e.charAt(d);if(u==="(")++s;else if(u===")"&&(--s,s===0)){r=d+1;break}}let l=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+l+e.slice(r),i=o+l.length,o=e.indexOf(n,i)}return e}function Zoe(e,t,n){if(!c(t))return Voe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!c(o))return Voe(e,n);let r=o[0],s=o[2];e=Be.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); 
} 
`,l=`    tile_featureColor = czm_gammaCorrect(tile_featureColor); 
    out_FragColor.a *= tile_featureColor.a; 
    float highlight = ceil(tile_colorBlend); 
    out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); 
`,d;if(s==="vec3"||s==="vec4"){let u=s==="vec3"?`vec4(${t}, 1.0)`:t,f=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,f),d=`    vec4 source = ${u}; 
    tile_diffuse = tile_diffuse_final(source, tile_featureColor); 
    tile_main(); 
`}else s==="sampler2D"&&(e=zve(e,t),d=`    tile_diffuse = tile_featureColor; 
    tile_main(); 
`);return e=`uniform float tile_colorBlend; 
vec4 tile_diffuse = vec4(1.0); 
${a}${r}
${e}
void tile_color(vec4 tile_featureColor) 
{ 
${d}`,n&&(e+=l),e+=`} 
`,e}_o.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Zoe(i,t,!0),mt.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 Kve(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Wl.HIGHLIGHT)return 0;if(n===Wl.REPLACE)return 1;if(n===Wl.MIX)return w.clamp(i,w.EPSILON4,1);throw new L(`Invalid color blend mode "${n}".`)}_o.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 Kve(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};_o.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ny={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};_o.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,l=Jve(this);for(let d=t;d<i;++d){let u=n[d];if(u.pass===Xe.COMPUTE)continue;let f=u.derivedCommands.tileset;(!c(f)||u.dirty)&&(f={},u.derivedCommands.tileset=f,f.originalCommand=Qve(u),u.dirty=!1);let p=f.originalCommand;l!==ny.ALL_OPAQUE&&u.pass!==Xe.TRANSLUCENT&&(c(f.translucent)||(f.translucent=jve(p))),l!==ny.ALL_TRANSLUCENT&&u.pass!==Xe.TRANSLUCENT&&(c(f.opaque)||(f.opaque=qve(p)),a&&(r||(c(f.zback)||(f.zback=eFe(e.context,p)),s._backfaceCommands.push(f.zback)),(!c(f.stencil)||o._selectionDepth!==nFe(f.stencil))&&(u.renderState.depthMask?f.stencil=tFe(p,o._selectionDepth):f.stencil=f.opaque)));let y=a?f.stencil:f.opaque,h=f.translucent;u.pass!==Xe.TRANSLUCENT?(l===ny.ALL_OPAQUE&&(n[d]=y),l===ny.ALL_TRANSLUCENT&&(n[d]=h),l===ny.OPAQUE_AND_TRANSLUCENT&&(n[d]=y,n.push(h))):n[d]=p}};function Jve(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?ny.ALL_OPAQUE:t===e.featuresLength?ny.ALL_TRANSLUCENT:ny.OPAQUE_AND_TRANSLUCENT}function Qve(e){let t=et.shallowClone(e),n=t.pass===Xe.TRANSLUCENT;return t.uniformMap=c(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function jve(e){let t=et.shallowClone(e);return t.pass=Xe.TRANSLUCENT,t.renderState=iFe(e.renderState),t}function qve(e){let t=et.shallowClone(e);return t.renderState=oFe(e.renderState),t}function $ve(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!c(n)){let i=t.fragmentShaderSource.clone();i.defines=c(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 eFe(e,t){let n=et.shallowClone(t),i=He(n.renderState,!0);i.cull.enabled=!0,i.cull.face=_i.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK,n.renderState=Oe.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=He(t.uniformMap);let o=new D(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=$ve(e,t.shaderProgram),n}function tFe(e,t){let n=et.shallowClone(e),i=He(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=kt.SKIP_LOD_MASK,i.stencilTest.reference=kt.CESIUM_3D_TILE_MASK|t<<kt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=On.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ft.REPLACE,i.stencilTest.backFunction=On.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ft.REPLACE,i.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,n.renderState=Oe.fromCache(i),n}function nFe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function iFe(e){let t=He(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Oe.fromCache(t)}function oFe(e){let t=He(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,Oe.fromCache(t)}_o.prototype.update=function(e,t){this._batchTexture.update(e,t)};_o.prototype.isDestroyed=function(){return!1};_o.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),he(this)};var zp=_o;var $ln=_(T(),1);var Ucn=_(T(),1);function rFe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var bh=rFe;var Uln=_(T(),1);var Dcn=_(T(),1),LC=`in vec3 position;
in float a_batchId;
uniform mat4 u_modifiedModelViewProjection;
void main()
{
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;var zcn=_(T(),1);function Xu(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(Xu.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 c(this._color)||(this._color=new Y),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(c(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)}}});Xu.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};Xu.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};Xu.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};Xu.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(c(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(c(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(c(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(c(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),c(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let l=c(e.group)?e.group.metadata:void 0;if(c(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}let d=e.tileset.metadata;if(c(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};Xu.prototype.getPropertyInherited=function(e){return Xu.getPropertyInherited(this._content,this._batchId,e)};Xu.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};Xu.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};Xu.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};Xu.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Us=Xu;var uln=_(T(),1);var Qcn=_(T(),1),CH=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)})}},VH=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)})}},wl=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,l,d;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},d=n;let u=f=>r.right_a&&f.right_a?i>f.prec:i<=f.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(l=o.length-1,t=o[l];l>1;)t={type:e.BINARY_EXP,operator:o[l-1].value,left:o[l-2],right:t},l-=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)}}},sFe=new CH;Object.assign(wl,{hooks:sFe,plugins:new VH(wl),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"});wl.max_unop_len=wl.getMaxKeyLen(wl.unary_ops);wl.max_binop_len=wl.getMaxKeyLen(wl.binary_ops);var iy=e=>new wl(e).parse(),aFe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(wl).filter(e=>!aFe.includes(e)&&iy[e]===void 0).forEach(e=>{iy[e]=wl[e]});iy.Jsep=wl;var cFe="ConditionalExpression",lFe={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:cFe,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 :")}})}};iy.plugins.register(lFe);var qcn=_(T(),1),dFe={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},gt=Object.freeze(dFe);function zm(e,t){C.typeOf.string("expression",e),this._expression=e,e=CFe(e,t),e=LFe(VFe(e)),iy.addBinaryOp("=~",0),iy.addBinaryOp("!~",0);let n;try{n=iy(e)}catch(i){throw new le(i)}this._runtimeAst=Zi(this,n)}Object.defineProperties(zm.prototype,{expression:{get:function(){return this._expression}}});var Pn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],cartesian3Array:[new m],cartesian4Array:[new ce],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new D),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new m),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ce),this.cartesian4Array[this.cartesian4Index++]}};zm.prototype.evaluate=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof Y&&n instanceof ce?Y.fromCartesian4(n,t):n instanceof D||n instanceof m||n instanceof ce?n.clone(t):n};zm.prototype.evaluateColor=function(e,t){Pn.reset();let n=this._runtimeAst.evaluate(e);return Y.fromCartesian4(n,t)};zm.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
    return ${o};
}
`,o};zm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};zm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var uFe=["!","-","+"],Roe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],OX=/\${(.*?)}/g,mFe=/\\/g,fFe="@#%",hFe=/@#%/g,R5=new Y,G5={abs:Os(Math.abs),sqrt:Os(Math.sqrt),cos:Os(Math.cos),sin:Os(Math.sin),tan:Os(Math.tan),acos:Os(Math.acos),asin:Os(Math.asin),atan:Os(Math.atan),radians:Os(w.toRadians),degrees:Os(w.toDegrees),sign:Os(w.sign),floor:Os(Math.floor),ceil:Os(Math.ceil),round:Os(Math.round),exp:Os(Math.exp),exp2:Os(bFe),log:Os(Math.log),log2:Os(yFe),fract:Os(pFe),length:gFe,normalize:xFe},E5={atan2:L5(Math.atan2,!1),pow:L5(Math.pow,!1),min:L5(Math.min,!0),max:L5(Math.max,!0),distance:_Fe,dot:TFe,cross:SFe},RH={clamp:Goe(w.clamp,!0),mix:Goe(w.lerp,!0)};function pFe(e){return e-Math.floor(e)}function bFe(e){return Math.pow(2,e)}function yFe(e){return w.log2(e)}function Os(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof D)return D.fromElements(e(n.x),e(n.y),Pn.getCartesian2());if(n instanceof m)return m.fromElements(e(n.x),e(n.y),e(n.z),Pn.getCartesian3());if(n instanceof ce)return ce.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Pn.getCartesian4());throw new le(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function L5(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof D)return D.fromElements(e(i.x,o),e(i.y,o),Pn.getCartesian2());if(i instanceof m)return m.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Pn.getCartesian3());if(i instanceof ce)return ce.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x),e(i.y,o.y),Pn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Pn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Pn.getCartesian4());throw new le(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Goe(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 D&&o instanceof D)return D.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Pn.getCartesian2());if(i instanceof m&&o instanceof m)return m.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Pn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Pn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);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),Pn.getCartesian2());if(i instanceof m&&o instanceof m&&r instanceof m)return m.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Pn.getCartesian3());if(i instanceof ce&&o instanceof ce&&r instanceof ce)return ce.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Pn.getCartesian4());throw new le(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function gFe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof D)return D.magnitude(t);if(t instanceof m)return m.magnitude(t);if(t instanceof ce)return ce.magnitude(t);throw new le(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function xFe(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,Pn.getCartesian2());if(t instanceof m)return m.normalize(t,Pn.getCartesian3());if(t instanceof ce)return ce.normalize(t,Pn.getCartesian4());throw new le(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function _Fe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof D&&n instanceof D)return D.distance(t,n);if(t instanceof m&&n instanceof m)return m.distance(t,n);if(t instanceof ce&&n instanceof ce)return ce.distance(t,n);throw new le(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function TFe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof D&&n instanceof D)return D.dot(t,n);if(t instanceof m&&n instanceof m)return m.dot(t,n);if(t instanceof ce&&n instanceof ce)return ce.dot(t,n);throw new le(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function SFe(e,t,n){if(t instanceof m&&n instanceof m)return m.cross(t,n,Pn.getCartesian3());throw new le(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Vt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,vFe(this)}function CFe(e,t){if(!c(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;c(o)&&(e=e.replace(i,o))}return e}function VFe(e){return e.replace(mFe,fFe)}function ZH(e){return e.replace(hFe,"\\")}function LFe(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 le("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function ZFe(e){let t=typeof e.value;if(e.value===null)return new Vt(gt.LITERAL_NULL,null);if(t==="boolean")return new Vt(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Vt(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Vt(gt.VARIABLE_IN_STRING,e.value):new Vt(gt.LITERAL_STRING,ZH(e.value))}function RFe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let l=t.callee.object;if(o==="test"||o==="exec"){if(!c(l.callee)||l.callee.name!=="regExp")throw new le(`${o} is not a function.`);return i===0?o==="test"?new Vt(gt.LITERAL_BOOLEAN,!1):new Vt(gt.LITERAL_NULL,null):(s=Zi(e,l),a=Zi(e,n[0]),new Vt(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Zi(e,l),new Vt(gt.FUNCTION_CALL,o,r);throw new le(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Vt(gt.LITERAL_COLOR,o);if(r=Zi(e,n[0]),c(n[1])){let l=Zi(e,n[1]);return new Vt(gt.LITERAL_COLOR,o,[r,l])}return new Vt(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new le(`${o} requires three arguments.`);return r=[Zi(e,n[0]),Zi(e,n[1]),Zi(e,n[2])],new Vt(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new le(`${o} requires four arguments.`);return r=[Zi(e,n[0]),Zi(e,n[1]),Zi(e,n[2]),Zi(e,n[3])],new Vt(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let l=0;l<i;++l)r[l]=Zi(e,n[l]);return new Vt(gt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Vt(gt.LITERAL_BOOLEAN,!0):new Vt(gt.LITERAL_BOOLEAN,!1):(r=Zi(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new le(`${o} requires exactly one argument.`);return r=Zi(e,n[0]),new Vt(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new le(`${o} does not take any argument.`);return new Vt(gt.UNARY,o)}else if(c(G5[o])){if(i!==1)throw new le(`${o} requires exactly one argument.`);return r=Zi(e,n[0]),new Vt(gt.UNARY,o,r)}else if(c(E5[o])){if(i!==2)throw new le(`${o} requires exactly two arguments.`);return s=Zi(e,n[0]),a=Zi(e,n[1]),new Vt(gt.BINARY,o,s,a)}else if(c(RH[o])){if(i!==3)throw new le(`${o} requires exactly three arguments.`);s=Zi(e,n[0]),a=Zi(e,n[1]);let l=Zi(e,n[2]);return new Vt(gt.TERNARY,o,s,a,l)}else{if(o==="Boolean")return i===0?new Vt(gt.LITERAL_BOOLEAN,!1):(r=Zi(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="Number")return i===0?new Vt(gt.LITERAL_NUMBER,0):(r=Zi(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="String")return i===0?new Vt(gt.LITERAL_STRING,""):(r=Zi(e,n[0]),new Vt(gt.UNARY,o,r));if(o==="regExp")return GFe(e,t)}}throw new le(`Unexpected function call "${o}".`)}function GFe(e,t){let n=t.arguments;if(n.length===0)return new Vt(gt.LITERAL_REGEX,new RegExp);let i=Zi(e,n[0]),o;if(n.length>1){let r=Zi(e,n[1]);if(LH(i)&&LH(r)){try{o=new RegExp(ZH(String(i._value)),r._value)}catch(s){throw new le(s)}return new Vt(gt.LITERAL_REGEX,o)}return new Vt(gt.REGEX,i,r)}if(LH(i)){try{o=new RegExp(ZH(String(i._value)))}catch(r){throw new le(r)}return new Vt(gt.LITERAL_REGEX,o)}return new Vt(gt.REGEX,i)}function EFe(e){if(wFe(e.name)){let t=PFe(e.name);return t.substr(0,8)==="tiles3d_"?new Vt(gt.BUILTIN_VARIABLE,t):new Vt(gt.VARIABLE,t)}else{if(e.name==="NaN")return new Vt(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Vt(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Vt(gt.LITERAL_UNDEFINED,void 0)}throw new le(`${e.name} is not defined.`)}function XFe(e){let t=e.property.name;if(t==="PI")return new Vt(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Vt(gt.LITERAL_NUMBER,Math.E)}function IFe(e){if(e.property.name==="POSITIVE_INFINITY")return new Vt(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function WFe(e,t){if(t.object.name==="Math")return XFe(t);if(t.object.name==="Number")return IFe(t);let n,i=Zi(e,t.object);return t.computed?(n=Zi(e,t.property),new Vt(gt.MEMBER,"brackets",i,n)):(n=new Vt(gt.LITERAL_STRING,t.property.name),new Vt(gt.MEMBER,"dot",i,n))}function LH(e){return e._type>=gt.LITERAL_NULL}function wFe(e){return e.substr(0,4)==="czm_"}function PFe(e){return e.substr(4)}function Zi(e,t){let n,i,o,r;if(t.type==="Literal")n=ZFe(t);else if(t.type==="CallExpression")n=RFe(e,t);else if(t.type==="Identifier")n=EFe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Zi(e,t.argument);if(uFe.indexOf(i)>-1)n=new Vt(gt.UNARY,i,s);else throw new le(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Zi(e,t.left),r=Zi(e,t.right),Roe.indexOf(i)>-1)n=new Vt(gt.BINARY,i,o,r);else throw new le(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Zi(e,t.left),r=Zi(e,t.right),Roe.indexOf(i)>-1&&(n=new Vt(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Zi(e,t.test);o=Zi(e,t.consequent),r=Zi(e,t.alternate),n=new Vt(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=WFe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Zi(e,t.elements[a]);n=new Vt(gt.ARRAY,s)}else throw t.type==="Compound"?new le("Provide exactly one expression."):new le("Cannot parse expression.");return n}function vFe(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.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===gt.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:c(G5[e._value])&&(e.evaluate=AFe(e._value)):e._type===gt.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:c(E5[e._value])&&(e.evaluate=MFe(e._value)):e._type===gt.TERNARY?e.evaluate=NFe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=FFe):e.evaluate=e._evaluateLiteral}function FFe(e){return c(e)?e.content.tileset.timeSinceLoad:0}function AFe(e){let t=G5[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function MFe(e){let t=E5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function NFe(e){let t=RH[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 X5(e,t){if(c(e))return e.getPropertyInherited(t)}Vt.prototype._evaluateLiteral=function(){return this._value};Vt.prototype._evaluateLiteralColor=function(e){let t=R5,n=this._left;if(this._value==="color")c(n)?n.length>1?(Y.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):Y.fromCssColorString(n[0].evaluate(e),t):Y.fromBytes(255,255,255,255,t);else if(this._value==="rgb")Y.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;Y.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&Y.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ce.fromColor(t,Pn.getCartesian4())};Vt.prototype._evaluateLiteralVector=function(e){let t=Pn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let l=i[a].evaluate(e);if(typeof l=="number")t.push(l);else if(l instanceof D)t.push(l.x,l.y);else if(l instanceof m)t.push(l.x,l.y,l.z);else if(l instanceof ce)t.push(l.x,l.y,l.z,l.w);else throw new le(`${n} argument must be a vector or number. Argument is ${l}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new le(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new le(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new le(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return D.fromArray(t,0,Pn.getCartesian2());if(n==="vec3")return m.fromArray(t,0,Pn.getCartesian3());if(n==="vec4")return ce.fromArray(t,0,Pn.getCartesian4())};Vt.prototype._evaluateLiteralString=function(){return this._value};Vt.prototype._evaluateVariableString=function(e){let t=this._value,n=OX.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=X5(e,o);c(r)||(r=""),t=t.replace(i,r),OX.lastIndex+=r.length-i.length,n=OX.exec(t)}return t};Vt.prototype._evaluateVariable=function(e){return X5(e,this._value)};function n_(e){return e._value==="feature"}Vt.prototype._evaluateMemberDot=function(e){if(n_(this._left))return X5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof ce){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Vt.prototype._evaluateMemberBrackets=function(e){if(n_(this._left))return X5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof m||t instanceof ce){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Vt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Vt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new le(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Vt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof D)return D.negate(t,Pn.getCartesian2());if(t instanceof m)return m.negate(t,Pn.getCartesian3());if(t instanceof ce)return ce.negate(t,Pn.getCartesian4());if(typeof t=="number")return-t;throw new le(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Vt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof D||t instanceof m||t instanceof ce||typeof t=="number"))throw new le(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Vt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new le(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Vt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new le(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Vt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new le(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Vt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new le(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Vt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new le(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new le(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Vt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new le(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new le(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Vt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.add(t,n,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.add(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.add(t,n,Pn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new le(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.subtract(t,n,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.subtract(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.subtract(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new le(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.multiplyComponents(t,n,Pn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,Pn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.multiplyComponents(t,n,Pn.getCartesian3());if(n instanceof m&&typeof t=="number")return m.multiplyByScalar(n,t,Pn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.multiplyByScalar(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.multiplyComponents(t,n,Pn.getCartesian4());if(n instanceof ce&&typeof t=="number")return ce.multiplyByScalar(n,t,Pn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.multiplyByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new le(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.divideComponents(t,n,Pn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.divideComponents(t,n,Pn.getCartesian3());if(t instanceof m&&typeof n=="number")return m.divideByScalar(t,n,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.divideComponents(t,n,Pn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.divideByScalar(t,n,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new le(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.fromElements(t.x%n.x,t.y%n.y,Pn.getCartesian2());if(n instanceof m&&t instanceof m)return m.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Pn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Pn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new le(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof ce&&t instanceof ce?t.equals(n):t===n};Vt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof m&&t instanceof m||n instanceof ce&&t instanceof ce?!t.equals(n):t!==n};Vt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new le(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Vt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Vt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Vt.prototype._evaluateIsExactClass=function(e){return c(e)?e.isExactClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateIsClass=function(e){return c(e)?e.isClass(this._left.evaluate(e)):!1};Vt.prototype._evaluateGetExactClassName=function(e){if(c(e))return e.getExactClassName()};Vt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Vt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Vt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Vt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";c(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new le(o)}return i};Vt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new le(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Vt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new le(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new le(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Vt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new le(`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 c(i)?i[1]:null};Vt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof D||t instanceof m||t instanceof ce)return String(t);throw new le(`Unexpected function call "${this._value}".`)};function Eoe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return Y.fromHsl(i,o,r,s,R5)}function Xoe(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==gt.LITERAL_NUMBER)return;let i=R5;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 oy(e){return e%1===0?e.toFixed(1):e.toString()}function kFe(e){let t=oy(e.red),n=oy(e.green),i=oy(e.blue);return`vec3(${t}, ${n}, ${i})`}function Z5(e){let t=oy(e.red),n=oy(e.green),i=oy(e.blue),o=oy(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function Ioe(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 Woe(e,t){return c(t[e])?t[e]:zm.NULL_SENTINEL}zm.NULL_SENTINEL="czm_infinity";Vt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,l=this._value;c(this._left)&&(Array.isArray(this._left)?o=Ioe(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),c(this._right)&&(r=this._right.getShaderExpression(e,t,this)),c(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(l=Ioe(this._value,e,t,this));let d,u,f;switch(a){case gt.VARIABLE:return n_(this)?void 0:Woe(l,e);case gt.UNARY:if(l==="Boolean")return`bool(${o})`;if(l==="Number")return`float(${o})`;if(l==="round")return`floor(${o} + 0.5)`;if(c(G5[l]))return`${l}(${o})`;if(l==="isNaN")return`(${o} != ${o})`;if(l==="isFinite")return`(abs(${o}) < czm_infinity)`;if(l==="String"||l==="isExactClass"||l==="isClass"||l==="getExactClassName")throw new le(`Error generating style shader: "${l}" is not supported.`);return l+o;case gt.BINARY:return l==="%"?`mod(${o}, ${r})`:l==="==="?`(${o} == ${r})`:l==="!=="?`(${o} != ${r})`:l==="atan2"?`atan(${o}, ${r})`:c(E5[l])?`${l}(${o}, ${r})`:`(${o} ${l} ${r})`;case gt.TERNARY:if(c(RH[l]))return`${l}(${o}, ${r}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case gt.MEMBER:return n_(this._left)?Woe(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 gt.FUNCTION_CALL:throw new le(`Error generating style shader: "${l}" is not supported.`);case gt.ARRAY:if(l.length===4)return`vec4(${l[0]}, ${l[1]}, ${l[2]}, ${l[3]})`;if(l.length===3)return`vec3(${l[0]}, ${l[1]}, ${l[2]})`;if(l.length===2)return`vec2(${l[0]}, ${l[1]})`;throw new le("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new le("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new le("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return zm.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return l?"true":"false";case gt.LITERAL_NUMBER:return oy(l);case gt.LITERAL_STRING:if(c(n)&&n._type===gt.MEMBER&&(l==="r"||l==="g"||l==="b"||l==="a"||l==="x"||l==="y"||l==="z"||l==="w"||n_(n._left)))return l;if(i=Y.fromCssColorString(l,R5),c(i))return kFe(i);throw new le("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(d=o,l==="color"){if(c(d)){if(d.length>1){let p=d[0],y=d[1];return y!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${y})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(l==="rgb")return i=Xoe(this),c(i)?Z5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(l==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=Xoe(this),c(i)?Z5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(l==="hsl")return i=Eoe(this),c(i)?Z5(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(l==="hsla")return i=Eoe(this),c(i)?(i.alpha!==1&&(t.translucent=!0),Z5(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case gt.LITERAL_VECTOR:if(!c(o))throw new L("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");u=o.length,f=`${l}(`;for(let p=0;p<u;++p)f+=o[p],p<u-1&&(f+=", ");return f+=")",f;case gt.LITERAL_REGEX:throw new le("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return zm.NULL_SENTINEL;case gt.BUILTIN_VARIABLE:if(l==="tiles3d_tileset_time")return l}};Vt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(c(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(c(this._right)&&this._right.getVariables(e,this),c(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 gt.VARIABLE:n_(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=OX.exec(s);a!==null;)e.push(a[1]),a=OX.exec(s);break;case gt.LITERAL_STRING:c(t)&&t._type===gt.MEMBER&&n_(t._left)&&e.push(s);break}};var Iu=zm;function Kp(e){e=e??z.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??m.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=Y.clone(Y.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??Un.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(Kp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var UFe={position:0,a_batchId:1};function OFe(e,t){if(c(e._va))return;let n=_t.createVertexBuffer({context:t,typedArray:e._positions,usage:Ne.STATIC_DRAW}),i=_t.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Ne.STATIC_DRAW}),o=_t.createIndexBuffer({context:t,typedArray:e._indices,usage:Ne.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Me.UNSIGNED_SHORT:Me.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 ni({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ni({context:t,attributes:r,indexBuffer:_t.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Ne.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function DFe(e,t){if(c(e._sp))return;let n=e._batchTable,i=e._attributeLocations??UFe,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(c(r)){e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Be.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`,e._spPick=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(LC),l=n.getFragmentShaderCallback(!1,void 0,!0)(Q0);o=n.getPickId();let d=new Be({sources:[a]}),u=new Be({defines:["VECTOR_TILE"],sources:[l]});e._sp=tn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new Be({sources:[LC]}),u=new Be({defines:["VECTOR_TILE"],sources:[Q0]}),e._spStencil=tn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),l=Be.replaceMain(l,"czm_non_pick_main"),l=`${l}
void main() 
{ 
    czm_non_pick_main(); 
    out_FragColor = ${o}; 
} 
`;let f=new Be({sources:[a]}),p=new Be({defines:["VECTOR_TILE"],sources:[l]});e._spPick=tn.fromCache({context:t,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:i})}function woe(e){let t=e?On.EQUAL:On.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:t,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},depthMask:!1}}var BFe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},YFe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function HFe(e){c(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Oe.fromCache(woe(!1)),e._rsStencilDepthPass3DTiles=Oe.fromCache(woe(!0)),e._rsColorPass=Oe.fromCache(BFe),e._rsPickPass=Oe.fromCache(YFe))}var i_=new M,Poe=new m;function zFe(e,t){if(c(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return M.clone(i,i_),M.multiplyByPoint(i_,e._center,Poe),M.setTranslation(i_,Poe,i_),M.multiply(o,i_,i_),i_},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function GH(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,l=r.length;for(let d=0;d<l;++d){let u=r[d],f=s[u],p=i[f],y=o[f],h=new e.constructor(e.buffer,a*p,y);t.set(h,n),i[f]=n,n+=y}return n}function KFe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),l=[a],d=GH(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(Y.equals(u.color,a.color))d=GH(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let f=d;d=GH(n,s,d,i,o,u.batchIds,r),u.offset=f,u.count=d-f,l.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=l}function EH(e,t,n,i,o,r,s){let a=e.bytesPerIndex,l=r.length;for(let d=0;d<l;++d){let u=r[d],f=s[u],p=i[f],y=o[f];t.copyFromBuffer(e,p*a,n*a,y*a),i[f]=n,n+=y}return n}function JFe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,l=e._vaSwap.indexBuffer,d=EH(a,l,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let f=t.pop();if(Y.equals(f.color,r.color))d=EH(a,l,d,n,i,f.batchIds,o),r.batchIds=r.batchIds.concat(f.batchIds),r.count=d-r.offset;else{let p=d;d=EH(a,l,d,n,i,f.batchIds,o),f.offset=p,f.count=d-p,s.push(f),r=f}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function QFe(e,t){return t.color.toRgba()-e.color.toRgba()}function jFe(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 l=n[s].color.toRgba();if(c(r[l])){o=!0;break}else r[l]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(QFe),t.webgl2?JFe(e,n):KFe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function qFe(e,t){let n=jFe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(c(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,l=e._sp,d=e._modelMatrix??M.IDENTITY,u=e._uniformMap,f=e._boundingVolume;for(let p=0;p<r;++p){let y=o[p].offset,h=o[p].count,g=i[p*2];c(g)||(g=i[p*2]=new et({owner:e})),g.vertexArray=a,g.modelMatrix=d,g.offset=y,g.count=h,g.renderState=e._rsStencilDepthPass,g.shaderProgram=l,g.uniformMap=u,g.boundingVolume=f,g.cull=!1,g.pass=Xe.TERRAIN_CLASSIFICATION;let x=et.shallowClone(g,g.derivedCommands.tileset);x.renderState=e._rsStencilDepthPass3DTiles,x.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=x;let S=i[p*2+1];c(S)||(S=i[p*2+1]=new et({owner:e})),S.vertexArray=a,S.modelMatrix=d,S.offset=y,S.count=h,S.renderState=e._rsColorPass,S.shaderProgram=l,S.uniformMap=u,S.boundingVolume=f,S.cull=!1,S.pass=Xe.TERRAIN_CLASSIFICATION;let V=et.shallowClone(S,S.derivedCommands.tileset);V.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,S.derivedCommands.tileset=V}e._commandsDirty=!0}function $Fe(e,t){if(e.classificationType===Un.TERRAIN||!t.invertClassification||c(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 l=0;l<s;++l){let d=i[l]=et.shallowClone(n[a],i[l]);d.shaderProgram=o,d.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function eAe(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 l=0;l<t;++l){let d=e._indexOffsets[l],u=e._indexCounts[l],f=c(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,p=n[l*2];c(p)||(p=n[l*2]=new et({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=d,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=f,p.pass=Xe.TERRAIN_CLASSIFICATION;let y=et.shallowClone(p,p.derivedCommands.tileset);y.renderState=e._rsStencilDepthPass3DTiles,y.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=y;let h=n[l*2+1];c(h)||(h=n[l*2+1]=new et({owner:e,pickOnly:!0})),h.vertexArray=i,h.modelMatrix=s,h.offset=d,h.count=u,h.renderState=e._rsPickPass,h.shaderProgram=r,h.uniformMap=a,h.boundingVolume=f,h.pass=Xe.TERRAIN_CLASSIFICATION;let g=et.shallowClone(h,h.derivedCommands.tileset);g.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,h.derivedCommands.tileset=g}e._pickCommandsDirty=!1}Kp.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 Us(e,r)}};Kp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function tAe(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=Y.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=Y.clone(Y.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var nAe=new Y,iAe=Y.WHITE,oAe=!0,rAe=/\$/;Kp.prototype.applyStyle=function(e,t){if(!c(e)){tAe(this,t);return}let n=e.color,i=n instanceof Iu&&!rAe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],l=t[a];l.color=c(e.color)?e.color.evaluateColor(l,nAe):iAe,l.show=c(e.show)?e.show.evaluate(l):oAe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=Y.clone(Y.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Kp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!c(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],l=this._batchedIndices,d=l.length,u;for(u=0;u<d;++u){let g=l[u].offset,x=l[u].count;if(s>=g&&s<g+x)break}l.push(new bh({color:Y.clone(t),offset:s,count:a,batchIds:[e]}));let f=[],p=[],y=l[u].batchIds,h=y.length;for(let g=0;g<h;++g){let x=y[g];if(x===e)continue;let S=n[x];o[S]<s?f.push(x):p.push(x)}p.length!==0&&l.push(new bh({color:Y.clone(l[u].color),offset:s+a,count:l[u].offset+l[u].count-(s+a),batchIds:p})),f.length!==0?(l[u].count=s-l[u].offset,l[u].batchIds=f):l.splice(u,1),this._batchDirty=!0};function voe(e,t,n,i){let o=e.classificationType,r=o!==Un.CESIUM_3D_TILE,s=o!==Un.TERRAIN,a=t.commandList,l=n.length,d,u;for(u=0;u<l;++u)r&&(d=n[u],d.pass=Xe.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,a.push(d));if(!(!t.invertClassification||!c(i)))for(l=i.length,u=0;u<l;++u)a.push(i[u])}function sAe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Xe.OPAQUE,n.push(r)}}function aAe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;c(e._rsWireframe)||(e._rsWireframe=Oe.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=ve.LINES):(n=e._rsColorPass,i=ve.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}Kp.prototype.update=function(e){let t=e.context;OFe(this,t),DFe(this,t),HFe(this),zFe(this,t);let n=e.passes;n.render&&(qFe(this,t),$Fe(this,e),aAe(this),this._debugWireframe?sAe(e,this._commands):voe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(eAe(this),voe(this,e,this._pickCommands))};Kp.prototype.isDestroyed=function(){return!1};Kp.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(),he(this)};var o_=Kp;function Td(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,c(this._center)||(c(this._boundingVolume)?this._center=m.clone(this._boundingVolume.center):this._center=m.clone(m.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Un.BOTH}Object.defineProperties(Td.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Td.packedBoxLength=M.packedLength+m.packedLength;Td.packedCylinderLength=M.packedLength+2;Td.packedEllipsoidLength=M.packedLength+m.packedLength;Td.packedSphereLength=m.packedLength+1;function cAe(e){let t=new Float64Array(M.packedLength+m.packedLength),n=0;return m.pack(e._center,t,n),n+=m.packedLength,M.pack(e._modelMatrix,t,n),t}function lAe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let l=0;l<o;++l)r[l]=ue.unpack(t,n),n+=ue.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let l=0;l<s;++l){let d=Y.unpack(t,n);n+=Y.packedLength;let u=t[n++],f=t[n++],p=t[n++],y=new Array(p);for(let h=0;h<p;++h)y[h]=t[n++];a[l]=new bh({color:d,offset:u,count:f,batchIds:y})}return i}var dAe=new gi("createVectorTileGeometries",5),uAe=new Y;function mAe(e){if(!c(e._primitive)&&!c(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,l=e._sphereBatchIds,d=e._batchTableColors,u=e._packedBuffer;if(!c(d)){let h=0;c(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),h+=n.length),c(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),h+=o.length),c(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),h+=s.length),c(e._spheres)&&(a=e._sphere=a.slice(),l=e._sphereBatchIds=l.slice(),h+=l.length),d=e._batchTableColors=new Uint32Array(h);let g=e._batchTable;for(let x=0;x<h;++x){let S=g.getColor(x,uAe);d[x]=S.toRgba()}u=e._packedBuffer=cAe(e)}let f=[];c(t)&&f.push(t.buffer,n.buffer),c(i)&&f.push(i.buffer,o.buffer),c(r)&&f.push(r.buffer,s.buffer),c(a)&&f.push(a.buffer,l.buffer),f.push(d.buffer,u.buffer);let p={boxes:c(t)?t.buffer:void 0,boxBatchIds:c(t)?n.buffer:void 0,cylinders:c(i)?i.buffer:void 0,cylinderBatchIds:c(i)?o.buffer:void 0,ellipsoids:c(r)?r.buffer:void 0,ellipsoidBatchIds:c(r)?s.buffer:void 0,spheres:c(a)?a.buffer:void 0,sphereBatchIds:c(a)?l.buffer:void 0,batchTableColors:d.buffer,packedBuffer:u.buffer},y=e._verticesPromise=dAe.scheduleTask(p,f);return c(y)?y.then(function(h){if(e.isDestroyed())return;let g=new Float64Array(h.packedBuffer);lAe(e,g)===2?e._indices=new Uint16Array(h.indices):e._indices=new Uint32Array(h.indices),e._indexOffsets=new Uint32Array(h.indexOffsets),e._indexCounts=new Uint32Array(h.indexCounts),e._positions=new Float32Array(h.positions),e._vertexBatchIds=new Uint16Array(h.vertexBatchIds),e._batchIds=new Uint16Array(h.batchIds),fAe(e),e._ready=!0}).catch(h=>{e.isDestroyed()||(e._error=h)}):void 0}}function fAe(e){c(e._primitive)||(e._primitive=new o_({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)}Td.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Td.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Td.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Td.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Td.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=mAe(this)),c(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)};Td.prototype.isDestroyed=function(){return!1};Td.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};var Jp=Td;function yh(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,bAe(this,i,o)}Object.defineProperties(yh.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return c(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return c(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 hAe(e){return function(t,n){c(e._geometries)&&e._geometries.updateCommands(t,n)}}function pAe(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,l=e.CYLINDERS_LENGTH??0,d=e.ELLIPSOIDS_LENGTH??0,u=e.SPHERES_LENGTH??0;if(a>0&&c(e.BOX_BATCH_IDS)){let h=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,h,a)}if(l>0&&c(e.CYLINDER_BATCH_IDS)){let h=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,h,l)}if(d>0&&c(e.ELLIPSOID_BATCH_IDS)){let h=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,h,d)}if(u>0&&c(e.SPHERE_BATCH_IDS)){let h=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,h,u)}let f=c(n)||c(i)||c(o)||c(r),p=a>0&&!c(n)||l>0&&!c(i)||d>0&&!c(o)||u>0&&!c(r);if(f&&p)throw new le("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)&&!c(r)){let h=0;if(!c(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=h++;if(!c(i)&&l>0)for(i=new Uint16Array(l),s=0;s<l;++s)i[s]=h++;if(!c(o)&&d>0)for(o=new Uint16Array(d),s=0;s<d;++s)o[s]=h++;if(!c(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=h++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var r_=Uint32Array.BYTES_PER_ELEMENT;function bAe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=r_;let r=o.getUint32(n,!0);if(r!==1)throw new le(`Only Geometry tile version 1 is supported.  Version ${r} is not.`);n+=r_;let s=o.getUint32(n,!0);if(n+=r_,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=r_,a===0)throw new le("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=r_;let d=o.getUint32(n,!0);n+=r_;let u=o.getUint32(n,!0);n+=r_;let f=er(i,n,a);n+=a;let p=new Uint8Array(t,n,l);n+=l;let y,h;d>0&&(y=er(i,n,d),n+=d,u>0&&(h=new Uint8Array(t,n,u),h=new Uint8Array(h)));let g=f.BOXES_LENGTH??0,x=f.CYLINDERS_LENGTH??0,S=f.ELLIPSOIDS_LENGTH??0,V=f.SPHERES_LENGTH??0,Z=g+x+S+V,R=new zp(e,Z,y,h,hAe(e));if(e._batchTable=R,Z===0)return;let E=e.tile.computedTransform,I;c(f.RTC_CENTER)&&(I=m.unpack(f.RTC_CENTER),M.multiplyByPoint(E,I,I));let v=pAe(f,p);if(g>0||x>0||S>0||V>0){let P,F,N,b;if(g>0){let G=p.byteOffset+f.BOXES.byteOffset;P=new Float32Array(p.buffer,G,Jp.packedBoxLength*g)}if(x>0){let G=p.byteOffset+f.CYLINDERS.byteOffset;F=new Float32Array(p.buffer,G,Jp.packedCylinderLength*x)}if(S>0){let G=p.byteOffset+f.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,G,Jp.packedEllipsoidLength*S)}if(V>0){let G=p.byteOffset+f.SPHERES.byteOffset;b=new Float32Array(p.buffer,G,Jp.packedSphereLength*V)}return e._geometries=new Jp({boxes:P,boxBatchIds:v.boxes,cylinders:F,cylinderBatchIds:v.cylinders,ellipsoids:N,ellipsoidBatchIds:v.ellipsoids,spheres:b,sphereBatchIds:v.spheres,center:I,modelMatrix:E,batchTable:R,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function Foe(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}yh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};yh.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new L(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return Foe(this),this._features[e]};yh.prototype.applyDebugSettings=function(e,t){c(this._geometries)&&this._geometries.applyDebugSettings(e,t)};yh.prototype.applyStyle=function(e){Foe(this),c(this._geometries)&&this._geometries.applyStyle(e,this._features)};yh.prototype.update=function(e,t){c(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),c(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};yh.prototype.pick=function(e,t,n){};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),he(this)};var DX=yh;var Mgn=_(T(),1);var hdn=_(T(),1);var XH={};XH.encode2D=function(e,t,n){let i=Math.pow(2,e);if(C.typeOf.number("level",e),C.typeOf.number("x",t),C.typeOf.number("y",n),e<1)throw new L("Hilbert level cannot be less than 1.");if(t<0||t>=i||n<0||n>=i)throw new L("Invalid coordinates for given level.");let o={x:t,y:n},r,s,a,l=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,l+=BigInt((3*r^s)*a*a),Aoe(i,o,r,s);return l};XH.decode2D=function(e,t){if(C.typeOf.number("level",e),C.typeOf.bigint("index",t),e<1)throw new L("Hilbert level cannot be less than 1.");if(t<BigInt(0)||t>=BigInt(Math.pow(4,e)))throw new L("Hilbert index exceeds valid maximum for given level.");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)),Aoe(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function Aoe(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 ZC=XH;var Vdn=_(T(),1);var cy=30,yAe=1<<cy,gAe=1<<cy+1>>>0,IH=2*cy+1,ry=4,koe=[],Uoe=[],xAe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],sy=1,RC=2,I5=[sy,0,0,sy|RC];function dr(e){if(!Ot.supportsBigInt())throw new le("S2 required BigInt support");if(!c(e))throw new L("cell ID is required.");if(!dr.isValidId(e))throw new L("cell ID is invalid.");this._cellId=e,this._level=dr.getLevel(e)}dr.fromToken=function(e){if(C.typeOf.string("token",e),!dr.isValidToken(e))throw new L("token is invalid.");return new dr(dr.getIdFromToken(e))};dr.isValidId=function(e){return C.typeOf.bigint("cellId",e),!(e<=0||e>>BigInt(IH)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};dr.isValidToken=function(e){return C.typeOf.string("token",e),/^[0-9a-fA-F]{1,16}$/.test(e)?dr.isValidId(dr.getIdFromToken(e)):!1};dr.getIdFromToken=function(e){return C.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))};dr.getTokenFromId=function(e){C.typeOf.bigint("cellId",e);let t=Math.floor(EAe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};dr.getLevel=function(e){if(C.typeOf.bigint("cellId",e),!dr.isValidId(e))throw new L;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return cy-(t>>1)};dr.prototype.getChild=function(e){if(C.typeOf.number("index",e),e<0||e>3)throw new L("child index must be in the range [0-3].");if(this._level===30)throw new L("cannot get child of leaf cell.");let t=Boe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new dr(n)};dr.prototype.getParent=function(){if(this._level===0)throw new L("cannot get parent of root cell.");let e=Boe(this._cellId)<<BigInt(2);return new dr(this._cellId&~e+BigInt(1)|e)};dr.prototype.getParentAtLevel=function(e){if(this._level===0||e<0||this._level<e)throw new L("cannot get parent at invalid level.");let t=RAe(e);return new dr(this._cellId&-t|t)};dr.prototype.getCenter=function(e){e=e??re.WGS84;let t=_Ae(this._cellId,this._level);t=m.normalize(t,t);let n=new pe.fromCartesian(t,re.UNIT_SPHERE);return pe.toCartesian(n,e,new m)};dr.prototype.getVertex=function(e,t){if(C.typeOf.number("index",e),e<0||e>3)throw new L("vertex index must be in the range [0-3].");t=t??re.WGS84;let n=TAe(this._cellId,this._level,e);n=m.normalize(n,n);let i=new pe.fromCartesian(n,re.UNIT_SPHERE);return pe.toCartesian(i,t,new m)};dr.fromFacePositionLevel=function(e,t,n){if(C.typeOf.bigint("position",t),e<0||e>5)throw new L("Invalid S2 Face (must be within 0-5)");if(n<0||n>cy)throw new L("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,n))throw new L("Invalid Hilbert position for level");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(IH-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new dr(a)};function _Ae(e,t){let n=SAe(e,t);return CAe(n[0],n[1],n[2])}function TAe(e,t,n){let i=Ooe(e,t),o=VAe([i[1],i[2]],t),r=n>>1&1;return Doe(i[0],o[0][r^n&1],o[1][r])}function SAe(e,t){let n=Ooe(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),l=s?1:a?2:0,d=(o<<1)+l,u=(r<<1)+l;return[i,d,u]}function Ooe(e){koe.length===0&&ZAe();let t=Number(e>>BigInt(IH)),n=t&sy,i=(1<<ry)-1,o=0,r=0;for(let s=7;s>=0;s--){let l=(1<<2*(s===7?cy-7*ry:ry))-1;n+=Number(e>>BigInt(s*2*ry+1)&BigInt(l))<<2,n=Uoe[n];let d=s*ry;o+=n>>ry+2<<d,r+=(n>>2&i)<<d,n&=sy|RC}return[t,o,r]}function CAe(e,t,n){let i=Moe(t),o=Moe(n),r=W5(i),s=W5(o);return Doe(e,r,s)}function Doe(e,t,n){switch(e){case 0:return new m(1,t,n);case 1:return new m(-t,1,n);case 2:return new m(-t,-n,1);case 3:return new m(-1,-n,-t);case 4:return new m(n,-1,-t);default:return new m(n,t,-1)}}function W5(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Moe(e){return 1/gAe*e}function VAe(e,t){let n=[[],[]],i=LAe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=W5(Noe(r)),n[o][1]=W5(Noe(s))}return n}function LAe(e){return 1<<cy-e>>>0}function Noe(e){return 1/yAe*e}function ay(e,t,n,i,o,r){if(e===ry){let s=(t<<ry)+n;koe[(s<<2)+i]=(o<<2)+r,Uoe[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=xAe[r];ay(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^I5[0]),ay(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^I5[1]),ay(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^I5[2]),ay(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^I5[3])}}function ZAe(){ay(0,0,0,0,0,0),ay(0,0,0,sy,0,sy),ay(0,0,0,RC,0,RC),ay(0,0,0,sy|RC,0,sy|RC)}function Boe(e){return e&~e+BigInt(1)}function RAe(e){return BigInt(1)<<BigInt(2*(cy-e))}var GAe=[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 EAe(e){return GAe[(-e&e)%BigInt(67)]}var Qp=dr;var fgn=_(T(),1);var Rdn=_(T(),1);function XAe(e,t){return c(e)&&c(e.extensions)&&c(e.extensions[t])}var ri=XAe;var wdn=_(T(),1);function WH(e){let t=e.lengthBits,n=e.availableCount;C.typeOf.number("options.lengthBits",t);let i=e.constant,o=e.bitstream;if(c(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new le(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!c(n)&&s&&(n=IAe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function IAe(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(WH.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});WH.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new L("Bit index out of bounds.");if(c(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var GC=WH;var Adn=_(T(),1);function jp(e){e=e??z.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;C.typeOf.object("options.metadataTable",t),C.typeOf.object("options.class",n),C.typeOf.number("options.entityId",i),C.typeOf.object("options.propertyTableJson",o),this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(jp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});jp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};jp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};jp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};jp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};jp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};jp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};jp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var EC=jp;var kdn=_(T(),1);var w5={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};w5.getBranchingFactor=function(e){switch(e){case w5.OCTREE:return 8;case w5.QUADTREE:return 4;default:throw new L("subdivisionScheme is not a valid value.")}};var tr=Object.freeze(w5);var qdn=_(T(),1);var Hdn=_(T(),1);function ma(){}Object.defineProperties(ma.prototype,{class:{get:function(){L.throwInstantiationError()}}});ma.prototype.hasProperty=function(e){L.throwInstantiationError()};ma.prototype.hasPropertyBySemantic=function(e){L.throwInstantiationError()};ma.prototype.getPropertyIds=function(e){L.throwInstantiationError()};ma.prototype.getProperty=function(e){L.throwInstantiationError()};ma.prototype.setProperty=function(e,t){L.throwInstantiationError()};ma.prototype.getPropertyBySemantic=function(e){L.throwInstantiationError()};ma.prototype.setPropertyBySemantic=function(e,t){L.throwInstantiationError()};ma.hasProperty=function(e,t,n){if(C.typeOf.string("propertyId",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n),c(t[e]))return!0;let i=n.properties;if(!c(i))return!1;let o=i[e];return!!(c(o)&&c(o.default))};ma.hasPropertyBySemantic=function(e,t,n){C.typeOf.string("semantic",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return!1;let o=i[e];return c(o)};ma.getPropertyIds=function(e,t,n){C.typeOf.object("properties",e),C.typeOf.object("classDefinition",t),n=c(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&c(e[o])&&n.push(o);let i=t.properties;if(c(i))for(let o in i)i.hasOwnProperty(o)&&!c(e[o])&&c(i[o].default)&&n.push(o);return n};ma.getProperty=function(e,t,n){if(C.typeOf.string("propertyId",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n),!c(n.properties[e]))throw new L(`Class definition missing property ${e}`);let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!c(o)&&c(i.default))return o=He(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(c(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};ma.setProperty=function(e,t,n,i){if(C.typeOf.string("propertyId",e),C.defined("value",t),C.typeOf.object("properties",n),C.typeOf.object("classDefinition",i),!c(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return c(r)&&(o=r[e]),c(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};ma.getPropertyBySemantic=function(e,t,n){C.typeOf.string("semantic",e),C.typeOf.object("properties",t),C.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return;let o=i[e];if(c(o))return ma.getProperty(o.id,t,n)};ma.setPropertyBySemantic=function(e,t,n,i){C.typeOf.string("semantic",e),C.defined("value",t),C.typeOf.object("properties",n),C.typeOf.object("classDefinition",i);let o=i.propertiesBySemantic;if(!c(o))return!1;let r=i.propertiesBySemantic[e];return c(r)?ma.setProperty(r.id,t,n,i):!1};var Nn=ma;function qp(e){e=e??z.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class;C.typeOf.object("options.subtreeMetadata",t),C.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});qp.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};qp.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};qp.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};qp.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};qp.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};qp.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};qp.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var BX=qp;var qun=_(T(),1);var Bun=_(T(),1);var run=_(T(),1);var Ft={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Ft.getMinimum=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:return-128;case Ft.UINT8:return 0;case Ft.INT16:return-32768;case Ft.UINT16:return 0;case Ft.INT32:return-2147483648;case Ft.UINT32:return 0;case Ft.INT64:return Ot.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Ft.UINT64:return Ot.supportsBigInt()?BigInt(0):0;case Ft.FLOAT32:return-34028234663852886e22;case Ft.FLOAT64:return-Number.MAX_VALUE}};Ft.getMaximum=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:return 127;case Ft.UINT8:return 255;case Ft.INT16:return 32767;case Ft.UINT16:return 65535;case Ft.INT32:return 2147483647;case Ft.UINT32:return 4294967295;case Ft.INT64:return Ot.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Ft.UINT64:return Ot.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Ft.FLOAT32:return 34028234663852886e22;case Ft.FLOAT64:return Number.MAX_VALUE}};Ft.isIntegerType=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.INT64:case Ft.UINT64:return!0;default:return!1}};Ft.isUnsignedIntegerType=function(e){switch(C.typeOf.string("type",e),e){case Ft.UINT8:case Ft.UINT16:case Ft.UINT32:case Ft.UINT64:return!0;default:return!1}};Ft.isVectorCompatible=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.FLOAT32:case Ft.FLOAT64:return!0;default:return!1}};Ft.normalize=function(e,t){if(typeof e!="number"&&typeof e!="bigint")throw new L("value must be a number or a BigInt");if(!Ft.isIntegerType(t))throw new L("type must be an integer type");return Math.max(Number(e)/Number(Ft.getMaximum(t)),-1)};Ft.unnormalize=function(e,t){if(C.typeOf.number("value",e),!Ft.isIntegerType(t))throw new L("type must be an integer type");let n=Ft.getMaximum(t),i=Ft.isUnsignedIntegerType(t)?0:-n;return e=w.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Ft.INT64||t===Ft.UINT64)&&Ot.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Ft.applyValueTransform=function(e,t,n){return n*e+t};Ft.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Ft.getSizeInBytes=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:case Ft.UINT8:return 1;case Ft.INT16:case Ft.UINT16:return 2;case Ft.INT32:case Ft.UINT32:return 4;case Ft.INT64:case Ft.UINT64:return 8;case Ft.FLOAT32:return 4;case Ft.FLOAT64:return 8}};Ft.fromComponentDatatype=function(e){switch(C.typeOf.number("componentDatatype",e),e){case q.BYTE:return Ft.INT8;case q.UNSIGNED_BYTE:return Ft.UINT8;case q.SHORT:return Ft.INT16;case q.UNSIGNED_SHORT:return Ft.UINT16;case q.INT:return Ft.INT32;case q.UNSIGNED_INT:return Ft.UINT32;case q.FLOAT:return Ft.FLOAT32;case q.DOUBLE:return Ft.FLOAT64}};Ft.toComponentDatatype=function(e){switch(C.typeOf.string("type",e),e){case Ft.INT8:return q.BYTE;case Ft.UINT8:return q.UNSIGNED_BYTE;case Ft.INT16:return q.SHORT;case Ft.UINT16:return q.UNSIGNED_SHORT;case Ft.INT32:return q.INT;case Ft.UINT32:return q.UNSIGNED_INT;case Ft.FLOAT32:return q.FLOAT;case Ft.FLOAT64:return q.DOUBLE}};var At=Object.freeze(Ft);var Xun=_(T(),1);var pun=_(T(),1);var Do={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Do.isVectorType=function(e){switch(C.typeOf.string("type",e),e){case Do.VEC2:case Do.VEC3:case Do.VEC4:return!0;default:return!1}};Do.isMatrixType=function(e){switch(C.typeOf.string("type",e),e){case Do.MAT2:case Do.MAT3:case Do.MAT4:return!0;default:return!1}};Do.getComponentCount=function(e){switch(C.typeOf.string("type",e),e){case Do.SCALAR:case Do.STRING:case Do.ENUM:case Do.BOOLEAN:return 1;case Do.VEC2:return 2;case Do.VEC3:return 3;case Do.VEC4:return 4;case Do.MAT2:return 4;case Do.MAT3:return 9;case Do.MAT4:return 16;default:throw new L(`Invalid metadata type ${e}`)}};Do.getMathType=function(e){switch(e){case Do.VEC2:return D;case Do.VEC3:return m;case Do.VEC4:return ce;case Do.MAT2:return Ii;case Do.MAT3:return te;case Do.MAT4:return M;default:return}};var lt=Object.freeze(Do);function Aa(e){e=e??z.EMPTY_OBJECT;let t=e.id,n=e.type;C.typeOf.string("options.id",t),C.typeOf.string("options.type",n);let i=e.componentType,o=e.enumType,r=c(i)&&At.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=c(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=He(e.min,!0),this._max=He(e.max,!0),this._normalized=r;let s=He(e.offset,!0),a=He(e.scale,!0),l=c(s)||c(a),d=!0;c(s)||(s=this.expandConstant(0,d)),c(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=l,this._noData=He(e.noData,!0),this._default=He(e.default,!0),this._required=e.required??!0,this._extras=He(e.extras,!0),this._extensions=He(e.extensions,!0)}Aa.fromJson=function(e){e=e??z.EMPTY_OBJECT;let t=e.id,n=e.property;C.typeOf.string("options.id",t),C.typeOf.object("options.property",n),C.typeOf.string("options.property.type",n.type);let i=WAe(n),o=wAe(n,e.enums),r;return c(i)?i?r=c(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new Aa({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(Aa.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 WAe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===lt.SCALAR||lt.isMatrixType(t)||lt.isVectorType(t))return!1;if(c(At[t]))return!0;if(c(e.noData)||c(e.scale)||c(e.offset)||c(e.required)||c(e.count)||c(e.array)||c(e.optional))return!1}function wAe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!c(s)):e.array?(r=!0,s=e.count,a=!c(e.count)):(r=!1,s=void 0,a=!1);let l;if(c(e.enumType)&&(l=t[e.enumType]),n===lt.ENUM)return{type:n,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===lt.ENUM)return{type:i,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===lt.SCALAR||lt.isMatrixType(n)||lt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===lt.BOOLEAN||n===lt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===lt.BOOLEAN||i===lt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(i)&&c(At[i]))return{type:lt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(At[n]))return{type:lt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s};throw new L(`unknown metadata type {type: ${n}, componentType: ${i})`)}Aa.prototype.normalize=function(e){return this._normalized?wH(e,this._valueType,At.normalize):e};Aa.prototype.unnormalize=function(e){return this._normalized?wH(e,this._valueType,At.unnormalize):e};Aa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Aa.valueTransformInPlace(e,this._offset,this._scale,At.applyValueTransform)};Aa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Aa.valueTransformInPlace(e,this._offset,this._scale,At.unapplyValueTransform)};Aa.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=lt.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)};Aa.prototype.handleNoData=function(e){let t=this._noData;if(!c(t))return e;if(!Koe(e,t))return e};function Koe(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(!Koe(e[n],t[n]))return!1;return!0}Aa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=lt.getMathType(this._type),i=this._isArray,o=lt.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Aa.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=lt.getMathType(this._type),i=this._isArray,o=lt.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Aa.prototype.validate=function(e){if(!(!c(e)&&c(this._default)))return this._required&&!c(e)?"required property must have a value":this._isArray?PAe(this,e):Joe(this,e)};function PAe(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=Joe(e,t[i]);if(c(o))return o}}function Joe(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return lt.isVectorType(n)?vAe(t,n,i):lt.isMatrixType(n)?FAe(t,n,i):n===lt.STRING?AAe(t):n===lt.BOOLEAN?MAe(t):n===lt.ENUM?NAe(t,o):kAe(t,i,r)}function vAe(e,t,n){if(!At.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===lt.VEC2&&!(e instanceof D))return`vector value ${e} must be a Cartesian2`;if(t===lt.VEC3&&!(e instanceof m))return`vector value ${e} must be a Cartesian3`;if(t===lt.VEC4&&!(e instanceof ce))return`vector value ${e} must be a Cartesian4`}function FAe(e,t,n){if(!At.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===lt.MAT2&&!(e instanceof Ii))return`matrix value ${e} must be a Matrix2`;if(t===lt.MAT3&&!(e instanceof te))return`matrix value ${e} must be a Matrix3`;if(t===lt.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function AAe(e){if(typeof e!="string")return P5(e,lt.STRING)}function MAe(e){if(typeof e!="boolean")return P5(e,lt.BOOLEAN)}function NAe(e,t){let n=typeof e;if(c(t))return n!=="string"||!c(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function kAe(e,t,n){let i=typeof e;switch(t){case At.INT8:case At.UINT8:case At.INT16:case At.UINT16:case At.INT32:case At.UINT32:case At.FLOAT32:case At.FLOAT64:return i!=="number"?P5(e,t):isFinite(e)?Hoe(e,t,n):zoe(e,t);case At.INT64:case At.UINT64:return i!=="number"&&i!=="bigint"?P5(e,t):i==="number"&&!isFinite(e)?zoe(e,t):Hoe(e,t,n)}}function P5(e,t){return`value ${e} does not match type ${t}`}function Yoe(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Hoe(e,t,n){if(n){let i=At.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Yoe(e,t,n):void 0}if(e<At.getMinimum(t)||e>At.getMaximum(t))return Yoe(e,t,n)}function zoe(e,t){return`value ${e} of type ${t} must be finite`}function wH(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=wH(e[i],t,n);return e}Aa.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]=Aa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var gh=Aa;function YX(e){e=e??z.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews;C.typeOf.number.greaterThan("options.count",t,0),C.typeOf.object("options.property",n),C.typeOf.object("options.classProperty",i),C.typeOf.object("options.bufferViews",o);let r=i.type,s=i.isArray,a=i.isVariableLengthArray,l=i.valueType,d=i.enumType,u=r===lt.STRING,f=r===lt.BOOLEAN,p=0,y;if(a){let b=n.arrayOffsetType??n.offsetType;b=At[b]??At.UINT32;let G=n.arrayOffsets??n.arrayOffsetBufferView;y=new PH(o[G],b,t+1),p+=y.typedArray.byteLength}let h=lt.getComponentCount(r),g;a?g=y.get(t)-y.get(0):s?g=t*i.arrayLength:g=t;let x=h*g,S;if(u){let b=n.stringOffsetType??n.offsetType;b=At[b]??At.UINT32;let G=n.stringOffsets??n.stringOffsetBufferView;S=new PH(o[G],b,x+1),p+=S.typedArray.byteLength}(u||f)&&(l=At.UINT8);let V;u?V=S.get(x)-S.get(0):f?V=Math.ceil(x/8):V=x;let Z=n.values??n.bufferView,R=new PH(o[Z],l,V);p+=R.typedArray.byteLength;let E=n.offset,I=n.scale,v=i.hasValueTransform||c(E)||c(I);E=E??i.offset,I=I??i.scale,E=Qoe(E),I=Qoe(I);let P,F,N=this;u?P=function(b){return DAe(b,N._values,N._stringOffsets)}:f?(P=function(b){return BAe(b,N._values)},F=function(b,G){YAe(b,N._values,G)}):c(d)?(P=function(b){let G=N._values.get(b);return d.namesByValue[G]},F=function(b,G){let X=d.valuesByName[G];N._values.set(b,X)}):(P=function(b){return N._values.get(b)},F=function(b,G){N._values.set(b,G)}),this._arrayOffsets=y,this._stringOffsets=S,this._values=R,this._classProperty=i,this._count=t,this._vectorComponentCount=h,this._min=n.min,this._max=n.max,this._offset=E,this._scale=I,this._hasValueTransform=v,this._getValue=P,this._setValue=F,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(YX.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}}});YX.prototype.get=function(e){joe(this,e);let t=UAe(this,e);return t=this._classProperty.handleNoData(t),c(t)?(t=this._classProperty.normalize(t),t=$Ae(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};YX.prototype.set=function(e,t){let n=this._classProperty;C.defined("value",t),joe(this,e);let i=n.validate(t);if(c(i))throw new L(i);t=n.packVectorAndMatrixTypes(t),t=e9e(this,t),t=n.unnormalize(t),OAe(this,e,t)};YX.prototype.getTypedArray=function(){if(c(this._values))return this._values.typedArray};function Qoe(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function joe(e,t){let n=e._count;if(!c(t)||t<0||t>=n){let i=n-1;throw new L(`index is required and between zero and count - 1. Actual value: ${i}`)}}function UAe(e,t){$oe(e)&&ere(e);let n=e._classProperty,i=n.isArray,o=n.type,r=lt.getComponentCount(o);if(c(e._unpackedValues)){let s=e._unpackedValues[t];return i?He(s,!0):s}return!i&&r===1?e._getValue(t):qoe(e,n,t)}function qoe(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=lt.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 OAe(e,t,n){jAe(e,t,n)&&ere(e);let i=e._classProperty,o=i.isArray,r=i.type,s=lt.getComponentCount(r);if(c(e._unpackedValues)){i.isArray&&(n=He(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,l;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),l=e._arrayOffsets.get(t+1)-a;else{let u=(i.arrayLength??1)*e._vectorComponentCount;a=t*u,l=u}for(let d=0;d<l;++d)e._setValue(a+d,n[d])}function DAe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Il(t.typedArray,i,o)}function BAe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function YAe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function HAe(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 l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=l*Math.pow(256,a)}return r&&(o=-o),o}function zAe(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 l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=BigInt(l)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function KAe(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 JAe(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 QAe(e){switch(e){case At.INT8:return q.BYTE;case At.UINT8:return q.UNSIGNED_BYTE;case At.INT16:return q.SHORT;case At.UINT16:return q.UNSIGNED_SHORT;case At.INT32:return q.INT;case At.UINT32:return q.UNSIGNED_INT;case At.FLOAT32:return q.FLOAT;case At.FLOAT64:return q.DOUBLE}}function $oe(e){if(c(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===lt.STRING||i===At.INT64&&!Ot.supportsBigInt64Array()||i===At.UINT64&&!Ot.supportsBigUint64Array()}function jAe(e,t,n){if($oe(e))return!0;let i=e._arrayOffsets;if(c(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function ere(e){e._unpackedValues=qAe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function qAe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=lt.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]=qoe(e,i,a);return n}function $Ae(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:gh.valueTransformInPlace(t,e._offset,e._scale,At.applyValueTransform)}function e9e(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:gh.valueTransformInPlace(t,e._offset,e._scale,At.unapplyValueTransform)}function PH(e,t,n){let i=this,o,r,s;if(t===At.INT64)Ot.supportsBigInt()?Ot.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return zAe(a,i)}):(ht("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 HAe(a,i)});else if(t===At.UINT64)Ot.supportsBigInt()?Ot.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return JAe(a,i)}):(ht("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 KAe(a,i)});else{let a=QAe(t);o=q.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(l,d){i.typedArray[l]=d}}c(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 HX=YX;function Km(e){e=e??z.EMPTY_OBJECT;let t=e.count,n=e.class;C.typeOf.number.greaterThan("options.count",t,0),C.typeOf.object("options.class",n);let i=0,o={};if(c(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new HX({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(Km.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Km.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Km.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Km.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Km.prototype.getProperty=function(e,t){C.typeOf.string("propertyId",t);let n=this._properties[t],i;return c(n)?i=n.get(e):i=t9e(this._class,t),i};Km.prototype.setProperty=function(e,t,n){C.typeOf.string("propertyId",t);let i=this._properties[t];return c(i)?(i.set(e,n),!0):!1};Km.prototype.getPropertyBySemantic=function(e,t){C.typeOf.string("semantic",t);let n,i=this._class.propertiesBySemantic;if(c(i)&&(n=i[t]),c(n))return this.getProperty(e,n.id)};Km.prototype.setPropertyBySemantic=function(e,t,n){C.typeOf.string("semantic",t);let i,o=this._class.propertiesBySemantic;return c(o)&&(i=o[t]),c(i)?this.setProperty(e,i.id,n):!1};Km.prototype.getPropertyTypedArray=function(e){C.typeOf.string("propertyId",e);let t=this._properties[e];if(c(t))return t.getTypedArray()};Km.prototype.getPropertyTypedArrayBySemantic=function(e){C.typeOf.string("semantic",e);let t,n=this._class.propertiesBySemantic;if(c(n)&&(t=n[e]),c(t))return this.getPropertyTypedArray(t.id)};function t9e(e,t){let n=e.properties;if(!c(n))return;let i=n[t];if(c(i)&&c(i.default)){let o=i.default;return i.isArray&&(o=He(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Wu=Km;var qyn=_(T(),1);var hmn=_(T(),1);var rmn=_(T(),1);function ly(){}Object.defineProperties(ly.prototype,{cacheKey:{get:function(){L.throwInstantiationError()}}});ly.prototype.load=function(){L.throwInstantiationError()};ly.prototype.unload=function(){};ly.prototype.process=function(e){return!1};ly.prototype.getError=function(e,t){C.typeOf.string("errorMessage",e),c(t)&&c(t.message)&&(e+=`
${t.message}`);let n=new le(e);return c(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};ly.prototype.isDestroyed=function(){return!1};ly.prototype.destroy=function(){return this.unload(),he(this)};var Ji=ly;var amn=_(T(),1),n9e={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},xt=Object.freeze(n9e);function $p(e){e=e??z.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new L("One of options.typedArray and options.resource must be defined.");this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&($p.prototype=Object.create(Ji.prototype),$p.prototype.constructor=$p);Object.defineProperties($p.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});$p.prototype.load=async function(){return c(this._promise)?this._promise:c(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=i9e(this),this._promise)};async function i9e(e){let t=e._resource;e._state=xt.LOADING;try{let n=await $p._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=xt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=xt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}$p._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};$p.prototype.unload=function(){this._typedArray=void 0};var s_=$p;var kmn=_(T(),1);var Rmn=_(T());var ymn=_(T()),pmn=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr: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:YgvJbbbZMgo: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;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4: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:bc:eqkzebbbebbbdbbba: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(y){n=y.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(y){for(var h=new Uint8Array(y.length),g=0;g<y.length;++g){var x=y.charCodeAt(g);h[g]=x>96?x-97:x>64?x-39:x+4}for(var S=0,g=0;g<y.length;++g)h[S++]=h[g]<60?t[h[g]]:(h[g]-60)*64+h[++g];return h.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,h,g,x){var S=n.exports.sbrk,V=S(h.length*4),Z=S(g*4),R=new Uint8Array(n.exports.memory.buffer),E=s(h);R.set(E,V),x&&x(V,V,h.length,g);var I=y(Z,V,h.length,g);R=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(g);new Uint8Array(v.buffer).set(R.subarray(Z,Z+g*4)),E.set(R.subarray(V,V+h.length*4)),S(V-S(0));for(var P=0;P<h.length;++P)h[P]=v[h[P]];return[v,I]}function l(y,h,g,x){var S=n.exports.sbrk,V=S(g*4),Z=S(g*x),R=new Uint8Array(n.exports.memory.buffer);R.set(s(h),Z),y(V,Z,g,x),R=new Uint8Array(n.exports.memory.buffer);var E=new Uint32Array(g);return new Uint8Array(E.buffer).set(R.subarray(V,V+g*4)),S(V-S(0)),E}function d(y,h,g,x,S){var V=n.exports.sbrk,Z=V(h),R=V(x*S),E=new Uint8Array(n.exports.memory.buffer);E.set(s(g),R);var I=y(Z,h,R,x,S),v=new Uint8Array(I);return v.set(E.subarray(Z,Z+I)),V(Z-V(0)),v}function u(y){for(var h=0,g=0;g<y.length;++g){var x=y[g];h=h<x?x:h}return h}function f(y,h){if(r(h==2||h==4),h==4)return new Uint32Array(y.buffer,y.byteOffset,y.byteLength/4);var g=new Uint16Array(y.buffer,y.byteOffset,y.byteLength/2);return new Uint32Array(g)}function p(y,h,g,x,S,V,Z){var R=n.exports.sbrk,E=R(g*x),I=R(g*V),v=new Uint8Array(n.exports.memory.buffer);v.set(s(h),I),y(E,g,x,S,I,Z);var P=new Uint8Array(g*x);return P.set(v.subarray(E,E+g*x)),R(E-R(0)),P}return{ready:i,supported:!0,reorderMesh:function(y,h,g){var x=h?g?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,y,u(y)+1,x)},reorderPoints:function(y,h){return r(y instanceof Float32Array),r(y.length%h==0),r(h>=3),l(n.exports.meshopt_spatialSortRemap,y,y.length/h,h*4)},encodeVertexBuffer:function(y,h,g){r(g>0&&g<=256),r(g%4==0);var x=n.exports.meshopt_encodeVertexBufferBound(h,g);return d(n.exports.meshopt_encodeVertexBuffer,x,y,h,g)},encodeIndexBuffer:function(y,h,g){r(g==2||g==4),r(h%3==0);var x=f(y,g),S=n.exports.meshopt_encodeIndexBufferBound(h,u(x)+1);return d(n.exports.meshopt_encodeIndexBuffer,S,x,h,4)},encodeIndexSequence:function(y,h,g){r(g==2||g==4);var x=f(y,g),S=n.exports.meshopt_encodeIndexSequenceBound(h,u(x)+1);return d(n.exports.meshopt_encodeIndexSequence,S,x,h,4)},encodeGltfBuffer:function(y,h,g,x){var S={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(S[x]),S[x](y,h,g)},encodeFilterOct:function(y,h,g,x){return r(g==4||g==8),r(x>=1&&x<=16),p(n.exports.meshopt_encodeFilterOct,y,h,g,x,16)},encodeFilterQuat:function(y,h,g,x){return r(g==8),r(x>=4&&x<=16),p(n.exports.meshopt_encodeFilterQuat,y,h,g,x,16)},encodeFilterExp:function(y,h,g,x,S){r(g>0&&g%4==0),r(x>=1&&x<=24);var V={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,y,h,g,x,g,S?V[S]:1)}}}();var xmn=_(T()),tre=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok: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::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp: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;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;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(S){r=S.instance,r.exports.__wasm_call_ctors()});function a(S){for(var V=new Uint8Array(S.length),Z=0;Z<S.length;++Z){var R=S.charCodeAt(Z);V[Z]=R>96?R-97:R>64?R-39:R+4}for(var E=0,Z=0;Z<S.length;++Z)V[E++]=V[Z]<60?i[V[Z]]:(V[Z]-60)*64+V[++Z];return V.buffer.slice(0,E)}function l(S,V,Z,R,E,I,v){var P=S.exports.sbrk,F=R+3&-4,N=P(F*E),b=P(I.length),G=new Uint8Array(S.exports.memory.buffer);G.set(I,b);var X=V(N,R,E,b,I.length);if(X==0&&v&&v(N,F,E),Z.set(G.subarray(N,N+R*E)),P(N-P(0)),X!=0)throw new Error("Malformed buffer data: "+X)}var d={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],p=0;function y(S){var V={object:new Worker(S),pending:0,requests:{}};return V.object.onmessage=function(Z){var R=Z.data;V.pending-=R.count,V.requests[R.id][R.action](R.value),delete V.requests[R.id]},V}function h(S){for(var V="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+x.name+";"+l.toString()+x.toString(),Z=new Blob([V],{type:"text/javascript"}),R=URL.createObjectURL(Z),E=f.length;E<S;++E)f[E]=y(R);for(var E=S;E<f.length;++E)f[E].object.postMessage({});f.length=S,URL.revokeObjectURL(R)}function g(S,V,Z,R,E){for(var I=f[0],v=1;v<f.length;++v)f[v].pending<I.pending&&(I=f[v]);return new Promise(function(P,F){var N=new Uint8Array(Z),b=++p;I.pending+=S,I.requests[b]={resolve:P,reject:F},I.object.postMessage({id:b,count:S,size:V,source:N,mode:R,filter:E},[N.buffer])})}function x(S){var V=S.data;if(!V.id)return self.close();self.ready.then(function(Z){try{var R=new Uint8Array(V.count*V.size);l(Z,Z.exports[V.mode],R,V.count,V.size,V.source,Z.exports[V.filter]),self.postMessage({id:V.id,count:V.count,action:"resolve",value:R},[R.buffer])}catch(E){self.postMessage({id:V.id,count:V.count,action:"reject",value:E})}})}return{ready:s,supported:!0,useWorkers:function(S){h(S)},decodeVertexBuffer:function(S,V,Z,R,E){l(r,r.exports.meshopt_decodeVertexBuffer,S,V,Z,R,r.exports[d[E]])},decodeIndexBuffer:function(S,V,Z,R){l(r,r.exports.meshopt_decodeIndexBuffer,S,V,Z,R)},decodeIndexSequence:function(S,V,Z,R){l(r,r.exports.meshopt_decodeIndexSequence,S,V,Z,R)},decodeGltfBuffer:function(S,V,Z,R,E,I){l(r,r.exports[u[E]],S,V,Z,R,r.exports[d[I]])},decodeGltfBufferAsync:function(S,V,Z,R,E){return f.length>0?g(S,V,Z,u[R],d[E]):s.then(function(){var I=new Uint8Array(S*V);return l(r,r.exports[u[R]],I,S,V,Z,r.exports[d[E]]),I})}}}();var Smn=_(T()),_mn=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaKcdtfydbc8S2fgea8SaR:rgRa8SNNg8UaeIdbMUdbaeaIaRaINg8YNg8XaeIdlMUdlaea8VaRa8VNg8ZNg80aeIdwMUdwaea8Ya8SNg8YaeIdxMUdxaea8Za8SNg81aeIdzMUdzaea8ZaINg8ZaeIdCMUdCaea8SaRa8Va8WNa8Sa8PNa8RaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaYcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaLcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaHcxfhHaAcifgAad6mbkcbhiabhKinabaicdtfhYcbhHinaXaYaHc:G1jjbfydbcdtfydbgOfRbbhedndnaXaKaHfydbgCfRbbgAc99fcFeGcpe0mbaeceSmbaecd9hmekdnaAcufcFeGce0mbahaCcdtfydbaO9hmekdnaecufcFeGce0mbagaOcdtfydbaC9hmekdnaAcv2aefcj1jjbfRbbTmbaQaOcdtfydbaQaCcdtfydb0mekJbbacJbbacJbbjZaeceSEaAceSEh8ZdnaaaYaHc:K1jjbfydbcdtfydbcx2fgeIdwaaaCcx2fgAIdwg8R:tg8VaaaOcx2fgLIdwa8R:tg8Sa8SNaLIdbaAIdbg8W:tgIaINaLIdlaAIdlg8U:tgRaRNMMg8PNa8Va8SNaeIdba8W:tg80aINaRaeIdla8U:tg8YNMMg8Xa8SN:tg8Va8VNa80a8PNa8XaIN:tg8Sa8SNa8Ya8PNa8XaRN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaCcdtfydbc8S2fgea8Sa8Za8P:rNgRa8SNNg8XaeIdbMUdbaeaIaRaINg8ZNg80aeIdlMUdlaea8VaRa8VNg8PNg8YaeIdwMUdwaea8Za8SNg8ZaeIdxMUdxaea8Pa8SNg81aeIdzMUdzaea8PaINgBaeIdCMUdCaea8SaRa8Va8RNa8Sa8WNa8UaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaOcdtfydbc8S2fgea8XaeIdbMUdbaea80aeIdlMUdlaea8YaeIdwMUdwaea8ZaeIdxMUdxaea81aeIdzMUdzaeaBaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaicifgiad6mbkdna8JTmbcbhKinJbbbbh8WaaabaKcdtfgeclfydbgLcx2fgHIdwaaaeydbgicx2fgOIdwg8Y:tgIaINaHIdbaOIdbg81:tg8Va8VNaHIdlaOIdlgB:tgRaRNMMg8Zaaaecwfydbg8Fcx2fgeIdwa8Y:tg8PNaIaIa8PNa8VaeIdba81:tg8RNaRaeIdlaB:tg8UNMMg8SN:tJbbbbJbbjZa8Za8Pa8PNa8Ra8RNa8Ua8UNMMg80Na8Sa8SN:tg8X:va8XJbbbb9BEg8XNh83a80aINa8Pa8SN:ta8XNhUa8Za8UNaRa8SN:ta8XNh85a80aRNa8Ua8SN:ta8XNh86a8Za8RNa8Va8SN:ta8XNh87a80a8VNa8Ra8SN:ta8XNh88a8Va8UNa8RaRN:tg8Sa8SNaRa8PNa8UaIN:tg8Sa8SNaIa8RNa8Pa8VN:tg8Sa8SNMM:rJbbbZNh8Sayaia8J2g3cdtfhHaya8Fa8J2gwcdtfhOayaLa8J2g8LcdtfhCa8Y:mh89aB:mh8:a81:mhZcbhAa8JhYJbbbbh8UJbbbbh8XJbbbbh8ZJbbbbh80Jbbbbh8YJbbbbh81JbbbbhBJbbbbhnJbbbbhcinasc;WbfaAfgecwfa8SaUaCIdbaHIdbg8P:tgRNa83aOIdba8P:tg8RNMgINUdbaeclfa8Sa86aRNa85a8RNMg8VNUdbaea8Sa88aRNa87a8RNMgRNUdbaecxfa8Sa89aINa8:a8VNa8PaZaRNMMMg8PNUdba8SaIa8VNNa80Mh80a8SaIaRNNa8YMh8Ya8Sa8VaRNNa81Mh81a8Sa8Pa8PNNa8WMh8Wa8SaIa8PNNa8UMh8Ua8Sa8Va8PNNa8XMh8Xa8SaRa8PNNa8ZMh8Za8SaIaINNaBMhBa8Sa8Va8VNNanMhna8SaRaRNNacMhcaHclfhHaCclfhCaOclfhOaAczfhAaYcufgYmbkavaic8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyavaLc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyava8Fc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdzaHIdbg8PNaeIdaMg8Sa8SMMaRNaeIdlaHIdlg8RNaeIdCaRNaeId3Mg8Sa8SMMa8RNaeIdba8PNaeIdxa8RNaeIdKMg8Sa8SMMa8PNaeId8KMMM:lNh80JbbbbJbbjZaqaQaYcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaKcx2fgHIdwg8VNaeIdzaHIdbg8WNaeIdaMg8Sa8SMMa8VNaeIdlaHIdlg8UNaeIdCa8VNaeId3Mg8Sa8SMMa8UNaeIdba8WNaeIdxa8UNaeIdKMg8Sa8SMMa8WNaeId8KMMM:lNh8YaAcwfh3aAclfhwdna8JTmbavaYc8S2fgOIdwa8VNaOIdza8WNaOIdaMg8Sa8SMMa8VNaOIdla8UNaOIdCa8VNaOId3Mg8Sa8SMMa8UNaOIdba8WNaOIdxa8UNaOIdKMg8Sa8SMMa8WNaOId8KMMMh8SayaKa8J2cdtfhHaraYa8J2cltfheaOIdyh8Xa8JhOinaHIdbgIaIa8XNaecxfIdba8VaecwfIdbNa8WaeIdbNa8UaeclfIdbNMMMgIaIM:tNa8SMh8SaHclfhHaeczfheaOcufgOmbkavaLc8S2fgOIdwaRNaOIdza8PNaOIdaMgIaIMMaRNaOIdla8RNaOIdCaRNaOId3MgIaIMMa8RNaOIdba8PNaOIdxa8RNaOIdKMgIaIMMa8PNaOId8KMMMhIaya8Fa8J2cdtfhHaraLa8J2cltfheaOIdyh8Wa8JhOinaHIdbg8Va8Va8WNaecxfIdbaRaecwfIdbNa8PaeIdbNa8RaeclfIdbNMMMg8Va8VM:tNaIMhIaHclfhHaeczfheaOcufgOmbka80aI:lMh80a8Ya8S:lMh8YkawaKa8Fa8Ya809FgeEBdbaAaYaLaeEBdba3a8Ya80aeEUdbaicefgiaE9hmbkasc;Wbfcbcj;qbz:ljjjb8Aa6heaEhHinasc;WbfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinasc;WbfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea6hHinasc;WbfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdbaSaOcdtfaeBdbaHcxfhHaEaecefge9hmbkadak9RgOci9Uh9kdnalTmbcbhea8MhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh0a9hcbalz:ljjjbh9maOcO9Uh9na9kce4h9oasydwh9pcbh8KcbhwdninaDaSawcdtfydbcx2fg3Idwg8Sac9Emea8Ka9k9pmeJFFuuhIdna9oaE9pmbaDaSa9ocdtfydbcx2fIdwJbb;aZNhIkdna8SaI9ETmba8San9ETmba8Ka9n0mdkdna9maQa3ydlgicdtg9qfydbgAfg9rRbba9maQa3ydbgLcdtg9sfydbgHfg9tRbbVmbaXaLfRbbh9udna9eaHcdtfgeclfydbgOaeydbgeSmbaOae9RhKa9paecitfheaaaAcx2fg8Lcwfh5a8Lclfh9vaaaHcx2fg8Acwfh9wa8Aclfh9xcbhHceh8Fdnindna8MaeydbcdtfydbgOaASmba8MaeclfydbcdtfydbgYaASmbaOaYSmbaaaYcx2fgYIdbaaaOcx2fgOIdbg8V:tg8Sa9xIdbaOIdlgR:tg8WNa8AIdba8V:tg8UaYIdlaR:tgIN:tg8Pa8Sa9vIdbaR:tg8XNa8LIdba8V:tg80aIN:tgRNaIa9wIdbaOIdwg8R:tg8YNa8WaYIdwa8R:tg8VN:tg8WaIa5Idba8R:tg81Na8Xa8VN:tgINa8Va8UNa8Ya8SN:tg8Ra8Va80Na81a8SN:tg8SNMMa8Pa8PNa8Wa8WNa8Ra8RNMMaRaRNaIaINa8Sa8SNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaK6h8FaKaH9hmbkka8FceGTmba9ocefh9oxeka3cwfhHdndndndna9uc9:fPdebdkaLheina8MaecdtgefaiBdba8EaefydbgeaL9hmbxikkdnagahaha9sfydbaiSEa8Ea9sfydbgLcdtfydbgecu9hmba8Ea9qfydbheka8Ma9sfaiBdbaehika8MaLcdtfaiBdbka9tce86bba9rce86bbaHIdbg8Sanana8S9DEhna0cefh0cecda9uceSEa8Kfh8KkawcefgwaE9hmbkka0TmddnalTmbcbhKcbhiindna8MaicdtgefydbgOaiSmbaQaOcdtfydbh8FdnaiaQaefydb9hg3mbaqa8Fc8S2fgeaqaic8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyka8JTmbavaOc8S2fgeavaic8S2gwfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",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(h){n=h.instance,n.exports.__wasm_call_ctors()});function o(h){for(var g=new Uint8Array(h.length),x=0;x<h.length;++x){var S=h.charCodeAt(x);g[x]=S>96?S-97:S>64?S-39:S+4}for(var V=0,x=0;x<h.length;++x)g[V++]=g[x]<60?t[g[x]]:(g[x]-60)*64+g[++x];return g.buffer.slice(0,V)}function r(h){if(!h)throw new Error("Assertion failed")}function s(h){return new Uint8Array(h.buffer,h.byteOffset,h.byteLength)}function a(h,g,x){var S=n.exports.sbrk,V=S(g.length*4),Z=S(x*4),R=new Uint8Array(n.exports.memory.buffer),E=s(g);R.set(E,V);var I=h(Z,V,g.length,x);R=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);new Uint8Array(v.buffer).set(R.subarray(Z,Z+x*4)),E.set(R.subarray(V,V+g.length*4)),S(V-S(0));for(var P=0;P<g.length;++P)g[P]=v[g[P]];return[v,I]}function l(h){for(var g=0,x=0;x<h.length;++x){var S=h[x];g=g<S?S:g}return g}function d(h,g,x,S,V,Z,R,E,I){var v=n.exports.sbrk,P=v(4),F=v(x*4),N=v(V*Z),b=v(x*4),G=new Uint8Array(n.exports.memory.buffer);G.set(s(S),N),G.set(s(g),b);var X=h(F,b,x,N,V,Z,R,E,I,P);G=new Uint8Array(n.exports.memory.buffer);var W=new Uint32Array(X);s(W).set(G.subarray(F,F+X*4));var A=new Float32Array(1);return s(A).set(G.subarray(P,P+4)),v(P-v(0)),[W,A[0]]}function u(h,g,x,S,V,Z,R,E,I,v,P,F,N){var b=n.exports.sbrk,G=b(4),X=b(x*4),W=b(V*Z),A=b(V*E),k=b(I.length*4),B=b(x*4),O=v?b(V):0,H=new Uint8Array(n.exports.memory.buffer);H.set(s(S),W),H.set(s(R),A),H.set(s(I),k),H.set(s(g),B),v&&H.set(s(v),O);var U=h(X,B,x,W,V,Z,A,E,k,I.length,O,P,F,N,G);H=new Uint8Array(n.exports.memory.buffer);var K=new Uint32Array(U);s(K).set(H.subarray(X,X+U*4));var Q=new Float32Array(1);return s(Q).set(H.subarray(G,G+4)),b(G-b(0)),[K,Q[0]]}function f(h,g,x,S){var V=n.exports.sbrk,Z=V(x*S),R=new Uint8Array(n.exports.memory.buffer);R.set(s(g),Z);var E=h(Z,x,S);return V(Z-V(0)),E}function p(h,g,x,S,V,Z,R,E){var I=n.exports.sbrk,v=I(E*4),P=I(x*S),F=I(x*Z),N=new Uint8Array(n.exports.memory.buffer);N.set(s(g),P),V&&N.set(s(V),F);var b=h(v,P,x,S,F,Z,R,E);N=new Uint8Array(n.exports.memory.buffer);var G=new Uint32Array(b);return s(G).set(N.subarray(v,v+b*4)),I(v-I(0)),G}var y={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(h){r(h instanceof Uint32Array||h instanceof Int32Array||h instanceof Uint16Array||h instanceof Int16Array),r(h.length%3==0);var g=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return a(n.exports.meshopt_optimizeVertexFetchRemap,g,l(h)+1)},simplify:function(h,g,x,S,V,Z){r(h instanceof Uint32Array||h instanceof Int32Array||h instanceof Uint16Array||h instanceof Int16Array),r(h.length%3==0),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3),r(S>=0&&S<=h.length),r(S%3==0),r(V>=0);for(var R=0,E=0;E<(Z?Z.length:0);++E)r(Z[E]in y),r(this.useExperimentalFeatures||Z[E]!="Prune"),R|=y[Z[E]];var I=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h),v=d(n.exports.meshopt_simplify,I,h.length,g,g.length/x,x*4,S,V,R);return v[0]=h instanceof Uint32Array?v[0]:new h.constructor(v[0]),v},simplifyWithAttributes:function(h,g,x,S,V,Z,R,E,I,v){r(this.useExperimentalFeatures),r(h instanceof Uint32Array||h instanceof Int32Array||h instanceof Uint16Array||h instanceof Int16Array),r(h.length%3==0),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3),r(S instanceof Float32Array),r(S.length%V==0),r(V>=0),r(R==null||R instanceof Uint8Array),r(R==null||R.length==g.length/x),r(E>=0&&E<=h.length),r(E%3==0),r(I>=0),r(Array.isArray(Z)),r(V>=Z.length),r(Z.length<=32);for(var P=0;P<Z.length;++P)r(Z[P]>=0);for(var F=0,P=0;P<(v?v.length:0);++P)r(v[P]in y),F|=y[v[P]];var N=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h),b=u(n.exports.meshopt_simplifyWithAttributes,N,h.length,g,g.length/x,x*4,S,V*4,new Float32Array(Z),R?new Uint8Array(R):null,E,I,F);return b[0]=h instanceof Uint32Array?b[0]:new h.constructor(b[0]),b},getScale:function(h,g){return r(h instanceof Float32Array),r(h.length%g==0),r(g>=3),f(n.exports.meshopt_simplifyScale,h,h.length/g,g*4)},simplifyPoints:function(h,g,x,S,V,Z){return r(this.useExperimentalFeatures),r(h instanceof Float32Array),r(h.length%g==0),r(g>=3),r(x>=0&&x<=h.length/g),S?(r(S instanceof Float32Array),r(S.length%V==0),r(V>=3),r(h.length/g==S.length/V),p(n.exports.meshopt_simplifyPoints,h,h.length/g,g*4,S,V*4,Z,x)):p(n.exports.meshopt_simplifyPoints,h,h.length/g,g*4,void 0,0,0,x)}}}();var Lmn=_(T()),Cmn=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8KaCIdwh8LaXIdwh8MaPcxfa3aY:tg3aaa8F:tgaNa5aY:tg5a8Ea8F:tg8EN:tgYJbbbbJbbjZahag:tgha5Na8Jag:tgga3N:tg8Fa8FNaYaYNa8EagNaaahN:tgYaYNMM:rgg:vagJbbbb9BEg3NUdbaPczfaYa3NUdbaPcCfa8Fa3NUdbaPcwfa8Ka8Ma8LMMJbbnn:vUdbaEagMhEaAcxfhAaPcKfhParcufgrmbkaEaO:Z:vJbbbZNhYkakcuaOcdtalcFFFF970Ecbyd:e1jjbHjjjjbbgCBd9KakcrBd:SeaYaD:ZN:rhYdna8AmbcbhPaChAinaAaPBdbaAclfhAaOaPcefgP9hmbkkaYJbbbZNh8MakcuaOcltalcFFFFd0Ecbyd:e1jjbHjjjjbbg8ABd9OakcwBd:Secba8AaKaCaOz:djjjb8Aakaocbyd:e1jjbHjjjjbbgPBd2aPcFeaoz:njjjbhrakc8Wfcwf9cb83ibak9cb83i8WcbhPJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;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:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",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(h){n=h.instance,n.exports.__wasm_call_ctors()});function o(h){for(var g=new Uint8Array(h.length),x=0;x<h.length;++x){var S=h.charCodeAt(x);g[x]=S>96?S-97:S>64?S-39:S+4}for(var V=0,x=0;x<h.length;++x)g[V++]=g[x]<60?t[g[x]]:(g[x]-60)*64+g[++x];return g.buffer.slice(0,V)}function r(h){if(!h)throw new Error("Assertion failed")}function s(h){return new Uint8Array(h.buffer,h.byteOffset,h.byteLength)}var a=48,l=16;function d(h,g){var x=h.meshlets[g*4+0],S=h.meshlets[g*4+1],V=h.meshlets[g*4+2],Z=h.meshlets[g*4+3];return{vertices:h.vertices.subarray(x,x+V),triangles:h.triangles.subarray(S,S+Z*3)}}function u(h,g,x,S,V,Z,R){var E=n.exports.sbrk,I=n.exports.meshopt_buildMeshletsBound(h.length,V,Z),v=E(I*l),P=E(I*V*4),F=E(I*Z*3),N=E(h.byteLength),b=E(g.byteLength),G=new Uint8Array(n.exports.memory.buffer);G.set(s(h),N),G.set(s(g),b);var X=n.exports.meshopt_buildMeshlets(v,P,F,N,h.length,b,x,S,V,Z,R);G=new Uint8Array(n.exports.memory.buffer);for(var W=G.subarray(v,v+X*l),A=new Uint32Array(W.buffer,W.byteOffset,W.byteLength/4).slice(),k=0;k<X;++k){var B=A[k*4+0],O=A[k*4+1],x=A[k*4+2],H=A[k*4+3];n.exports.meshopt_optimizeMeshlet(P+B*4,F+O,H,x)}var U=A[(X-1)*4+0],K=A[(X-1)*4+1],Q=A[(X-1)*4+2],ie=A[(X-1)*4+3],j=U+Q,$=K+(ie*3+3&-4),ne={meshlets:A,vertices:new Uint32Array(G.buffer,P,j).slice(),triangles:new Uint8Array(G.buffer,F,$*3).slice(),meshletCount:X};return E(v-E(0)),ne}function f(h){var g=new Float32Array(n.exports.memory.buffer,h,a/4);return{centerX:g[0],centerY:g[1],centerZ:g[2],radius:g[3],coneApexX:g[4],coneApexY:g[5],coneApexZ:g[6],coneAxisX:g[7],coneAxisY:g[8],coneAxisZ:g[9],coneCutoff:g[10]}}function p(h,g,x,S){var V=n.exports.sbrk,Z=[],R=V(g.byteLength),E=V(h.vertices.byteLength),I=V(h.triangles.byteLength),v=V(a),P=new Uint8Array(n.exports.memory.buffer);P.set(s(g),R),P.set(s(h.vertices),E),P.set(s(h.triangles),I);for(var F=0;F<h.meshletCount;++F){var N=h.meshlets[F*4+0],b=h.meshlets[F*4+0+1],G=h.meshlets[F*4+0+3];n.exports.meshopt_computeMeshletBounds(v,E+N*4,I+b,G,R,x,S),Z.push(f(v))}return V(R-V(0)),Z}function y(h,g,x,S){var V=n.exports.sbrk,Z=V(a),R=V(h.byteLength),E=V(g.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(h),R),I.set(s(g),E),n.exports.meshopt_computeClusterBounds(Z,R,h.length,E,x,S);var v=f(Z);return V(Z-V(0)),v}return{ready:i,supported:!0,buildMeshlets:function(h,g,x,S,V,Z){r(h.length%3==0),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3),r(S<=255||S>0),r(V<=512),r(V%4==0),Z=Z||0;var R=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return u(R,g,g.length/x,x*4,S,V,Z)},computeClusterBounds:function(h,g,x){r(h.length%3==0),r(h.length/3<=512),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3);var S=h.BYTES_PER_ELEMENT==4?h:new Uint32Array(h);return y(S,g,g.length/x,x*4)},computeMeshletBounds:function(h,g,x){return r(h.meshletCount!=0),r(g instanceof Float32Array),r(g.length%x==0),r(x>=3),p(h,g,g.length/x,x*4)},extractMeshlet:function(h,g){return r(g>=0&&g<h.meshletCount),d(h,g)}}}();function a_(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.number("options.bufferViewId",i),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r);let a=n.bufferViews[i],l=a.buffer,d=a.byteOffset,u=a.byteLength,f=!1,p,y,h,g;if(ri(a,"EXT_meshopt_compression")){let S=a.extensions.EXT_meshopt_compression;l=S.buffer,d=S.byteOffset??0,u=S.byteLength,f=!0,p=S.byteStride,y=S.count,h=S.mode,g=S.filter??"NONE"}let x=n.buffers[l];this._hasMeshopt=f,this._meshoptByteStride=p,this._meshoptCount=y,this._meshoptMode=h,this._meshoptFilter=g,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=x,this._bufferId=l,this._byteOffset=d,this._byteLength=u,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(a_.prototype=Object.create(Ji.prototype),a_.prototype.constructor=a_);Object.defineProperties(a_.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function o9e(e){try{let t=r9e(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);tre.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=xt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load buffer view",t)}}a_.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=xt.LOADING,this._promise=o9e(this),this._promise)};function r9e(e){let t=e._resourceCache,n=e._buffer;if(c(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}a_.prototype.unload=function(){c(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var XC=a_;var afn=_(T(),1);var Hmn=_(T(),1);function Mr(){}Mr._maxDecodingConcurrency=Math.max(Ot.hardwareConcurrency-1,1);Mr._decoderTaskProcessor=void 0;Mr._taskProcessorReady=!1;Mr._error=void 0;Mr._getDecoderTaskProcessor=function(){if(!c(Mr._decoderTaskProcessor)){let e=new gi("decodeDraco",Mr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Mr._taskProcessorReady=!0:Mr._error=new le("Draco decoder could not be initialized.")}).catch(t=>{Mr._error=t}),Mr._decoderTaskProcessor=e}return Mr._decoderTaskProcessor};Mr.decodePointCloud=function(e){let t=Mr._getDecoderTaskProcessor();if(c(Mr._error))throw Mr._error;if(Mr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Mr.decodeBufferView=function(e){let t=Mr._getDecoderTaskProcessor();if(c(Mr._error))throw Mr._error;if(Mr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var eb=Mr;var jmn=_(T(),1);var si={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function s9e(e){switch(e){case si.POSITION:return"positionMC";case si.NORMAL:return"normalMC";case si.TANGENT:return"tangentMC";case si.TEXCOORD:return"texCoord";case si.COLOR:return"color";case si.JOINTS:return"joints";case si.WEIGHTS:return"weights";case si.FEATURE_ID:return"featureId";default:throw new L("semantic is not a valid value.")}}si.hasSetIndex=function(e){switch(C.typeOf.string("semantic",e),e){case si.POSITION:case si.NORMAL:case si.TANGENT:return!1;case si.TEXCOORD:case si.COLOR:case si.JOINTS:case si.WEIGHTS:case si.FEATURE_ID:return!0;default:throw new L("semantic is not a valid value.")}};si.fromGltfSemantic=function(e){C.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return si.POSITION;case"NORMAL":return si.NORMAL;case"TANGENT":return si.TANGENT;case"TEXCOORD":return si.TEXCOORD;case"COLOR":return si.COLOR;case"JOINTS":return si.JOINTS;case"WEIGHTS":return si.WEIGHTS;case"_FEATURE_ID":return si.FEATURE_ID}};si.fromPntsSemantic=function(e){switch(C.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return si.POSITION;case"RGBA":case"RGB":case"RGB565":return si.COLOR;case"NORMAL":case"NORMAL_OCT16P":return si.NORMAL;case"BATCH_ID":return si.FEATURE_ID;default:throw new L("pntsSemantic is not a valid value.")}};si.getGlslType=function(e){switch(C.typeOf.string("semantic",e),e){case si.POSITION:case si.NORMAL:case si.TANGENT:return"vec3";case si.TEXCOORD:return"vec2";case si.COLOR:return"vec4";case si.JOINTS:return"ivec4";case si.WEIGHTS:return"vec4";case si.FEATURE_ID:return"int";default:throw new L("semantic is not a valid value.")}};si.getVariableName=function(e,t){C.typeOf.string("semantic",e);let n=s9e(e);return c(t)&&(n+=`_${t}`),n};var pt=Object.freeze(si);function dy(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.object("options.primitive",i),C.typeOf.object("options.draco",o),C.typeOf.object("options.gltfResource",r),C.typeOf.object("options.baseResource",s),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=xt.UNLOADED,this._promise=void 0,this._dracoError=void 0}c(Object.create)&&(dy.prototype=Object.create(Ji.prototype),dy.prototype.constructor=dy);Object.defineProperties(dy.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function a9e(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=xt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;nre(e,n)}}dy.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=xt.LOADING,this._promise=a9e(this),this._promise)};function nre(e,t){throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load Draco",t)}async function c9e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=xt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var c_={};c_[pt.POSITION]="POSITION";c_[pt.NORMAL]="NORMAL";c_[pt.COLOR]="COLOR";c_[pt.TEXCOORD]="TEX_COORD";function l9e(e){for(let t in c_)if(c_.hasOwnProperty(t)&&e.startsWith(t))return c_[t]}dy.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.PROCESSING||(c(this._dracoError)&&nre(this,this._dracoError),!c(this._bufferViewTypedArray))||c(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,l=[];for(let f in n.attributes)if(n.attributes.hasOwnProperty(f)){let p=l9e(f);c(p)&&i.accessors[n.attributes[f]].componentType===q.FLOAT&&(l.includes(p)||l.push(p))}let d={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:l},u=eb.decodeBufferView(d);if(!c(u))return!1;this._decodePromise=c9e(this,u)};dy.prototype.unload=function(){c(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 IC=dy;var Sfn=_(T(),1);var mfn=_(T(),1);function d9e(e){let t=e.uint8Array,n=e.format,i=e.request,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1;C.typeOf.object("uint8Array",t),C.typeOf.string("format",n);let s=new Blob([t],{type:n}),a;return Ge.supportsImageBitmapOptions().then(function(l){return l?Promise.resolve(Ge.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ge({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(l){return c(a)&&window.URL.revokeObjectURL(a),l}).catch(function(l){return c(a)&&window.URL.revokeObjectURL(a),Promise.reject(l)})}var l_=d9e;function tb(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.number("options.imageId",i),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r);let a=n.images[i],l=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=l,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(tb.prototype=Object.create(Ji.prototype),tb.prototype.constructor=tb);Object.defineProperties(tb.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});tb.prototype.load=function(){return c(this._promise)?this._promise:c(this._bufferViewId)?(this._promise=u9e(this),this._promise):(this._promise=m9e(this),this._promise)};function ire(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 u9e(e){e._state=xt.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 h9e(i);if(e.isDestroyed())return;let r=ire(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=xt.READY,e}catch(n){return e.isDestroyed()?void 0:ore(e,n,"Failed to load embedded image")}}async function m9e(e){e._state=xt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await b9e(i);if(e.isDestroyed())return;let r=ire(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=xt.READY,e}catch(o){return e.isDestroyed()?void 0:ore(e,o,`Failed to load image: ${n}`)}}function ore(e,t,n){return e.unload(),e._state=xt.FAILED,Promise.reject(e.getError(n,t))}function f9e(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 le("Image format is not recognized")}async function h9e(e){let t=f9e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ll(n)}return tb._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var p9e=/(^data:image\/ktx2)|(\.ktx2$)/i;function b9e(e){let t=e.getUrlComponent(!1,!0);return p9e.test(t)?Ll(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}tb.prototype.unload=function(){c(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};tb._loadImageFromTypedArray=l_;var WC=tb;var Mfn=_(T(),1);var Vfn=_(T(),1),y9e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},fa=Object.freeze(y9e);function uy(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,l=e.cacheKey,d=e.asynchronous??!0,u=e.loadBuffer??!1,f=e.loadTypedArray??!1;if(C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.number("options.accessorId",i),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r),!u&&!f)throw new L("At least one of loadBuffer and loadTypedArray must be true.");let p=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=p,this._primitive=s,this._draco=a,this._cacheKey=l,this._asynchronous=d,this._loadBuffer=u,this._loadTypedArray=f,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(uy.prototype=Object.create(Ji.prototype),uy.prototype.constructor=uy);Object.defineProperties(uy.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 g9e=new FH;uy.prototype.load=async function(){return c(this._promise)?this._promise:c(this._draco)?(this._promise=x9e(this),this._promise):(this._promise=_9e(this),this._promise)};async function x9e(e){e._state=xt.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=xt.LOADED,e)}catch(n){if(e.isDestroyed())return;vH(e,n)}}async function _9e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=xt.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=T9e(e,a),e._state=xt.PROCESSING,e}catch(s){if(e.isDestroyed())return;vH(e,s)}}function T9e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Me.getSizeInBytes(s),l=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let f=r*a,p=new Uint8Array(l,d,f);l=new Uint8Array(p).buffer,d=0,Cs("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Me.UNSIGNED_BYTE?u=new Uint8Array(l,d,r):s===Me.UNSIGNED_SHORT?u=new Uint16Array(l,d,r):s===Me.UNSIGNED_INT&&(u=new Uint32Array(l,d,r)),u}function vH(e,t){throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load index buffer",t)}function FH(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}FH.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};FH.prototype.execute=function(){this.buffer=rre(this.typedArray,this.indexDatatype,this.context)};function rre(e,t,n){let i=_t.createIndexBuffer({typedArray:e,context:n,usage:Ne.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}uy.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.LOADED&&this._state!==xt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(c(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){vH(this,o)}if(!c(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=g9e;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,fa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=rre(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=xt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};uy.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(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 wC=uy;var Dbn=_(T(),1);var chn=_(T(),1);var kfn=_(T(),1);function S9e(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 Vs=S9e;var zfn=_(T(),1);var Dfn=_(T(),1);function C9e(e,t){return c(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var ur=C9e;function Qt(){}Qt.objectLegacy=function(e,t){if(c(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(c(o))return o}}};Qt.object=function(e,t){if(c(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(c(r))return r}}};Qt.topLevel=function(e,t,n){let i=e[t];return c(i)&&!Array.isArray(i)?Qt.objectLegacy(i,n):Qt.object(i,n)};Qt.accessor=function(e,t){return Qt.topLevel(e,"accessors",t)};Qt.accessorWithSemantic=function(e,t,n){let i={};return Qt.mesh(e,function(o){return Qt.meshPrimitive(o,function(r){let s=Qt.meshPrimitiveAttribute(r,function(a,l){if(l.indexOf(t)===0&&!c(i[a])){i[a]=!0;let d=n(a);if(c(d))return d}});return c(s)?s:Qt.meshPrimitiveTarget(r,function(a){return Qt.meshPrimitiveTargetAttribute(a,function(l,d){if(d.indexOf(t)===0&&!c(i[l])){i[l]=!0;let u=n(l);if(c(u))return u}})})})})};Qt.accessorContainingVertexAttributeData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(o){let r=Qt.meshPrimitiveAttribute(o,function(s){if(!c(n[s])){n[s]=!0;let a=t(s);if(c(a))return a}});return c(r)?r:Qt.meshPrimitiveTarget(o,function(s){return Qt.meshPrimitiveTargetAttribute(s,function(a){if(!c(n[a])){n[a]=!0;let l=t(a);if(c(l))return l}})})})})};Qt.accessorContainingIndexData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(o){let r=o.indices;if(c(r)&&!c(n[r])){n[r]=!0;let s=t(r);if(c(s))return s}})})};Qt.animation=function(e,t){return Qt.topLevel(e,"animations",t)};Qt.animationChannel=function(e,t){let n=e.channels;return Qt.object(n,t)};Qt.animationSampler=function(e,t){let n=e.samplers;return Qt.object(n,t)};Qt.buffer=function(e,t){return Qt.topLevel(e,"buffers",t)};Qt.bufferView=function(e,t){return Qt.topLevel(e,"bufferViews",t)};Qt.camera=function(e,t){return Qt.topLevel(e,"cameras",t)};Qt.image=function(e,t){return Qt.topLevel(e,"images",t)};Qt.material=function(e,t){return Qt.topLevel(e,"materials",t)};Qt.materialValue=function(e,t){let n=e.values;c(e.extensions)&&c(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(c(o))return o}};Qt.mesh=function(e,t){return Qt.topLevel(e,"meshes",t)};Qt.meshPrimitive=function(e,t){let n=e.primitives;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(c(s))return s}}};Qt.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(c(o))return o}};Qt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(c(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(c(r))return r}}};Qt.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(c(o))return o}};Qt.node=function(e,t){return Qt.topLevel(e,"nodes",t)};Qt.nodeInTree=function(e,t,n){let i=e.nodes;if(c(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(c(a)){let l=n(a,s);if(c(l))return l;let d=a.children;if(c(d)&&(l=Qt.nodeInTree(e,d,n),c(l)))return l}}}};Qt.nodeInScene=function(e,t,n){let i=t.nodes;if(c(i))return Qt.nodeInTree(e,i,n)};Qt.program=function(e,t){return ur(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.programs,t):Qt.topLevel(e,"programs",t)};Qt.sampler=function(e,t){return Qt.topLevel(e,"samplers",t)};Qt.scene=function(e,t){return Qt.topLevel(e,"scenes",t)};Qt.shader=function(e,t){return ur(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.shaders,t):Qt.topLevel(e,"shaders",t)};Qt.skin=function(e,t){return Qt.topLevel(e,"skins",t)};Qt.skinJoint=function(e,t){let n=e.joints;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(c(s))return s}}};Qt.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(c(o))return o}};Qt.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(c(o))return o}};Qt.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(c(o))return o}};Qt.technique=function(e,t){return ur(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.techniques,t):Qt.topLevel(e,"techniques",t)};Qt.texture=function(e,t){return Qt.topLevel(e,"textures",t)};var we=Qt;var ehn=_(T(),1);var Jfn=_(T(),1);function V9e(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 Sd=V9e;function L9e(e,t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n];if(c(i.byteStride)&&i.byteStride>0)return i.byteStride}return q.getSizeInBytes(t.componentType)*Sd(t.type)}var Pl=L9e;function Z9e(e){we.accessor(e,function(n){c(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),we.bufferView(e,function(n){c(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),we.mesh(e,function(n){we.meshPrimitive(n,function(i){if(i.mode=i.mode??oe.TRIANGLES,!c(i.material)){c(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Vs(e.materials,o)}})}),we.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,c(o)){let r=e.bufferViews[o];r.byteStride=Pl(e,i),r.target=oe.ARRAY_BUFFER}}),we.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(c(o)){let r=e.bufferViews[o];r.target=oe.ELEMENT_ARRAY_BUFFER}}),we.material(e,function(n){let i=n.extensions??z.EMPTY_OBJECT,o=i.KHR_materials_common;if(c(o)){let l=o.technique,d=c(o.values)?o.values:{};o.values=d,d.ambient=c(d.ambient)?d.ambient:[0,0,0,1],d.emission=c(d.emission)?d.emission:[0,0,0,1],d.transparency=d.transparency??1,l!=="CONSTANT"&&(d.diffuse=c(d.diffuse)?d.diffuse:[0,0,0,1],l!=="LAMBERT"&&(d.specular=c(d.specular)?d.specular:[0,0,0,1],d.shininess=d.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;c(r)&&we.materialValue(n,function(l){c(l.index)&&d_(l)}),d_(n.emissiveTexture),d_(n.normalTexture),d_(n.occlusionTexture);let s=n.pbrMetallicRoughness;c(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,d_(s.baseColorTexture),d_(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;c(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,d_(a.specularGlossinessTexture))}),we.animation(e,function(n){we.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=R9e(e);return we.node(e,function(n,i){c(t[i])||c(n.translation)||c(n.rotation)||c(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]}),we.sampler(e,function(n){n.wrapS=n.wrapS??oe.REPEAT,n.wrapT=n.wrapT??oe.REPEAT}),c(e.scenes)&&!c(e.scene)&&(e.scene=0),e}function R9e(e){let t={};return we.animation(e,function(n){we.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 d_(e){c(e)&&(e.texCoord=e.texCoord??0)}var zX=Z9e;var mhn=_(T(),1);function G9e(e){return we.shader(e,function(t){v5(t)}),we.buffer(e,function(t){v5(t)}),we.image(e,function(t){v5(t)}),v5(e),e}function v5(e){e.extras=c(e.extras)?e.extras:{},e.extras._pipeline=c(e.extras._pipeline)?e.extras._pipeline:{}}var my=G9e;var Rhn=_(T(),1);var xhn=_(T(),1);var phn=_(T(),1);function E9e(e,t){let n=e.extensionsRequired;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var KX=E9e;function X9e(e,t){let n=e.extensionsUsed;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),KX(e,t),n.length===0&&delete e.extensionsUsed}}var u_=X9e;var I9e=4;function W9e(e){if(Hm(e)!=="glTF")throw new le("File is not valid binary glTF");let n=sre(e,0,5),i=n[1];if(i!==1&&i!==2)throw new le("Binary glTF version is not 1 or 2");return i===1?w9e(e,n):P9e(e,n)}function sre(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*I9e,!0);return o}function w9e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new le("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Il(e,r,i),l=JSON.parse(a);my(l);let d=e.subarray(s,n),u=l.buffers;if(c(u)&&Object.keys(u).length>0){let f=u.binary_glTF??u.KHR_binary_glTF;c(f)&&(f.extras._pipeline.source=d,delete f.uri)}return u_(l,"KHR_binary_glTF"),l}function P9e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=sre(e,i,2),a=s[0],l=s[1];i+=8;let d=e.subarray(i,i+a);if(i+=a,l===1313821514){let u=Il(d);o=JSON.parse(u),my(o)}else l===5130562&&(r=d)}if(c(o)&&c(r)){let s=o.buffers;if(c(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var JX=W9e;var Ihn=_(T(),1);function v9e(e){return we.shader(e,function(t){F5(t)}),we.buffer(e,function(t){F5(t)}),we.image(e,function(t){F5(t)}),F5(e),e}function F5(e){c(e.extras)&&(c(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var QX=v9e;var dbn=_(T(),1);var vhn=_(T(),1);function F9e(e,t){let n=e.extensionsUsed;c(n)||(n=[],e.extensionsUsed=n),Vs(n,t,!0)}var wu=F9e;var Yhn=_(T(),1);var Mhn=_(T(),1);function A9e(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 nb=A9e;function M9e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Sd(t.type);if(!c(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),l=n[o],d=l.buffer,f=i[d].extras._pipeline.source,p=t.count,y=Pl(e,t),h=t.byteOffset+l.byteOffset+f.byteOffset,g=t.componentType,x=q.getSizeInBytes(g),S=new DataView(f.buffer),V=new Array(r),Z=nb(g);for(let R=0;R<p;R++){Z(S,h,r,x,V);for(let E=0;E<r;E++){let I=V[E];s[E]=Math.min(s[E],I),a[E]=Math.max(a[E],I)}h+=y}return{min:s,max:a}}var m_=M9e;var jhn=_(T(),1);var N9e=[oe.FUNC_ADD,oe.FUNC_ADD],k9e=[oe.ONE,oe.ZERO,oe.ONE,oe.ZERO];function are(e,t){let n=e.enable;return c(n)?n.indexOf(t)>-1:!1}var U9e=[oe.ZERO,oe.ONE,oe.SRC_COLOR,oe.ONE_MINUS_SRC_COLOR,oe.SRC_ALPHA,oe.ONE_MINUS_SRC_ALPHA,oe.DST_ALPHA,oe.ONE_MINUS_DST_ALPHA,oe.DST_COLOR,oe.ONE_MINUS_DST_COLOR];function O9e(e,t){if(!c(e))return t;for(let n=0;n<4;n++)if(U9e.indexOf(e[n])===-1)return t;return e}function D9e(e){let t={},n={},i=e.techniques;return c(i)&&(we.technique(e,function(o,r){let s=o.states;if(c(s)){let a=n[r]={};if(are(s,oe.BLEND)){a.alphaMode="BLEND";let l=s.functions;c(l)&&(c(l.blendEquationSeparate)||c(l.blendFuncSeparate))&&(t[r]={blendEquation:l.blendEquationSeparate??N9e,blendFactors:O9e(l.blendFuncSeparate,k9e)})}are(s,oe.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(c(e.extensions)||(e.extensions={}),wu(e,"KHR_blend")),we.material(e,function(o){if(c(o.technique)){let r=n[o.technique];we.objectLegacy(r,function(a,l){o[l]=a});let s=t[o.technique];c(s)&&(c(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var jX=D9e;var lpn=_(T(),1);var npn=_(T(),1);function B9e(e,t){let n=e.extensionsRequired;c(n)||(n=[],e.extensionsRequired=n),Vs(n,t,!0),wu(e,t)}var qX=B9e;function Y9e(e){let t=e.techniques,n={},i={},o={};if(c(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,we.technique(e,function(a,l){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(we.techniqueAttribute(a,function(f,p){u=a.parameters[f],d.attributes[p]={semantic:u.semantic}}),we.techniqueUniform(a,function(f,p){u=a.parameters[f],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},c(n[l])||(n[l]={}),n[l][f]=p}),c(o[a.program]))d.program=o[a.program];else{let f=e.programs[a.program],p={name:f.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},y=e.shaders[f.fragmentShader];p.fragmentShader=Vs(r.shaders,y,!0);let h=e.shaders[f.vertexShader];p.vertexShader=Vs(r.shaders,h,!0),d.program=Vs(r.programs,p),o[a.program]=d.program}i[l]=Vs(r.techniques,d)}),r.techniques.length>0&&(c(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,wu(e,"KHR_techniques_webgl"),qX(e,"KHR_techniques_webgl"))}return we.material(e,function(r){if(c(r.technique)){let s={technique:i[r.technique]};we.objectLegacy(r.values,function(a,l){c(s.values)||(s.values={});let d=n[r.technique][l];c(d)&&(s.values[d]=a)}),c(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 $X=Y9e;var _pn=_(T(),1);var hpn=_(T(),1);function H9e(e,t){C.typeOf.object("material",e),C.defined("handler",t);let n=e.pbrMetallicRoughness;if(c(n)){if(c(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(c(s))return s}if(c(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(c(s))return s}}let{extensions:i}=e;if(c(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(c(r)){if(c(r.diffuseTexture)){let l=r.diffuseTexture,d=t(l.index,l);if(c(d))return d}if(c(r.specularGlossinessTexture)){let l=r.specularGlossinessTexture,d=t(l.index,l);if(c(d))return d}}let s=i.KHR_materials_specular;if(c(s)){let{specularTexture:l,specularColorTexture:d}=s;if(c(l)){let u=t(l.index,l);if(c(u))return u}if(c(d)){let u=t(d.index,d);if(c(u))return u}}let a=i.KHR_materials_common;if(c(a)&&c(a.values)){let{diffuse:l,ambient:d,emission:u,specular:f}=a.values;if(c(l)&&c(l.index)){let p=t(l.index,l);if(c(p))return p}if(c(d)&&c(d.index)){let p=t(d.index,d);if(c(p))return p}if(c(u)&&c(u.index)){let p=t(u.index,u);if(c(p))return p}if(c(f)&&c(f.index)){let p=t(f.index,f);if(c(p))return p}}}let o=we.materialValue(e,function(r){if(c(r.index)){let s=t(r.index,r);if(c(s))return s}});if(c(o))return o;if(c(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(c(s))return s}if(c(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(c(s))return s}if(c(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(c(s))return s}}var PC=H9e;var cre=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function z9e(e,t){return t=t??cre,cre.forEach(function(n){t.indexOf(n)>-1&&J9e(e,n)}),e}var K9e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function J9e(e,t){let n=K9e[t],i=e[n];if(c(i)){let o=0,r=_h[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(xh[t](e,a-o),o++)}}function xh(){}xh.accessor=function(e,t){e.accessors.splice(t,1),we.mesh(e,function(i){we.meshPrimitive(i,function(o){we.meshPrimitiveAttribute(o,function(a,l){a>t&&o.attributes[l]--}),we.meshPrimitiveTarget(o,function(a){we.meshPrimitiveTargetAttribute(a,function(l,d){l>t&&a[d]--})});let r=o.indices;c(r)&&r>t&&o.indices--;let s=o.extensions;c(s)&&c(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),we.skin(e,function(i){c(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),we.animation(e,function(i){we.animationSampler(i,function(o){c(o.input)&&o.input>t&&o.input--,c(o.output)&&o.output>t&&o.output--})})};xh.buffer=function(e,t){e.buffers.splice(t,1),we.bufferView(e,function(i){c(i.buffer)&&i.buffer>t&&i.buffer--,c(i.extensions)&&c(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};xh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),we.accessor(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.shader(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.image(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ur(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){c(o.extensions)&&c(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),ur(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(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let d=a[l];c(d.bufferView)&&d.bufferView>t&&d.bufferView--,c(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,c(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(ur(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let d in l)if(l.hasOwnProperty(d)){let u=l[d];c(u.values)&&u.values>t&&u.values--,c(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,c(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};xh.image=function(e,t){e.images.splice(t,1),we.texture(e,function(i){c(i.source)&&i.source>t&&--i.source;let o=i.extensions;c(o)&&c(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:c(o)&&c(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};xh.mesh=function(e,t){e.meshes.splice(t,1),we.node(e,function(i){c(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};xh.node=function(e,t){e.nodes.splice(t,1),we.skin(e,function(i){c(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),we.animation(e,function(i){we.animationChannel(i,function(o){c(o.target)&&c(o.target.node)&&o.target.node>t&&o.target.node--})}),we.technique(e,function(i){we.techniqueUniform(i,function(o){c(o.node)&&o.node>t&&o.node--})}),we.node(e,function(i){c(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),we.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};xh.material=function(e,t){e.materials.splice(t,1),we.mesh(e,function(i){we.meshPrimitive(i,function(o){c(o.material)&&o.material>t&&o.material--})})};xh.sampler=function(e,t){e.samplers.splice(t,1),we.texture(e,function(i){c(i.sampler)&&i.sampler>t&&--i.sampler})};xh.texture=function(e,t){if(e.textures.splice(t,1),we.material(e,function(i){PC(i,function(o,r){r.index>t&&--r.index})}),ur(e,"EXT_feature_metadata")){we.mesh(e,function(r){we.meshPrimitive(r,function(s){let a=s.extensions;if(c(a)&&c(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(c(d)){let u=d.length;for(let f=0;f<u;++f){let y=d[f].featureIds.texture;y.index>t&&--y.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let u=a[l].texture;u.index>t&&--u.index}}}}if(ur(e,"EXT_mesh_features")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){let r=o.extensions;if(c(r)&&c(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(c(a)){let l=a.length;for(let d=0;d<l;++d){let u=a[d];c(u.texture)&&u.texture.index>t&&--u.texture.index}}}})}),ur(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let d in l)if(l.hasOwnProperty(d)){let u=l[d];u.index>t&&--u.index}}}}};function _h(){}_h.accessor=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){we.meshPrimitiveAttribute(i,function(r){t[r]=!0}),we.meshPrimitiveTarget(i,function(r){we.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;c(o)&&(t[o]=!0)})}),we.skin(e,function(n){c(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),we.animation(e,function(n){we.animationSampler(n,function(i){c(i.input)&&(t[i.input]=!0),c(i.output)&&(t[i.output]=!0)})}),ur(e,"EXT_mesh_gpu_instancing")&&we.node(e,function(n){c(n.extensions)&&c(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})}),ur(e,"CESIUM_primitive_outline")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;c(s)&&(t[s]=!0)}})}),t};_h.buffer=function(e){let t={};return we.bufferView(e,function(n){c(n.buffer)&&(t[n.buffer]=!0),c(n.extensions)&&c(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};_h.bufferView=function(e){let t={};if(we.accessor(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),we.shader(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),we.image(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),ur(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){c(i.extensions)&&c(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),ur(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(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a];c(l.bufferView)&&(t[l.bufferView]=!0),c(l.arrayOffsetBufferView)&&(t[l.arrayOffsetBufferView]=!0),c(l.stringOffsetBufferView)&&(t[l.stringOffsetBufferView]=!0)}}}}if(ur(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let d=a[l];c(d.values)&&(t[d.values]=!0),c(d.arrayOffsets)&&(t[d.arrayOffsets]=!0),c(d.stringOffsets)&&(t[d.stringOffsets]=!0)}}}}return t};_h.image=function(e){let t={};return we.texture(e,function(n){c(n.source)&&(t[n.source]=!0),c(n.extensions)&&c(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:c(n.extensions)&&c(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};_h.mesh=function(e){let t={};return we.node(e,function(n){if(c(n.mesh&&c(e.meshes))){let i=e.meshes[n.mesh];c(i)&&c(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function lre(e,t,n){let i=e.nodes[t];return c(i.mesh)||c(i.camera)||c(i.skin)||c(i.weights)||c(i.extras)||c(i.extensions)&&Object.keys(i.extensions).length!==0||c(n[t])?!1:!c(i.children)||i.children.filter(function(o){return!lre(e,o,n)}).length===0}_h.node=function(e){let t={};return we.skin(e,function(n){c(n.skeleton)&&(t[n.skeleton]=!0),we.skinJoint(n,function(i){t[i]=!0})}),we.animation(e,function(n){we.animationChannel(n,function(i){c(i.target)&&c(i.target.node)&&(t[i.target.node]=!0)})}),we.technique(e,function(n){we.techniqueUniform(n,function(i){c(i.node)&&(t[i.node]=!0)})}),we.node(e,function(n,i){lre(e,i,t)||(t[i]=!0)}),t};_h.material=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){c(i.material)&&(t[i.material]=!0)})}),t};_h.texture=function(e){let t={};if(we.material(e,function(n){PC(n,function(i){t[i]=!0})}),ur(e,"EXT_feature_metadata")){we.mesh(e,function(o){we.meshPrimitive(o,function(r){let s=r.extensions;if(c(s)&&c(s.EXT_feature_metadata)){let l=s.EXT_feature_metadata.featureIdTextures;if(c(l)){let d=l.length;for(let u=0;u<d;++u){let p=l[u].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].texture;t[d.index]=!0}}}}if(ur(e,"EXT_mesh_features")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(c(s)){let a=s.length;for(let l=0;l<a;++l){let d=s[l];c(d.texture)&&(t[d.texture.index]=!0)}}}})}),ur(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let d=a[l];t[d.index]=!0}}}}return t};_h.sampler=function(e){let t={};return we.texture(e,function(n){c(n.sampler)&&(t[n.sampler]=!0)}),t};var eI=z9e;var Apn=_(T(),1);var Cpn=_(T(),1);function Q9e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Vs(e.buffers,n),byteOffset:0,byteLength:t.length};return Vs(e.bufferViews,o)}var tI=Q9e;var Xpn=_(T(),1);function j9e(e,t){let n=Pl(e,t),i=q.getSizeInBytes(t.componentType),o=Sd(t.type),r=t.count,s=new Array(o*r);if(!c(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],l=e.buffers[a.buffer].extras._pipeline.source,d=t.byteOffset+a.byteOffset+l.byteOffset,u=new DataView(l.buffer),f=new Array(o),p=nb(t.componentType);for(let y=0;y<r;++y){p(u,d,o,i,f);for(let h=0;h<o;++h)s[y*o+h]=f[h];d+=n}return s}var nI=j9e;function q9e(e){let t;return we.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===oe.BYTE?A5(e,i,q.UNSIGNED_BYTE):t!==oe.UNSIGNED_BYTE&&t!==oe.UNSIGNED_SHORT&&A5(e,i,q.UNSIGNED_SHORT)}),we.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===oe.BYTE?A5(e,i,q.UNSIGNED_BYTE):t===oe.SHORT&&A5(e,i,q.UNSIGNED_SHORT)}),e}function A5(e,t,n){let i=q.createTypedArray(n,nI(e,t)),o=new Uint8Array(i.buffer);t.bufferView=tI(e,o),t.componentType=n,t.byteOffset=0}var iI=q9e;var Opn=_(T(),1);function $9e(e,t){return u_(e,t),t==="CESIUM_RTC"&&eMe(e),AH(e,t)}function eMe(e){we.technique(e,function(t){we.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function AH(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)AH(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;c(n)&&(i=n[t],c(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&AH(e[o],t);return i}}var f_=$9e;var M5={.8:sMe,"1.0":RMe,"2.0":void 0};function tMe(e,t){t=t??z.EMPTY_OBJECT;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(M5,i)||(c(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(M5,i)||(i="1.0"));let o=M5[i];for(;c(o)&&i!==n;)o(e,t),i=e.asset.version,o=M5[i];return t.keepLegacyExtensions||(XMe(e,t),IMe(e)),e}function mre(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;c(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function nMe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],l=a.primitive??oe.TRIANGLES;a.mode=a.mode??l,delete a.primitive}}}}function iMe(e){let t=e.nodes,n=new m,i=new Fe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(c(r.rotation)){let a=r.rotation;m.fromArray(a,0,n),Fe.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;c(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function oMe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new m,a=new Fe;for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)){let d=t[l],u=d.channels,f=d.parameters,p=d.samplers;if(c(u)){let y=u.length;for(let h=0;h<y;++h){let g=u[h];if(g.target.path==="rotation"){let x=f[p[g.sampler].output];if(c(r[x]))continue;r[x]=!0;let S=n[x],V=i[S.bufferView],R=o[V.buffer].extras._pipeline.source,E=R.byteOffset+V.byteOffset+S.byteOffset,I=S.componentType,v=S.count,P=Sd(S.type),F=S.count*P,N=q.createArrayBufferView(I,R.buffer,E,F);for(let b=0;b<v;b++){let G=b*P;m.unpack(N,G,s);let X=N[G+3];Fe.fromAxisAngle(s,X,a),Fe.pack(a,N,G)}}}}}}function rMe(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(c(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 sMe(e){c(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(c(e.version)&&delete e.version,mre(e),nMe(e),iMe(e),oMe(e),rMe(e),c(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),c(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,wu(e,"KHR_materials_common")}}function aMe(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(c(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 dre(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),c(o.name)||(o.name=i)}return n}function cMe(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,c(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&c(n[s])){let a={},l=e[s];e[s]=dre(l,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);c(e.scene)&&(e.scene=n.scenes[e.scene]),we.bufferView(e,function(s){c(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),we.accessor(e,function(s){c(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),we.shader(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),we.program(e,function(s){c(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),c(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),we.technique(e,function(s){c(s.program)&&(s.program=n.programs[s.program]),we.techniqueParameter(s,function(a){c(a.node)&&(a.node=n.nodes[a.node]);let l=a.value;typeof l=="string"&&(a.value={index:n.textures[l]})})}),we.mesh(e,function(s){we.meshPrimitive(s,function(a){c(a.indices)&&(a.indices=n.accessors[a.indices]),we.meshPrimitiveAttribute(a,function(l,d){a.attributes[d]=n.accessors[l]}),c(a.material)&&(a.material=n.materials[a.material])})}),we.node(e,function(s){let a=s.children;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}if(c(s.meshes)){let l=s.meshes,d=l.length;if(d>0)for(s.mesh=n.meshes[l[0]],t=1;t<d;++t){let u={mesh:n.meshes[l[t]]},f=Vs(e.nodes,u);c(a)||(a=[],s.children=a),a.push(f)}delete s.meshes}if(c(s.camera)&&(s.camera=n.cameras[s.camera]),c(s.skin)&&(s.skin=n.skins[s.skin]),c(s.skeletons)){let l=s.skeletons;if(l.length>0&&c(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[l[0]]}delete s.skeletons}c(s.jointName)&&delete s.jointName}),we.skin(e,function(s){c(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(c(a)){let l=[],d=a.length;for(t=0;t<d;++t)l[t]=o[a[t]];s.joints=l,delete s.jointNames}}),we.scene(e,function(s){let a=s.nodes;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}}),we.animation(e,function(s){let a={};s.samplers=dre(s.samplers,a),we.animationSampler(s,function(l){l.input=n.accessors[l.input],l.output=n.accessors[l.output]}),we.animationChannel(s,function(l){l.sampler=a[l.sampler];let d=l.target;c(d)&&(d.node=n.nodes[d.id],delete d.id)})}),we.material(e,function(s){c(s.technique)&&(s.technique=n.techniques[s.technique]),we.materialValue(s,function(l,d){typeof l=="string"&&(s.values[d]={index:n.textures[l]})});let a=s.extensions;if(c(a)){let l=a.KHR_materials_common;c(l)&&c(l.values)&&we.materialValue(l,function(d,u){typeof d=="string"&&(l.values[u]={index:n.textures[d]})})}}),we.image(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],s.mimeType=l.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),we.texture(e,function(s){c(s.sampler)&&(s.sampler=n.samplers[s.sampler]),c(s.source)&&(s.source=n.images[s.source])})}function lMe(e){we.animation(e,function(t){we.animationSampler(t,function(n){delete n.name})})}function dMe(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]}we.node(e,function(t){c(t.children)&&t.children.length===0&&delete t.children})}function uMe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var mMe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function fMe(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],c(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];c(mMe[o])&&e.extensionsRequired.push(o)}}}function hMe(e){we.buffer(e,function(t){delete t.type})}function pMe(e){we.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function bMe(e){we.mesh(e,function(t){we.meshPrimitive(t,function(n){we.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})}),we.technique(e,function(t){we.techniqueParameter(t,function(n){let i=n.semantic;c(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var yMe={POSITION:!0,NORMAL:!0,TANGENT:!0},gMe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function xMe(e){let t={};we.mesh(e,function(n){we.meshPrimitive(n,function(i){we.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,l="_0";s>=0&&(a=r.substring(0,s),l=r.substring(s));let d,u=gMe[a];c(u)?(d=u+l,t[r]=d):c(yMe[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];c(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),we.technique(e,function(n){we.techniqueParameter(n,function(i){let o=t[i.semantic];c(o)&&(i.semantic=o)})})}function _Me(e){we.camera(e,function(t){let n=t.perspective;if(c(n)){let i=n.aspectRatio;c(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;c(o)&&o===0&&(n.yfov=1)}})}function NH(e,t){return c(t.byteStride)&&t.byteStride!==0?t.byteStride:Pl(e,t)}function TMe(e){we.buffer(e,function(t){c(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),we.accessor(e,function(t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n],o=NH(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function SMe(e){let t,n,i,o=e.bufferViews,r={};we.accessorContainingVertexAttributeData(e,function(a){let l=e.accessors[a];c(l.bufferView)&&(r[l.bufferView]=!0)});let s={};we.accessor(e,function(a){c(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 l=s[a];l.sort(function(p,y){return p.byteOffset-y.byteOffset});let d=0,u=0,f=l.length;for(t=0;t<f;++t){let p=l[t],y=NH(e,p),h=p.byteOffset,g=p.count*y;delete p.byteStride;let x=t<f-1,S=x?NH(e,l[t+1]):void 0;if(y!==S){let V=He(i,!0);r[a]&&(V.byteStride=y),V.byteOffset+=d,V.byteLength=h+g-d;let Z=Vs(o,V);for(n=u;n<=t;++n)p=l[n],p.bufferView=Z,p.byteOffset=p.byteOffset-d;d=x?l[t+1].byteOffset:void 0,u=t+1}}}eI(e,["accessor","bufferView","buffer"])}function CMe(e){we.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!c(n.min)||!c(n.max)){let i=m_(e,n);n.min=i.min,n.max=i.max}})}function fre(e){return(!c(e.children)||e.children.length===0)&&(!c(e.meshes)||e.meshes.length===0)&&!c(e.camera)&&!c(e.skin)&&!c(e.skeletons)&&!c(e.jointName)&&(!c(e.translation)||m.fromArray(e.translation).equals(m.ZERO))&&(!c(e.scale)||m.fromArray(e.scale).equals(new m(1,1,1)))&&(!c(e.rotation)||ce.fromArray(e.rotation).equals(new ce(0,0,0,1)))&&(!c(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!c(e.extensions)&&!c(e.extras)}function hre(e,t){we.scene(e,function(n){let i=n.nodes;if(c(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),we.node(e,function(n,i){if(c(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),fre(n)&&hre(e,i))}}),delete e.nodes[t]}function VMe(e){return we.node(e,function(t,n){fre(t)&&hre(e,n)}),e}function LMe(e){we.animation(e,function(t){we.animationSampler(t,function(n){let i=e.accessors[n.input];if(!c(i.min)||!c(i.max)){let o=m_(e,i);i.min=o.min,i.max=o.max}})})}function ZMe(e){we.accessor(e,function(t){if(c(t.min)||c(t.max)){let n=m_(e,t);c(t.min)&&(t.min=n.min),c(t.max)&&(t.max=n.max)}})}function RMe(e){e.asset=e.asset??{},e.asset.version="2.0",mre(e),aMe(e),VMe(e),cMe(e),lMe(e),uMe(e),fMe(e),TMe(e),SMe(e),CMe(e),LMe(e),ZMe(e),hMe(e),pMe(e),bMe(e),xMe(e),iI(e),_Me(e),jX(e),$X(e),dMe(e)}var GMe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],EMe=["u_diffuse","u_diffuse_mat"];function kH(e){e.pbrMetallicRoughness=c(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function UH(e){return c(e.index)}function OH(e){return Array.isArray(e)&&e.length===4}function pre(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 XMe(e,t){t=t??z.EMPTY_OBJECT;let n=t.baseColorTextureNames??GMe,i=t.baseColorFactorNames??EMe;we.material(e,function(o){we.materialValue(o,function(r,s){n.indexOf(s)!==-1&&UH(r)?(kH(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&OH(r)&&(kH(o),o.pbrMetallicRoughness.baseColorFactor=pre(r))})}),f_(e,"KHR_techniques_webgl"),f_(e,"KHR_blend")}function MH(e,t){c(t)&&(OH(t)?e.pbrMetallicRoughness.baseColorFactor=pre(t):UH(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function ure(e,t){c(t)&&(OH(t)?e.emissiveFactor=t.slice(0,3):UH(t)&&(e.emissiveTexture=t))}function IMe(e){we.material(e,function(t){let n=(t.extensions??z.EMPTY_OBJECT).KHR_materials_common;if(!c(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,l=n.doubleSided,d=n.transparent;kH(t),n.technique==="CONSTANT"?(wu(e,"KHR_materials_unlit"),t.extensions=c(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},MH(t,s),MH(t,o)):(MH(t,r),ure(t,o),ure(t,s)),c(l)&&(t.doubleSided=l),c(a)&&(c(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),c(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),f_(e,"KHR_materials_common")}var oI=tMe;var Cbn=_(T(),1);function fc(){}fc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;c(n)&&c(n.message)&&(i+=`
${n.message}`);let o=new le(i);return c(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};fc.getNodeTransform=function(e){return c(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(c(e.translation)?e.translation:m.ZERO,c(e.rotation)?e.rotation:Fe.IDENTITY,c(e.scale)?e.scale:m.ONE)};fc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=c(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};fc.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}};fc.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}};fc.hasQuantizedAttributes=function(e){if(!c(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(c(n.quantization))return!0}return!1};fc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;c(t)?(i=pt.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=rn.getGlslType(s);r&&(a="vec4");let l=c(e.quantization),d;return l&&(d=r?"vec4":rn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:l,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:d}};var WMe=new m,wMe=new m;fc.getPositionMinMax=function(e,t,n){let i=fc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return c(n)&&c(t)&&(r=m.add(r,t,wMe),o=m.add(o,n,WMe)),{min:r,max:o}};fc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===Po.Y?n=M.clone(Po.Y_UP_TO_Z_UP,n):e===Po.X&&(n=M.clone(Po.X_UP_TO_Z_UP,n)),t===Po.Z&&(n=M.multiplyTransformation(n,Po.Z_UP_TO_X_UP,n)),n};var PMe=new te;fc.getCullFace=function(e,t){if(!ve.isTriangles(t))return _i.BACK;let n=M.getMatrix3(e,PMe);return te.determinant(n)<0?_i.FRONT:_i.BACK};fc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};fc.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,WEB3D_quantized_attributes:!0};fc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!fc.supportedExtensions[i])throw new le(`Unsupported glTF Extension: ${i}`)}};var qt=fc;function fy(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltfResource",n),C.typeOf.object("options.baseResource",i),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=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(fy.prototype=Object.create(Ji.prototype),fy.prototype.constructor=fy);Object.defineProperties(fy.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});fy.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=xt.LOADING,c(this._gltfJson)?(this._promise=bre(this,this._gltfJson),this._promise):c(this._typedArray)?(this._promise=yre(this,this._typedArray),this._promise):(this._promise=vMe(this),this._promise))};async function vMe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;DH(e,n)}return yre(e,t)}function DH(e,t){e.unload(),e._state=xt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function FMe(e,t){if(c(t.asset)&&t.asset.version==="2.0"&&!ur(t,"KHR_techniques_webgl")&&!ur(t,"KHR_materials_common"))return Promise.resolve();let n=[];we.buffer(t,function(i){if(!c(i.extras._pipeline.source)&&c(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),oI(t)}function AMe(e){let t=[];return we.buffer(e,function(n){let i=n.uri;!c(n.extras._pipeline.source)&&c(i)&&Sp(i)&&(delete n.uri,t.push(Ge.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function MMe(e,t){let n=[];return we.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(c(r)&&!c(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 bre(e,t){try{my(t),await AMe(t),await FMe(e,t),zX(t),await MMe(e,t),QX(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new le(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return c(i)&&qt.checkSupportedExtensions(i),e._gltf=t,e._state=xt.READY,e}catch(n){if(e.isDestroyed())return;DH(e,n)}}async function yre(e,t){let n;try{Hm(t)==="glTF"?n=JX(t):n=er(t)}catch(i){if(e.isDestroyed())return;DH(e,i)}return bre(e,n)}fy.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};fy.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var vC=fy;var G0n=_(T(),1);var d0n=_(T(),1);var qbn=_(T(),1);var Ybn=_(T(),1),NMe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Th=Object.freeze(NMe);var Vo={};function kMe(){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 UMe(){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 OMe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function DMe(){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 BMe(){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 YMe(){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 HMe(){this.attributes=[]}function zMe(){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}function KMe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function JMe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function QMe(){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 jMe(){this.nodes=[]}var qMe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function $Me(){this.input=[],this.interpolation=void 0,this.output=[]}function eNe(){this.node=void 0,this.path=void 0}function tNe(){this.sampler=void 0,this.target=void 0}function nNe(){this.name=void 0,this.samplers=[],this.channels=[]}function iNe(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function oNe(){this.name=void 0,this.stages=[]}function gre(){this.credits=[]}function rNe(){this.asset=new gre,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 sNe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=te.clone(te.IDENTITY),this.scale=1,this.channels=void 0}function hy(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ce.clone(hy.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=hy.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=hy.DEFAULT_ROUGHNESS_FACTOR}hy.DEFAULT_BASE_COLOR_FACTOR=ce.ONE;hy.DEFAULT_METALLIC_FACTOR=1;hy.DEFAULT_ROUGHNESS_FACTOR=1;function h_(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ce.clone(h_.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=m.clone(h_.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=h_.DEFAULT_GLOSSINESS_FACTOR}h_.DEFAULT_DIFFUSE_FACTOR=ce.ONE;h_.DEFAULT_SPECULAR_FACTOR=m.ONE;h_.DEFAULT_GLOSSINESS_FACTOR=1;function rI(){this.specularFactor=rI.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=m.clone(rI.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}rI.DEFAULT_SPECULAR_FACTOR=1;rI.DEFAULT_SPECULAR_COLOR_FACTOR=m.ONE;function sI(){this.anisotropyStrength=sI.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=sI.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}sI.DEFAULT_ANISOTROPY_STRENGTH=0;sI.DEFAULT_ANISOTROPY_ROTATION=0;function aI(){this.clearcoatFactor=aI.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=aI.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}aI.DEFAULT_CLEARCOAT_FACTOR=0;aI.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function BH(){this.metallicRoughness=new hy,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=m.clone(BH.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Th.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}BH.DEFAULT_EMISSIVE_FACTOR=m.ZERO;Vo.Quantization=kMe;Vo.Attribute=UMe;Vo.Indices=OMe;Vo.FeatureIdAttribute=DMe;Vo.FeatureIdTexture=YMe;Vo.FeatureIdImplicitRange=BMe;Vo.MorphTarget=HMe;Vo.Primitive=zMe;Vo.Instances=KMe;Vo.Skin=JMe;Vo.Node=QMe;Vo.Scene=jMe;Vo.AnimatedPropertyType=Object.freeze(qMe);Vo.AnimationSampler=$Me;Vo.AnimationTarget=eNe;Vo.AnimationChannel=tNe;Vo.Animation=nNe;Vo.ArticulationStage=iNe;Vo.Articulation=oNe;Vo.Asset=gre;Vo.Components=rNe;Vo.TextureReader=sNe;Vo.MetallicRoughness=hy;Vo.SpecularGlossiness=h_;Vo.Specular=rI;Vo.Anisotropy=sI;Vo.Clearcoat=aI;Vo.Material=BH;var Cn=Vo;var N5={};N5.getImageIdFromTexture=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e;C.typeOf.object("options.gltf",t),C.typeOf.number("options.textureId",n),C.typeOf.object("options.supportedImageFormats",i);let o=t.textures[n],r=o.extensions;if(c(r)){if(i.webp&&c(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&c(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};N5.createSampler=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e;C.typeOf.object("options.gltf",t),C.typeOf.object("options.textureInfo",n);let o=xn.REPEAT,r=xn.REPEAT,s=Jt.LINEAR,a=di.LINEAR,l=n.index,u=t.textures[l].sampler;if(c(u)){let f=t.samplers[u];o=f.wrapS??o,r=f.wrapT??r,s=f.minFilter??s,a=f.magFilter??a}return i&&s!==Jt.LINEAR&&s!==Jt.NEAREST&&(s===Jt.NEAREST_MIPMAP_NEAREST||s===Jt.NEAREST_MIPMAP_LINEAR?s=Jt.NEAREST:s=Jt.LINEAR),new en({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var aNe=new D(1,1);N5.createModelTextureReader=function(e){e=e??z.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e;C.typeOf.object("options.textureInfo",t);let o=t.texCoord??0,r,s=t.extensions?.KHR_texture_transform;if(c(s)){o=s.texCoord??o;let l=c(s.offset)?D.unpack(s.offset):D.ZERO,d=s.rotation??0,u=c(s.scale)?D.unpack(s.scale):aNe;d=-d,r=new te(Math.cos(d)*u.x,-Math.sin(d)*u.y,l.x,Math.sin(d)*u.x,Math.cos(d)*u.y,l.y,0,0,1)}let a=new Cn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var vl=N5;var f0n=_(T(),1);function cNe(e){let t=document.createElement("canvas");return t.width=w.nextPowerOfTwo(e.width),t.height=w.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var py=cNe;function by(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,l=e.asynchronous??!0;C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.object("options.textureInfo",i),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r),C.typeOf.object("options.supportedImageFormats",s);let d=i.index,u=vl.getImageIdFromTexture({gltf:n,textureId:d,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=u,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=l,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(by.prototype=Object.create(Ji.prototype),by.prototype.constructor=by);Object.defineProperties(by.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var lNe=new YH;async function dNe(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=xt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load texture",n)}}by.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=xt.LOADING,this._promise=dNe(this),this._promise)};function YH(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}YH.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};YH.prototype.execute=function(){this.texture=xre(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function xre(e,t,n,i,o,r){let s=i.internalFormat,a=!1;ke.isCompressedFormat(s)&&!c(o)&&(a=!0);let l=vl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),d=l.minificationFilter,u=l.wrapS,f=l.wrapT,p=d===Jt.NEAREST_MIPMAP_NEAREST||d===Jt.NEAREST_MIPMAP_LINEAR||d===Jt.LINEAR_MIPMAP_NEAREST||d===Jt.LINEAR_MIPMAP_LINEAR,y=!c(s)&&p,h=y||u===xn.REPEAT||u===xn.MIRRORED_REPEAT||f===xn.REPEAT||f===xn.MIRRORED_REPEAT,g=!w.isPowerOfTwo(i.width)||!w.isPowerOfTwo(i.height),x=h&&g,S;return c(s)?(!r.webgl2&&ke.isCompressedFormat(s)&&g&&h&&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."),S=Pt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:l})):(x&&(i=py(i)),S=Pt.create({id:n,context:r,source:i,sampler:l,flipY:!1,skipColorSpaceConversion:!0})),y&&S.generateMipmap(),S}by.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.LOADED&&this._state!==xt.PROCESSING||c(this._texture)||!c(this._image))return!1;this._state=xt.PROCESSING;let t;if(this._asynchronous){let n=lNe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,fa.TEXTURE))return;t=n.texture}else t=xre(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=xt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};by.prototype.unload=function(){c(this._texture)&&this._texture.destroy(),c(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 FC=by;var U0n=_(T(),1);function yy(e){e=e??z.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,l=e.attributeSemantic,d=e.accessorId,u=e.cacheKey,f=e.asynchronous??!0,p=e.loadBuffer??!1,y=e.loadTypedArray??!1;if(C.typeOf.func("options.resourceCache",t),C.typeOf.object("options.gltf",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),!p&&!y)throw new L("At least one of loadBuffer and loadTypedArray must be true.");let h=c(r),g=c(s),x=_re(a,l),S=c(l),V=c(d);if(h===x)throw new L("One of options.bufferViewId and options.draco must be defined.");if(x&&!S)throw new L("When options.draco is defined options.attributeSemantic must also be defined.");if(x&&!V)throw new L("When options.draco is defined options.accessorId must also be defined.");if(x&&!g)throw new L("When options.draco is defined options.primitive must also be defined.");x&&(C.typeOf.object("options.primitive",s),C.typeOf.object("options.draco",a),C.typeOf.string("options.attributeSemantic",l),C.typeOf.number("options.accessorId",d)),this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._primitive=s,this._draco=a,this._attributeSemantic=l,this._accessorId=d,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=p,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(yy.prototype=Object.create(Ji.prototype),yy.prototype.constructor=yy);Object.defineProperties(yy.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 _re(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}yy.prototype.load=async function(){return c(this._promise)?this._promise:_re(this._draco,this._attributeSemantic)?(this._promise=mNe(this),this._promise):(this._promise=hNe(this),this._promise)};function uNe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Cn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=rn.VEC2,a.normalizationRange=r;else{let l=rn.getMathType(i);if(l===Number){let d=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=d,a.normalizationRange=r,a.quantizedVolumeStepSize=d*s}else{a.quantizedVolumeOffset=l.unpack(e.minValues),a.normalizationRange=l.unpack(new Array(n).fill(r));let d=new Array(n).fill(e.range);a.quantizedVolumeDimensions=l.unpack(d);let u=d.map(function(f){return f*s});a.quantizedVolumeStepSize=l.unpack(u)}}return a}async function mNe(e){e._state=xt.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=xt.LOADED,e)}catch{if(e.isDestroyed())return;HH(e)}}function fNe(e){e._state=xt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,l=o.array,d=o.data.quantization;c(d)&&(e._quantization=uNe(d,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}async function hNe(e){e._state=xt.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=xt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;HH(e,n)}}function HH(e,t){throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load vertex buffer",t)}function zH(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}zH.prototype.set=function(e,t){this.typedArray=e,this.context=t};zH.prototype.execute=function(){this.buffer=Tre(this.typedArray,this.context)};function Tre(e,t){let n=_t.createVertexBuffer({typedArray:e,context:t,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var pNe=new zH;yy.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.LOADED&&this._state!==xt.PROCESSING)return!1;if(c(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){HH(this,i)}fNe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=pNe;if(i.set(n,e.context),!e.jobScheduler.execute(i,fa.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Tre(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=xt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};yy.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(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 AC=yy;var Syn=_(T(),1);var hyn=_(T(),1);var K0n=_(T(),1);function cI(e){e=e??z.EMPTY_OBJECT;let t=e.id;C.typeOf.string("options.id",t);let n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];c(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=He(e.extras,!0),this._extensions=He(e.extensions,!0)}cI.fromJson=function(e){e=e??z.EMPTY_OBJECT;let t=e.id,n=e.class;C.typeOf.string("options.id",t),C.typeOf.object("options.class",n);let i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=gh.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new cI({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(cI.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}}});cI.BATCH_TABLE_CLASS_NAME="_batchTable";var Jm=cI;var syn=_(T(),1);var $0n=_(T(),1);function k5(e){e=e??z.EMPTY_OBJECT;let t=e.value,n=e.name;C.typeOf.number("options.value",t),C.typeOf.string("options.name",n),this._value=t,this._name=n,this._description=e.description,this._extras=He(e.extras,!0),this._extensions=He(e.extensions,!0)}k5.fromJson=function(e){return C.typeOf.object("value",e),new k5({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(k5.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 lI=k5;function U5(e){e=e??z.EMPTY_OBJECT;let t=e.id,n=e.values;C.typeOf.string("options.id",t),C.defined("options.values",n);let i={},o={},r=n.length;for(let a=0;a<r;++a){let l=n[a];i[l.value]=l.name,o[l.name]=l.value}let s=e.valueType??At.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=He(e.extras,!0),this._extensions=He(e.extensions,!0)}U5.fromJson=function(e){e=e??z.EMPTY_OBJECT;let t=e.id,n=e.enum;C.typeOf.string("options.id",t),C.typeOf.object("options.enum",n);let i=n.values.map(function(o){return lI.fromJson(o)});return new U5({id:t,values:i,valueType:At[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(U5.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 dI=U5;function O5(e){e=e??z.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=He(e.extras,!0),this._extensions=He(e.extensions,!0)}O5.fromJson=function(e){C.typeOf.object("schema",e);let t={};if(c(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=dI.fromJson({id:i,enum:e.enums[i]}));let n={};if(c(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Jm.fromJson({id:i,class:e.classes[i],enums:t}));return new O5({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(O5.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 Cd=O5;function p_(e){e=e??z.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new L("One of options.schema and options.resource must be defined.");this._schema=c(t)?Cd.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(p_.prototype=Object.create(Ji.prototype),p_.prototype.constructor=p_);Object.defineProperties(p_.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});p_.prototype.load=async function(){return c(this._promise)?this._promise:c(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=bNe(this),this._promise)};async function bNe(e){let t=e._resource;e._state=xt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Cd.fromJson(n),e._state=xt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=xt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}p_.prototype.unload=function(){this._schema=void 0};var MC=p_;var Iyn=_(T(),1);var Qm={};function NC(e){return th(e.url)}function D5(e){let{byteOffset:t,byteLength:n}=e;if(ri(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function yNe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Sre(e,t){return`${NC(e)}-buffer-id-${t}`}function uI(e,t,n,i){if(c(e.uri)){let o=i.getDerivedResource({url:e.uri});return NC(o)}return Sre(n,t)}function KH(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],l=uI(a,s,n,i),d=D5(r);return`${l}-range-${d}`}function Cre(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(c(s)){let p=i.getDerivedResource({url:s});return NC(p)}let a=e.bufferViews[r],l=a.buffer,d=e.buffers[l],u=uI(d,l,n,i),f=D5(a);return`${u}-range-${f}`}function gNe(e,t){let n=vl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Qm.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;if(c(t)===c(n))throw new L("One of options.schema and options.resource must be defined.");return c(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${NC(n)}`};Qm.getExternalBufferCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{resource:t}=e;return C.typeOf.object("options.resource",t),`external-buffer:${NC(t)}`};Qm.getEmbeddedBufferCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return C.typeOf.object("options.parentResource",t),C.typeOf.number("options.bufferId",n),`embedded-buffer:${Sre(t,n)}`};Qm.getGltfCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{gltfResource:t}=e;return C.typeOf.object("options.gltfResource",t),`gltf:${NC(t)}`};Qm.getBufferViewCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;C.typeOf.object("options.gltf",t),C.typeOf.number("options.bufferViewId",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o);let r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ri(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let l=uI(a,s,i,o),d=D5(r);return`buffer-view:${l}-range-${d}`};Qm.getDracoCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return C.typeOf.object("options.gltf",t),C.typeOf.object("options.draco",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),`draco:${KH(t,n,i,o)}`};Qm.getVertexBufferCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:l=!1,loadBuffer:d=!1,loadTypedArray:u=!1}=e;C.typeOf.object("options.gltf",t),C.typeOf.object("options.gltfResource",n),C.typeOf.object("options.baseResource",i),C.typeOf.object("options.frameState",o);let f=c(r),p=xNe(s,a),y=c(a);if(f===p)throw new L("One of options.bufferViewId and options.draco must be defined.");if(p&&!y)throw new L("When options.draco is defined options.attributeSemantic must also be defined.");if(p&&(C.typeOf.object("options.draco",s),C.typeOf.string("options.attributeSemantic",a)),!d&&!u)throw new L("At least one of loadBuffer and loadTypedArray must be true.");let h="";if(l&&(h+="-dequantize"),d&&(h+="-buffer",h+=`-context-${o.context.id}`),u&&(h+="-typed-array"),c(s))return`vertex-buffer:${KH(t,s,n,i)}-draco-${a}${h}`;let g=t.bufferViews[r],x=g.buffer,S=t.buffers[x],V=uI(S,x,n,i),Z=D5(g);return`vertex-buffer:${V}-range-${Z}${h}`};function xNe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Qm.getIndexBufferCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:l=!1}=e;if(C.typeOf.object("options.gltf",t),C.typeOf.number("options.accessorId",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),C.typeOf.object("options.frameState",r),!a&&!l)throw new L("At least one of loadBuffer and loadTypedArray must be true.");let d="";if(a&&(d+="-buffer",d+=`-context-${r.context.id}`),l&&(d+="-typed-array"),c(s))return`index-buffer:${KH(t,s,i,o)}-draco${d}`;let u=t.accessors[n],f=u.bufferView,p=t.bufferViews[f],y=p.buffer,h=t.buffers[y],g=uI(h,y,i,o),x=yNe(u,p);return`index-buffer:${g}-accessor-${x}${d}`};Qm.getImageCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return C.typeOf.object("options.gltf",t),C.typeOf.number("options.imageId",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),`image:${Cre(t,n,i,o)}`};Qm.getTextureCacheKey=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e;C.typeOf.object("options.gltf",t),C.typeOf.object("options.textureInfo",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),C.typeOf.object("options.supportedImageFormats",r),C.typeOf.object("options.frameState",s);let a=n.index,l=vl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),d=Cre(t,l,i,o),u=gNe(t,n);return`texture:${d}-sampler-${u}-context-${s.context.id}`};var Fl=Qm;var vyn=_(T(),1);function mI(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}mI.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};mI.prototype.addGeometryLoader=function(e){C.typeOf.object("loader",e);let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;c(n)&&(o+=n.sizeInBytes),c(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};mI.prototype.addTextureLoader=function(e){C.typeOf.object("loader",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};mI.prototype.removeLoader=function(e){C.typeOf.object("loader",e);let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],c(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],c(i)&&(this.texturesByteLength-=i)};var fI=mI;function vn(){}vn.cacheEntries={};vn.statistics=new fI;function _Ne(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}vn.get=function(e){C.typeOf.string("cacheKey",e);let t=vn.cacheEntries[e];if(c(t))return++t.referenceCount,t.resourceLoader};vn.add=function(e){C.typeOf.object("resourceLoader",e);let t=e.cacheKey;if(C.typeOf.string("options.resourceLoader.cacheKey",t),c(vn.cacheEntries[t]))throw new L(`Resource with this cacheKey is already in the cache: ${t}`);return vn.cacheEntries[t]=new _Ne(e),e};vn.unload=function(e){C.typeOf.object("resourceLoader",e);let t=e.cacheKey,n=vn.cacheEntries[t];if(!c(n))throw new L(`Resource is not in the cache: ${t}`);--n.referenceCount,n.referenceCount===0&&(vn.statistics.removeLoader(e),e.destroy(),delete vn.cacheEntries[t])};vn.getSchemaLoader=function(e){e=e??z.EMPTY_OBJECT;let{schema:t,resource:n}=e;if(c(t)===c(n))throw new L("One of options.schema and options.resource must be defined.");let i=Fl.getSchemaCacheKey({schema:t,resource:n}),o=vn.get(i);return c(o)?o:(o=new MC({schema:t,resource:n,cacheKey:i}),vn.add(o))};vn.getEmbeddedBufferLoader=function(e){e=e??z.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e;C.typeOf.object("options.parentResource",t),C.typeOf.number("options.bufferId",n);let o=Fl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=vn.get(o);return c(r)?r:(C.typeOf.object("options.typedArray",i),r=new s_({typedArray:i,cacheKey:o}),vn.add(r))};vn.getExternalBufferLoader=function(e){e=e??z.EMPTY_OBJECT;let{resource:t}=e;C.typeOf.object("options.resource",t);let n=Fl.getExternalBufferCacheKey({resource:t}),i=vn.get(n);return c(i)?i:(i=new s_({resource:t,cacheKey:n}),vn.add(i))};vn.getGltfJsonLoader=function(e){e=e??z.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e;C.typeOf.object("options.gltfResource",t),C.typeOf.object("options.baseResource",n);let r=Fl.getGltfCacheKey({gltfResource:t}),s=vn.get(r);return c(s)?s:(s=new vC({resourceCache:vn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),vn.add(s))};vn.getBufferViewLoader=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;C.typeOf.object("options.gltf",t),C.typeOf.number("options.bufferViewId",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o);let r=Fl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=vn.get(r);return c(s)?s:(s=new XC({resourceCache:vn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),vn.add(s))};vn.getDracoLoader=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e;C.typeOf.object("options.gltf",t),C.typeOf.object("options.primitive",n),C.typeOf.object("options.draco",i),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r);let s=Fl.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=vn.get(s);return c(a)?a:(a=new IC({resourceCache:vn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),vn.add(a))};vn.getVertexBufferLoader=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:d,asynchronous:u=!0,dequantize:f=!1,loadBuffer:p=!1,loadTypedArray:y=!1}=e;if(C.typeOf.object("options.gltf",t),C.typeOf.object("options.gltfResource",n),C.typeOf.object("options.baseResource",i),C.typeOf.object("options.frameState",o),!p&&!y)throw new L("At least one of loadBuffer and loadTypedArray must be true.");let h=c(r),g=c(s),x=TNe(a,l),S=c(l),V=c(d);if(h===x)throw new L("One of options.bufferViewId and options.draco must be defined.");if(x&&!S)throw new L("When options.draco is defined options.attributeSemantic must also be defined.");if(x&&!V)throw new L("When options.draco is defined options.haAccessorId must also be defined.");if(x&&!g)throw new L("When options.draco is defined options.primitive must also be defined.");x&&(C.typeOf.object("options.draco",a),C.typeOf.string("options.attributeSemantic",l),C.typeOf.number("options.accessorId",d));let Z=Fl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:l,dequantize:f,loadBuffer:p,loadTypedArray:y}),R=vn.get(Z);return c(R)?R:(R=new AC({resourceCache:vn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:d,cacheKey:Z,asynchronous:u,dequantize:f,loadBuffer:p,loadTypedArray:y}),vn.add(R))};function TNe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}vn.getIndexBufferLoader=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:l=!0,loadBuffer:d=!1,loadTypedArray:u=!1}=e;if(C.typeOf.object("options.gltf",t),C.typeOf.number("options.accessorId",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),C.typeOf.object("options.frameState",r),!d&&!u)throw new L("At least one of loadBuffer and loadTypedArray must be true.");let f=Fl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:d,loadTypedArray:u}),p=vn.get(f);return c(p)?p:(p=new wC({resourceCache:vn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:f,asynchronous:l,loadBuffer:d,loadTypedArray:u}),vn.add(p))};vn.getImageLoader=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;C.typeOf.object("options.gltf",t),C.typeOf.number("options.imageId",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o);let r=Fl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=vn.get(r);return c(s)?s:(s=new WC({resourceCache:vn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),vn.add(s))};vn.getTextureLoader=function(e){e=e??z.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e;C.typeOf.object("options.gltf",t),C.typeOf.object("options.textureInfo",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),C.typeOf.object("options.supportedImageFormats",r),C.typeOf.object("options.frameState",s);let l=Fl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),d=vn.get(l);return c(d)?d:(d=new FC({resourceCache:vn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:l,asynchronous:a}),vn.add(d))};vn.clearForSpecs=function(){let e=[AC,wC,IC,FC,WC,XC,s_,MC,vC],t,n=vn.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),l=e.indexOf(s.resourceLoader.constructor);return a-l});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,c(n[t])&&(s.resourceLoader.destroy(),delete n[t])}vn.statistics.clear()};var Ri=vn;function ha(e,t,n){C.typeOf.object("resource",e),C.typeOf.object("implicitTileset",t),C.typeOf.object("implicitCoordinates",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(ha.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}}});ha.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ha.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ha.prototype.contentIsAvailableAtIndex=function(e,t){if(t=t??0,t<0||t>=this._contentAvailabilityBitstreams.length)throw new L("contentIndex out of bounds.");return this._contentAvailabilityBitstreams[t].getBit(e)};ha.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ha.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ha.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ha.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ha.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===tr.OCTREE&&(t=3),e>>t};ha.fromSubtreeJson=async function(e,t,n,i,o){if(C.typeOf.object("resource",e),c(t)===c(n))throw new L("One of json and subtreeView must be defined.");C.typeOf.object("implicitTileset",i),C.typeOf.object("implicitCoordinates",o);let r=new ha(e,i,o),s;c(t)?s={json:t,binary:void 0}:s=SNe(n);let a=s.json;r._subtreeJson=a;let l;if(ri(a,"3DTILES_metadata"))l=a.extensions["3DTILES_metadata"];else if(c(a.tileMetadata)){let V=a.tileMetadata;l=a.propertyTables[V]}let d=[];if(c(a.contentMetadata)){let V=a.contentMetadata.length;for(let Z=0;Z<V;Z++){let R=a.contentMetadata[Z];d.push(a.propertyTables[R])}}let u,f=i.metadataSchema,p=a.subtreeMetadata;if(c(p)){let V=p.class,Z=f.classes[V];u=new BX({subtreeMetadata:p,class:Z})}r._metadata=u,r._tilePropertyTableJson=l,r._contentPropertyTableJsons=d;let y={constant:0};a.contentAvailabilityHeaders=[],ri(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??y);let h=CNe(a.buffers),g=VNe(a.bufferViews,h);LNe(a,g),c(l)&&Vre(l,g);for(let V=0;V<d.length;V++){let Z=d[V];Vre(Z,g)}let x=await ZNe(r,h,s.binary),S=GNe(g,x);return ENe(r,a,i,S),c(l)&&(XNe(r,i,S),WNe(r)),INe(r,i,S),wNe(r),r._ready=!0,r};function SNe(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=er(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function CNe(e){e=c(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=c(n.uri),n.isActive=!1}return e}function VNe(e,t){e=c(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 LNe(e,t){let n,i=e.tileAvailability;c(i.bitstream)?n=t[i.bitstream]:c(i.bufferView)&&(n=t[i.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,c(o[s].bitstream)?n=t[o[s].bitstream]:c(o[s].bufferView)&&(n=t[o[s].bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;c(r.bitstream)?n=t[r.bitstream]:c(r.bufferView)&&(n=t[r.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Vre(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;c(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let l=r.arrayOffsets??r.arrayOffsetBufferView;c(l)&&(i=t[l],i.isActive=!0,i.bufferHeader.isActive=!0)}}function ZNe(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=RNe(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];c(a)&&(r[s]=a)}return r})}async function RNe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Ri.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function GNe(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,l=t[o.buffer].subarray(r,s);n[i]=l}return n}function ENe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),l=ri(t,"3DTILES_metadata"),d=c(e._tilePropertyTableJson),u=l||d;e._tileAvailability=JH(t.tileAvailability,i,s,u);let f=e._contentPropertyTableJsons.length>0;u=u||f;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let y=JH(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(y)}e._childSubtreeAvailability=JH(t.childSubtreeAvailability,i,a)}function JH(e,t,n,i){if(c(e.constant))return new GC({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return c(e.bitstream)?o=t[e.bitstream]:c(e.bufferView)&&(o=t[e.bufferView]),new GC({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function XNe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Wu({class:a,count:o,properties:i.properties,bufferViews:n})}function INe(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 l=i[a],u=o[a].availableCount,f=l.class,p=r.classes[f],y=new Wu({class:p,count:u,properties:l.properties,bufferViews:n});s.push(y)}}function Lre(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 WNe(e){let t=Lre(e._tileAvailability);e._tileJumpBuffer=t}function wNe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Lre(o);t.push(r)}}ha.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new le("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ha.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new le("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function PNe(e,t){if(!c(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function vNe(e,t,n){let i=e._contentMetadataTables;if(!c(i))return;let o=i[n];if(!c(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ha.prototype.getTileMetadataView=function(e){let t=PNe(this,e);if(!c(t))return;let n=this._tileMetadataTable;return new EC({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ha.prototype.getContentMetadataView=function(e,t){let n=vNe(this,e,t);if(!c(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new EC({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ha.prototype.isDestroyed=function(){return!1};ha.prototype.destroy=function(){return c(this._bufferLoader)&&Ri.unload(this._bufferLoader),he(this)};var b_=ha;var pgn=_(T(),1),FNe={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"},y_=Object.freeze(FNe);var _gn=_(T(),1);var jm={};jm.parseAllBoundingVolumeSemantics=function(e){return C.typeOf.object("tileMetadata",e),{tile:{boundingVolume:jm.parseBoundingVolumeSemantic("TILE",e),minimumHeight:jm._parseMinimumHeight("TILE",e),maximumHeight:jm._parseMaximumHeight("TILE",e)},content:{boundingVolume:jm.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:jm._parseMinimumHeight("CONTENT",e),maximumHeight:jm._parseMaximumHeight("CONTENT",e)}}};jm.parseBoundingVolumeSemantic=function(e,t){if(C.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new L("prefix must be either 'TILE' or 'CONTENT'");C.typeOf.object("tileMetadata",t);let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(c(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(c(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(c(a))return{sphere:a}};jm._parseMinimumHeight=function(e,t){if(C.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new L("prefix must be either 'TILE' or 'CONTENT'");C.typeOf.object("tileMetadata",t);let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};jm._parseMaximumHeight=function(e,t){if(C.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new L("prefix must be either 'TILE' or 'CONTENT'");C.typeOf.object("tileMetadata",t);let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var g_=jm;function jc(e,t,n){C.defined("tile.implicitTileset",t.implicitTileset),C.defined("tile.implicitCoordinates",t.implicitCoordinates);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(jc.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(){throw new L("Implicit3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});jc.fromSubtreeJson=async function(e,t,n,i,o,r){if(C.defined("tile.implicitTileset",t.implicitTileset),C.defined("tile.implicitCoordinates",t.implicitCoordinates),c(i)===c(o))throw new L("One of json and arrayBuffer must be defined.");r=r??0;let s;c(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,l=t.implicitCoordinates,d=await b_.fromSubtreeJson(n,i,s,a,l),u=new jc(e,t,n);return u._implicitSubtree=d,ANe(u,d),u._ready=!0,u};function ANe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=NNe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=MNe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let l=s[a],d=l.tile,u=KNe(e,d,l.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function MNe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(c(s))for(let a=0;a<o;a++){let l=r*o+a;t.childSubtreeIsAvailableAtIndex(l)&&i.push({tile:s,childIndex:a})}}return i}function NNe(e,t,n,i){let s=Zre(e,t,n,i,0,!0),a=e._tileset.statistics,l=[s],d=[],u=e._implicitTileset;for(let f=1;f<u.subtreeLevels;f++){let p=t.getLevelOffset(f),y=u.branchingFactor*l.length;for(let h=0;h<y;h++){let g=p+h;if(!t.tileIsAvailableAtIndex(g)){d.push(void 0);continue}let x=t.getParentMortonIndex(h),S=l[x],V=h%u.branchingFactor,Z=Zre(e,t,S,V,g);S.children.push(Z),a.numberOfTilesTotal++,d.push(Z)}l=d,d=[]}return{rootTile:s,bottomRow:l}}function Rre(e,t,n){let i=y_.TILE_GEOMETRIC_ERROR;return c(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Zre(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let l,d,u;if(c(t.tilePropertyTableJson)){l=t.getTileMetadataView(a);let I=g_.parseAllBoundingVolumeSemantics(l);d=I.tile,u=I.content}let p=t.contentPropertyTableJsons.length,y=!1;for(let I=0;I<p;I++)if(t.contentIsAvailableAtCoordinates(a,I)){y=!0;break}let h=ONe(s,a,i,r,n,d),g=[];for(let I=0;I<s.contentCount;I++){if(!t.contentIsAvailableAtIndex(o,I))continue;let F={uri:s.contentUriTemplates[I].getDerivedResource({templateValues:a.getTemplateValues()}).url},N=DNe(h,u);c(N)&&(F.boundingVolume=N),g.push(St(F,s.contentHeaders[I]))}let x=Rre(l,s,a),S={boundingVolume:h,geometricError:x,refine:s.refine,contents:g},V=!0,Z=He(s.tileHeader,V);delete Z.boundingVolume,delete Z.transform,delete Z.metadata;let R=St(S,Z,V),E=Wre(e,s.baseResource,R,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=l,E.hasImplicitContentMetadata=y,E}function B5(e,t){return c(e)&&c(t)&&(c(t.minimumHeight)||c(t.maximumHeight))&&(ri(e,"3DTILES_bounding_volume_S2")||c(e.region))}function jH(e,t){c(t)&&(ri(e,"3DTILES_bounding_volume_S2")?UNe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):c(e.region)&&kNe(e.region,t.minimumHeight,t.maximumHeight))}function kNe(e,t,n){c(t)&&(e[4]=t),c(n)&&(e[5]=n)}function UNe(e,t,n){c(t)&&(e.minimumHeight=t),c(n)&&(e.maximumHeight=n)}function ONe(e,t,n,i,o,r){let s;return!c(r)||!c(r.boundingVolume)||!B5(r.boundingVolume,r)&&B5(e.boundingVolume,r)?s=Gre(e,t,n,i??!1,o):s=r.boundingVolume,jH(s,r),s}function DNe(e,t){let n;return c(t)&&(n=t.boundingVolume),B5(n,t)?jH(n,t):B5(e,t)&&(n=He(e,!0),jH(n,t)),n}function Gre(e,t,n,i,o){let r=e.boundingVolume;return ri(r,"3DTILES_bounding_volume_S2")?Ere(i,o,n,t.level,t.x,t.y,t.z):c(r.region)?{region:Ire(r.region,t.level,t.x,t.y,t.z)}:{box:Xre(r.box,t.level,t.x,t.y,t.z)}}function Ere(e,t,n,i,o,r,s){C.typeOf.bool("parentIsPlaceholderTile",e),C.typeOf.object("parentTile",t),C.typeOf.number("childIndex",n),C.typeOf.number("level",i),C.typeOf.number("x",o),C.typeOf.number("y",r),c(s)&&C.typeOf.number("z",s);let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Qp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let l=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=l%2===0?ZC.encode2D(i,o,r):ZC.encode2D(i,r,o),u=Qp.fromFacePositionLevel(l,BigInt(d),i),f,p;if(c(s)){let y=(a.maximumHeight+a.minimumHeight)/2;f=n<4?a.minimumHeight:y,p=n<4?y:a.maximumHeight}else f=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Qp.getTokenFromId(u._cellId),minimumHeight:f,maximumHeight:p}}}}var BNe=new m,YNe=new m,QH=new m,HNe=new te;function Xre(e,t,n,i,o){if(C.typeOf.object("rootBox",e),C.typeOf.number("level",t),C.typeOf.number("x",n),C.typeOf.number("y",i),c(o)&&C.typeOf.number("z",o),t===0)return e;let r=m.unpack(e,0,YNe),s=te.unpack(e,3,HNe),a=Math.pow(2,-t),l=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,f=m.fromElements(a,a,1,BNe);c(o)&&(u=-1+(2*o+1)*a,f.z=a);let p=m.fromElements(l,d,u,QH);p=te.multiplyByVector(s,p,QH),p=m.add(p,r,QH);let y=te.clone(s);y=te.multiplyByScale(y,f,y);let h=new Array(12);return m.pack(p,h),te.pack(y,h,3),h}var zNe=new de;function Ire(e,t,n,i,o){if(C.typeOf.object("rootRegion",e),C.typeOf.number("level",t),C.typeOf.number("x",n),C.typeOf.number("y",i),c(o)&&C.typeOf.number("z",o),t===0)return e.slice();let r=de.unpack(e,0,zNe),s=e[4],a=e[5],l=Math.pow(2,-t),d=l*r.width,u=w.negativePiToPi(r.west+n*d),f=w.negativePiToPi(u+d),p=l*r.height,y=w.negativePiToPi(r.south+i*p),h=w.negativePiToPi(y+p),g=s,x=a;if(c(o)){let S=l*(a-s);g+=o*S,x=g+S}return[u,y,f,h,g,x]}function KNe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=Gre(i,o,n,!1,t),s=Rre(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,l={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=Wre(e,i.baseResource,l,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function Wre(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}jc.prototype.hasProperty=function(e,t){return!1};jc.prototype.getFeature=function(e){};jc.prototype.applyDebugSettings=function(e,t){};jc.prototype.applyStyle=function(e){};jc.prototype.update=function(e,t){};jc.prototype.pick=function(e,t,n){};jc.prototype.isDestroyed=function(){return!1};jc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),he(this)};jc._deriveBoundingBox=Xre;jc._deriveBoundingRegion=Ire;jc._deriveBoundingVolumeS2=Ere;var kC=jc;var o5n=_(T(),1);var kgn=_(T(),1),JNe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Al=Object.freeze(JNe);var zNn=_(T(),1);var fxn=_(T(),1);var Ygn=_(T(),1);function UC(e,t){C.typeOf.object("normal",e),C.typeOf.number("distance",t),this._distance=t,this._normal=new wre(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(UC.prototype,{distance:{get:function(){return this._distance},set:function(e){C.typeOf.number("value",e),c(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){C.typeOf.object("value",e),c(this.onChangeCallback)&&!m.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),m.clone(e,this._normal._cartesian3)}}});UC.fromPlane=function(e,t){return C.typeOf.object("plane",e),c(t)?(t.normal=e.normal,t.distance=e.distance):t=new UC(e.normal,e.distance),t};UC.clone=function(e,t){return c(t)?(t.normal=e.normal,t.distance=e.distance,t):new UC(e.normal,e.distance)};function wre(e,t){this._clippingPlane=t,this._cartesian3=m.clone(e)}Object.defineProperties(wre.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){C.typeOf.number("value",e),c(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){C.typeOf.number("value",e),c(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){C.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var x_=UC;function hc(e){e=e??z.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=Y.clone(e.edgeColor??Y.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new ye,this.planeRemoved=new ye,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Mre:Nre,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(c(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function Mre(e){return e===zt.OUTSIDE}function Nre(e){return e===zt.INSIDE}Object.defineProperties(hc.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?Mre:Nre)}},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 Pre(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}hc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Pre(n,i)},e.index=t,Pre(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};hc.prototype.get=function(e){return C.typeOf.number("index",e),this._planes[e]};function kre(e,t){let n=e.length;for(let i=0;i<n;++i)if(cn.equals(e[i],t))return i;return-1}hc.prototype.contains=function(e){return kre(this._planes,e)!==-1};hc.prototype.remove=function(e){let t=this._planes,n=kre(t,e);if(n===-1)return!1;e instanceof x_&&(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 x_&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};hc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof x_&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var QNe=new ce,jNe=new ce;function vre(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=Fn.octEncodeToCartesian4(a.normal,jNe);i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=l.w;let d=ce.packFloat(a.distance,QNe);i[r+4]=d.x,i[r+5]=d.y,i[r+6]=d.z,i[r+7]=d.w,r+=8}}function Fre(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=a.normal;i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=a.distance,r+=4}}function Ure(e,t){let n=mt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var qNe=new D;hc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=hc.useFloatTexture(n),o=i?this.length:this.length*2;if(c(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(!c(t)){let s=Ure(o,qNe);s.y*=2,i?(t=new Pt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:en.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Pt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:en.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?(Fre(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(vre(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),Fre(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),vre(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 $Ne=new M,Are=new cn(m.UNIT_X,0);hc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;c(t)&&(o=M.multiply(t,o,$Ne));let r=zt.INSIDE;!this.unionClippingRegions&&i>0&&(r=zt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];cn.transform(a,o,Are);let l=e.intersectPlane(Are);if(l===zt.INTERSECTING)r=l;else if(this._testIntersection(l))return l}return r};hc.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new L("ClippingPlaneCollection should only be assigned to one object");e._owner=t,t[n]=e}};hc.useFloatTexture=function(e){return e.floatingPointTexture};hc.getTextureResolution=function(e,t,n){let i=e.texture;if(c(i))return n.x=i.width,n.y=i.height,n;let o=hc.useFloatTexture(t)?e.length:e.length*2,r=Ure(o,n);return r.y*=2,r};hc.prototype.isDestroyed=function(){return!1};hc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),he(this)};var hs=hc;var ETn=_(T(),1);var iTn=_(T(),1);var z_n=_(T(),1);var r_n=_(T(),1);var Ixn=_(T(),1);var pxn=_(T(),1);function ez(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Dre(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,l,d;if(i&&(r=o5e(e,t,r,n)),e.length>80*n){a=1/0,l=1/0;let u=-1/0,f=-1/0;for(let p=n;p<o;p+=n){let y=e[p],h=e[p+1];y<a&&(a=y),h<l&&(l=h),y>u&&(u=y),h>f&&(f=h)}d=Math.max(u-a,f-l),d=d!==0?32767/d:0}return pI(r,s,n,a,l,d,0),s}function Dre(e,t,n,i,o){let r;if(o===p5e(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Ore(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Ore(s/i|0,e[s],e[s+1],r);return r&&OC(r,r.next)&&(yI(r),r=r.next),r}function __(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(OC(n,n.next)||Nr(n.prev,n,n.next)===0)){if(yI(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function pI(e,t,n,i,o,r,s){if(!e)return;!s&&r&&l5e(e,i,o,r);let a=e;for(;e.prev!==e.next;){let l=e.prev,d=e.next;if(r?t5e(e,i,o,r):e5e(e)){t.push(l.i,e.i,d.i),yI(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=n5e(__(e),t),pI(e,t,n,i,o,r,2)):s===2&&i5e(e,t,n,i,o,r):pI(__(e),t,n,i,o,r,1);break}}}function e5e(e){let t=e.prev,n=e,i=e.next;if(Nr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,l=n.y,d=i.y,u=Math.min(o,r,s),f=Math.min(a,l,d),p=Math.max(o,r,s),y=Math.max(a,l,d),h=i.next;for(;h!==t;){if(h.x>=u&&h.x<=p&&h.y>=f&&h.y<=y&&hI(o,a,r,l,s,d,h.x,h.y)&&Nr(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function t5e(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Nr(o,r,s)>=0)return!1;let a=o.x,l=r.x,d=s.x,u=o.y,f=r.y,p=s.y,y=Math.min(a,l,d),h=Math.min(u,f,p),g=Math.max(a,l,d),x=Math.max(u,f,p),S=qH(y,h,t,n,i),V=qH(g,x,t,n,i),Z=e.prevZ,R=e.nextZ;for(;Z&&Z.z>=S&&R&&R.z<=V;){if(Z.x>=y&&Z.x<=g&&Z.y>=h&&Z.y<=x&&Z!==o&&Z!==s&&hI(a,u,l,f,d,p,Z.x,Z.y)&&Nr(Z.prev,Z,Z.next)>=0||(Z=Z.prevZ,R.x>=y&&R.x<=g&&R.y>=h&&R.y<=x&&R!==o&&R!==s&&hI(a,u,l,f,d,p,R.x,R.y)&&Nr(R.prev,R,R.next)>=0))return!1;R=R.nextZ}for(;Z&&Z.z>=S;){if(Z.x>=y&&Z.x<=g&&Z.y>=h&&Z.y<=x&&Z!==o&&Z!==s&&hI(a,u,l,f,d,p,Z.x,Z.y)&&Nr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.prevZ}for(;R&&R.z<=V;){if(R.x>=y&&R.x<=g&&R.y>=h&&R.y<=x&&R!==o&&R!==s&&hI(a,u,l,f,d,p,R.x,R.y)&&Nr(R.prev,R,R.next)>=0)return!1;R=R.nextZ}return!0}function n5e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!OC(i,o)&&Yre(i,n,n.next,o)&&bI(i,o)&&bI(o,i)&&(t.push(i.i,n.i,o.i),yI(n),yI(n.next),n=e=o),n=n.next}while(n!==e);return __(n)}function i5e(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&m5e(s,a)){let l=Hre(s,a);s=__(s,s.next),l=__(l,l.next),pI(s,t,n,i,o,r,0),pI(l,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function o5e(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,l=r<s-1?t[r+1]*i:e.length,d=Dre(e,a,l,i,!1);d===d.next&&(d.steiner=!0),o.push(u5e(d))}o.sort(r5e);for(let r=0;r<o.length;r++)n=s5e(o[r],n);return n}function r5e(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 s5e(e,t){let n=a5e(e,t);if(!n)return t;let i=Hre(n,e);return __(i,i.next),__(n,n.next)}function a5e(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(OC(e,n))return n;do{if(OC(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let f=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(f<=i&&f>r&&(r=f,s=n.x<n.next.x?n:n.next,f===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,l=s.x,d=s.y,u=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&Bre(o<d?i:r,o,l,d,o<d?r:i,o,n.x,n.y)){let f=Math.abs(o-n.y)/(i-n.x);bI(n,e)&&(f<u||f===u&&(n.x>s.x||n.x===s.x&&c5e(s,n)))&&(s=n,u=f)}n=n.next}while(n!==a);return s}function c5e(e,t){return Nr(e.prev,e,t.prev)<0&&Nr(t.next,e,e.next)<0}function l5e(e,t,n,i){let o=e;do o.z===0&&(o.z=qH(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,d5e(o)}function d5e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d<n&&(a++,s=s.nextZ,!!s);d++);let l=n;for(;a>0||l>0&&s;)a!==0&&(l===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,l--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function qH(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 u5e(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 Bre(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 hI(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Bre(e,t,n,i,o,r,s,a)}function m5e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!f5e(e,t)&&(bI(e,t)&&bI(t,e)&&h5e(e,t)&&(Nr(e.prev,e,t.prev)||Nr(e,t.prev,t))||OC(e,t)&&Nr(e.prev,e,e.next)>0&&Nr(t.prev,t,t.next)>0)}function Nr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function OC(e,t){return e.x===t.x&&e.y===t.y}function Yre(e,t,n,i){let o=H5(Nr(e,t,n)),r=H5(Nr(e,t,i)),s=H5(Nr(n,i,e)),a=H5(Nr(n,i,t));return!!(o!==r&&s!==a||o===0&&Y5(e,n,t)||r===0&&Y5(e,i,t)||s===0&&Y5(n,e,i)||a===0&&Y5(n,t,i))}function Y5(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 H5(e){return e>0?1:e<0?-1:0}function f5e(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&&Yre(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function bI(e,t){return Nr(e.prev,e,e.next)<0?Nr(e,t,e.next)>=0&&Nr(e,e.prev,t)>=0:Nr(e,t,e.prev)<0||Nr(e,e.next,t)<0}function h5e(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 Hre(e,t){let n=$H(e.i,e.x,e.y),i=$H(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 Ore(e,t,n,i){let o=$H(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 yI(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 $H(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function p5e(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 b5e=new m,y5e=new m,gy={};gy.computeArea2D=function(e){C.defined("positions",e),C.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);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};gy.computeWindingOrder2D=function(e){return gy.computeArea2D(e)>0?qr.COUNTER_CLOCKWISE:qr.CLOCKWISE};gy.triangulate=function(e,t){C.defined("positions",e);let n=D.packArray(e);return ez(n,t,2)};var Qre=new m,jre=new m,qre=new m,zre=new m,Kre=new m,Jre=new m,ib=new m,$re=new D,ese=new D,tse=new D,DC=new D;gy.computeSubdivision=function(e,t,n,i,o){o=o??w.RADIANS_PER_DEGREE;let r=c(i);C.typeOf.object("ellipsoid",e),C.defined("positions",t),C.defined("indices",n),C.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),C.typeOf.number.equals("indices.length % 3","0",n.length%3,0),C.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,d=new Array(l*3),u=new Array(l*2),f=0,p=0;for(a=0;a<l;a++){let Z=t[a];if(d[f++]=Z.x,d[f++]=Z.y,d[f++]=Z.z,r){let R=i[a];u[p++]=R.x,u[p++]=R.y}}let y=[],h={},g=e.maximumRadius,x=w.chordLength(o,g),S=x*x;for(;s.length>0;){let Z=s.pop(),R=s.pop(),E=s.pop(),I=m.fromArray(d,E*3,Qre),v=m.fromArray(d,R*3,jre),P=m.fromArray(d,Z*3,qre),F,N,b;r&&(F=D.fromArray(u,E*2,$re),N=D.fromArray(u,R*2,ese),b=D.fromArray(u,Z*2,tse));let G=m.multiplyByScalar(m.normalize(I,zre),g,zre),X=m.multiplyByScalar(m.normalize(v,Kre),g,Kre),W=m.multiplyByScalar(m.normalize(P,Jre),g,Jre),A=m.magnitudeSquared(m.subtract(G,X,ib)),k=m.magnitudeSquared(m.subtract(X,W,ib)),B=m.magnitudeSquared(m.subtract(W,G,ib)),O=Math.max(A,k,B),H,U,K;O>S?A===O?(H=`${Math.min(E,R)} ${Math.max(E,R)}`,a=h[H],c(a)||(U=m.add(I,v,ib),m.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,h[H]=a,r&&(K=D.add(F,N,DC),D.multiplyByScalar(K,.5,K),u.push(K.x,K.y))),s.push(E,a,Z),s.push(a,R,Z)):k===O?(H=`${Math.min(R,Z)} ${Math.max(R,Z)}`,a=h[H],c(a)||(U=m.add(v,P,ib),m.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,h[H]=a,r&&(K=D.add(N,b,DC),D.multiplyByScalar(K,.5,K),u.push(K.x,K.y))),s.push(R,a,E),s.push(a,Z,E)):B===O&&(H=`${Math.min(Z,E)} ${Math.max(Z,E)}`,a=h[H],c(a)||(U=m.add(P,I,ib),m.multiplyByScalar(U,.5,U),d.push(U.x,U.y,U.z),a=d.length/3-1,h[H]=a,r&&(K=D.add(b,F,DC),D.multiplyByScalar(K,.5,K),u.push(K.x,K.y))),s.push(Z,a,R),s.push(a,E,R)):(y.push(E),y.push(R),y.push(Z))}let V={attributes:{position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:d})},indices:y,primitiveType:ve.TRIANGLES};return r&&(V.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:u})),new dt(V)};var g5e=new pe,x5e=new pe,_5e=new pe,tz=new pe;gy.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??w.RADIANS_PER_DEGREE;let r=c(i);C.typeOf.object("ellipsoid",e),C.defined("positions",t),C.defined("indices",n),C.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),C.typeOf.number.equals("indices.length % 3","0",n.length%3,0),C.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,d=new Array(l*3),u=new Array(l*2),f=0,p=0;for(a=0;a<l;a++){let E=t[a];if(d[f++]=E.x,d[f++]=E.y,d[f++]=E.z,r){let I=i[a];u[p++]=I.x,u[p++]=I.y}}let y=[],h={},g=e.maximumRadius,x=w.chordLength(o,g),S=new va(void 0,void 0,e),V=new va(void 0,void 0,e),Z=new va(void 0,void 0,e);for(;s.length>0;){let E=s.pop(),I=s.pop(),v=s.pop(),P=m.fromArray(d,v*3,Qre),F=m.fromArray(d,I*3,jre),N=m.fromArray(d,E*3,qre),b,G,X;r&&(b=D.fromArray(u,v*2,$re),G=D.fromArray(u,I*2,ese),X=D.fromArray(u,E*2,tse));let W=e.cartesianToCartographic(P,g5e),A=e.cartesianToCartographic(F,x5e),k=e.cartesianToCartographic(N,_5e);S.setEndPoints(W,A);let B=S.surfaceDistance;V.setEndPoints(A,k);let O=V.surfaceDistance;Z.setEndPoints(k,W);let H=Z.surfaceDistance,U=Math.max(B,O,H),K,Q,ie,j,$;U>x?B===U?(K=`${Math.min(v,I)} ${Math.max(v,I)}`,a=h[K],c(a)||(Q=S.interpolateUsingFraction(.5,tz),ie=(W.height+A.height)*.5,j=m.fromRadians(Q.longitude,Q.latitude,ie,e,ib),d.push(j.x,j.y,j.z),a=d.length/3-1,h[K]=a,r&&($=D.add(b,G,DC),D.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(v,a,E),s.push(a,I,E)):O===U?(K=`${Math.min(I,E)} ${Math.max(I,E)}`,a=h[K],c(a)||(Q=V.interpolateUsingFraction(.5,tz),ie=(A.height+k.height)*.5,j=m.fromRadians(Q.longitude,Q.latitude,ie,e,ib),d.push(j.x,j.y,j.z),a=d.length/3-1,h[K]=a,r&&($=D.add(G,X,DC),D.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(I,a,v),s.push(a,E,v)):H===U&&(K=`${Math.min(E,v)} ${Math.max(E,v)}`,a=h[K],c(a)||(Q=Z.interpolateUsingFraction(.5,tz),ie=(k.height+W.height)*.5,j=m.fromRadians(Q.longitude,Q.latitude,ie,e,ib),d.push(j.x,j.y,j.z),a=d.length/3-1,h[K]=a,r&&($=D.add(X,b,DC),D.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(E,a,I),s.push(a,v,I)):(y.push(v),y.push(I),y.push(E))}let R={attributes:{position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:d})},indices:y,primitiveType:ve.TRIANGLES};return r&&(R.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:u})),new dt(R)};gy.scaleToGeodeticHeight=function(e,t,n,i){n=n??re.default;let o=b5e,r=y5e;if(t=t??0,i=i??!0,c(e)){let s=e.length;for(let a=0;a<s;a+=3)m.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),m.multiplyByScalar(o,t,o),m.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var ai=gy;var wxn=_(T(),1);function xy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(xy.prototype,{length:{get:function(){return this._length}}});xy.prototype.enqueue=function(e){this._array.push(e),this._length++};xy.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};xy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};xy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};xy.prototype.clear=function(){this._array.length=this._offset=this._length=0};xy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var _y=xy;var nr={};nr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!c(o))continue;n+=2;let r=o.positions,s=o.holes;if(c(r)&&r.length>0&&(n+=r.length*t.packedLength),c(s)){let a=s.length;for(let l=0;l<a;++l)i.push(s[l])}}return n};nr.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!c(r))continue;let s=r.positions,a=r.holes;if(t[n++]=c(s)?s.length:0,t[n++]=c(a)?a.length:0,c(s)){let l=s.length;for(let d=0;d<l;++d,n+=i.packedLength)i.pack(s[d],t,n)}if(c(a)){let l=a.length;for(let d=0;d<l;++d)o.push(a[d])}}return n};nr.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]=nr.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var T_=new D;function ose(e,t,n,i){return D.subtract(t,e,T_),D.multiplyByScalar(T_,n/i,T_),D.add(e,T_,T_),[T_.x,T_.y]}var Ty=new m;function T5e(e,t,n,i){return m.subtract(t,e,Ty),m.multiplyByScalar(Ty,n/i,Ty),m.add(e,Ty,Ty),[Ty.x,Ty.y,Ty.z]}nr.subdivideLineCount=function(e,t,n){let o=m.distance(e,t)/n,r=Math.max(0,Math.ceil(w.log2(o)));return Math.pow(2,r)};var K5=new pe,J5=new pe,S5e=new pe,C5e=new m,z5=new va;nr.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,K5),r=e.cartesianToCartographic(n,J5),a=new va(o,r,e).surfaceDistance/i,l=Math.max(0,Math.ceil(w.log2(a)));return Math.pow(2,l)};nr.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=nr.subdivideLineCount(n,i,o),a=D.distance(e,t),l=a/s,d=r;d.length=s*2;let u=0;for(let f=0;f<s;f++){let p=ose(e,t,f*l,a);d[u++]=p[0],d[u++]=p[1]}return d};nr.subdivideLine=function(e,t,n,i){let o=nr.subdivideLineCount(e,t,n),r=m.distance(e,t),s=r/o;c(i)||(i=[]);let a=i;a.length=o*3;let l=0;for(let d=0;d<o;d++){let u=T5e(e,t,d*s,r);a[l++]=u[0],a[l++]=u[1],a[l++]=u[2]}return a};nr.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,K5),l=n.cartesianToCartographic(o,J5);z5.setEndPoints(a,l);let d=z5.surfaceDistance/r,u=Math.max(0,Math.ceil(w.log2(d))),f=Math.pow(2,u),p=D.distance(e,t),y=p/f,h=s;h.length=f*2;let g=0;for(let x=0;x<f;x++){let S=ose(e,t,x*y,p);h[g++]=S[0],h[g++]=S[1]}return h};nr.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,K5),s=e.cartesianToCartographic(n,J5),a=new va(r,s,e);if(c(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let l=a.surfaceDistance/i,d=Math.max(0,Math.ceil(w.log2(l))),u=Math.pow(2,d),f=a.surfaceDistance/u,p=o;p.length=u*3;let y=0;for(let h=0;h<u;h++){let g=a.interpolateUsingSurfaceDistance(h*f,S5e),x=e.cartographicToCartesian(g,C5e);p[y++]=x.x,p[y++]=x.y,p[y++]=x.z}return p};var V5e=new m,L5e=new m,Z5e=new m,R5e=new m;nr.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??re.default;let r=V5e,s=L5e,a=Z5e,l=R5e;if(c(e)&&c(e.attributes)&&c(e.attributes.position)){let d=e.attributes.position.values,u=d.length/2;for(let f=0;f<u;f+=3)m.fromArray(d,f,a),i.geodeticSurfaceNormal(a,r),l=i.scaleToGeodeticSurface(a,l),s=m.multiplyByScalar(r,n,s),s=m.add(l,s,s),d[f+u]=s.x,d[f+1+u]=s.y,d[f+2+u]=s.z,o&&(l=m.clone(a,l)),s=m.multiplyByScalar(r,t,s),s=m.add(l,s,s),d[f]=s.x,d[f+1]=s.y,d[f+2]=s.z}return e};nr.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new _y;o.enqueue(e);let r,s,a;for(;o.length!==0;){let l=o.dequeue(),d=l.positions;if(t)for(a=d.length,r=0;r<a;r++)n.scaleToGeodeticSurface(d[r],d[r]);if(d=xo(d,m.equalsEpsilon,!0),d.length<3)continue;let u=l.holes?l.holes.length:0;for(r=0;r<u;r++){let f=l.holes[r],p=f.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=xo(p,m.equalsEpsilon,!0),p.length<3)continue;i.push(p);let y=0;for(c(f.holes)&&(y=f.holes.length),s=0;s<y;s++)o.enqueue(f.holes[s])}i.push(d)}return i};var G5e=new pe;function E5e(e,t,n){let i=n.cartesianToCartographic(e,K5),o=n.cartesianToCartographic(t,J5);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;z5.setEndPoints(i,o);let r=z5.findIntersectionWithLatitude(0,G5e);if(!c(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>w.PI){let l=s;s=a,a=l}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function X5e(e,t,n,i){if(i===Kt.RHUMB)return E5e(e,t,n);let o=qn.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(c(o))return n.scaleToGeodeticSurface(o,o)}var I5e=new pe;function W5e(e,t,n){let i=[],o,r,s,a,l,d=0;for(;d<e.length;){o=e[d],r=e[(d+1)%e.length],s=w.sign(o.z),a=w.sign(r.z);let u=f=>t.cartesianToCartographic(f,I5e).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(l=X5e(o,r,t,n),++d,!c(l))continue;e.splice(d,0,l),i.push({position:d,type:s,visited:!1,next:a,theta:u(l)})}++d}return i}function rse(e,t,n,i,o,r,s){let a=[],l=r,d=f=>p=>p.position===f,u=[];do{let f=n[l];a.push(f);let p=i.findIndex(d(l)),y=i[p];if(!c(y)){++l;continue}let{visited:h,type:g,next:x}=y;if(y.visited=!0,g===0){if(x===0){let R=i[p-(s?1:-1)];if(R?.position===l+1)R.visited=!0;else{++l;continue}}if(!h&&s&&x>0||r===l&&!s&&x<0){++l;continue}}if(!(s?g>=0:g<=0)){++l;continue}h||u.push(l);let V=p+(s?1:-1),Z=i[V];if(!c(Z)){++l;continue}l=Z.position}while(l<n.length&&l>=0&&l!==r&&a.length<n.length);e.splice(t,o,a);for(let f of u)t=rse(e,++t,n,i,0,f,!s);return t}nr.splitPolygonsOnEquator=function(e,t,n,i){c(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=W5e(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((d,u)=>d.theta-u.theta);let l=s[0].z>=0;o=rse(i,o,s,a,1,0,l)}return i};nr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],l=new _y;l.enqueue(e);let d=c(r);for(;l.length!==0;){let u=l.dequeue(),f=u.positions,p=u.holes,y,h;if(i)for(h=f.length,y=0;y<h;y++)o.scaleToGeodeticSurface(f[y],f[y]);if(t||(f=xo(f,m.equalsEpsilon,!0)),f.length<3)continue;let g=n(f);if(!c(g))continue;let x=[],S=ai.computeWindingOrder2D(g);if(S===qr.CLOCKWISE&&(g.reverse(),f=f.slice().reverse()),d){d=!1;let I=[f];if(I=r(I,I),I.length>1){for(let v of I)l.enqueue(new Fa(v,p));continue}}let V=f.slice(),Z=c(p)?p.length:0,R=[],E;for(y=0;y<Z;y++){let I=p[y],v=I.positions;if(i)for(h=v.length,E=0;E<h;++E)o.scaleToGeodeticSurface(v[E],v[E]);if(t||(v=xo(v,m.equalsEpsilon,!0)),v.length<3)continue;let P=n(v);if(!c(P))continue;S=ai.computeWindingOrder2D(P),S===qr.CLOCKWISE&&(P.reverse(),v=v.slice().reverse()),R.push(v),x.push(V.length),V=V.concat(v),g=g.concat(P);let F=0;for(c(I.holes)&&(F=I.holes.length),E=0;E<F;E++)l.enqueue(I.holes[E])}s.push({outerRing:f,holes:R}),a.push({positions:V,positions2D:g,holes:x})}return{hierarchy:s,polygons:a}};var w5e=new D,P5e=new m,v5e=new Fe,F5e=new te;nr.computeBoundingRectangle=function(e,t,n,i,o){let r=Fe.fromAxisAngle(e,i,v5e),s=te.fromQuaternion(r,F5e),a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,f=n.length;for(let p=0;p<f;++p){let y=m.clone(n[p],P5e);te.multiplyByVector(s,y,y);let h=t(y,w5e);c(h)&&(a=Math.min(a,h.x),l=Math.max(l,h.x),d=Math.min(d,h.y),u=Math.max(u,h.y))}return o.x=a,o.y=d,o.width=l-a,o.height=u-d,o};nr.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=ai.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let l=t.positions,d=c(n),u=d?n.positions:void 0;if(o){let f=l.length,p=new Array(f*3),y=0;for(let x=0;x<f;x++){let S=l[x];p[y++]=S.x,p[y++]=S.y,p[y++]=S.z}let h={attributes:{position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:ve.TRIANGLES};d&&(h.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:D.packArray(u)}));let g=new dt(h);return r.normal?An.computeNormal(g):g}if(s===Kt.GEODESIC)return ai.computeSubdivision(e,l,a,u,i);if(s===Kt.RHUMB)return ai.computeRhumbLineSubdivision(e,l,a,u,i)};var nse=[],ise=[],A5e=new m,M5e=new m;nr.computeWallGeometry=function(e,t,n,i,o,r){let s,a,l,d,u,f,p,y,h,g=e.length,x=0,S=0,V=c(t),Z=V?t.positions:void 0;if(o)for(a=g*3*2,s=new Array(a*2),V&&(h=g*2*2,y=new Array(h*2)),l=0;l<g;l++)d=e[l],u=e[(l+1)%g],s[x]=s[x+a]=d.x,++x,s[x]=s[x+a]=d.y,++x,s[x]=s[x+a]=d.z,++x,s[x]=s[x+a]=u.x,++x,s[x]=s[x+a]=u.y,++x,s[x]=s[x+a]=u.z,++x,V&&(f=Z[l],p=Z[(l+1)%g],y[S]=y[S+h]=f.x,++S,y[S]=y[S+h]=f.y,++S,y[S]=y[S+h]=p.x,++S,y[S]=y[S+h]=p.y,++S);else{let P=w.chordLength(i,n.maximumRadius),F=0;if(r===Kt.GEODESIC)for(l=0;l<g;l++)F+=nr.subdivideLineCount(e[l],e[(l+1)%g],P);else if(r===Kt.RHUMB)for(l=0;l<g;l++)F+=nr.subdivideRhumbLineCount(n,e[l],e[(l+1)%g],P);for(a=(F+g)*3,s=new Array(a*2),V&&(h=(F+g)*2,y=new Array(h*2)),l=0;l<g;l++){d=e[l],u=e[(l+1)%g];let N,b;V&&(f=Z[l],p=Z[(l+1)%g]),r===Kt.GEODESIC?(N=nr.subdivideLine(d,u,P,ise),V&&(b=nr.subdivideTexcoordLine(f,p,d,u,P,nse))):r===Kt.RHUMB&&(N=nr.subdivideRhumbLine(n,d,u,P,ise),V&&(b=nr.subdivideTexcoordRhumbLine(f,p,n,d,u,P,nse)));let G=N.length;for(let X=0;X<G;++X,++x)s[x]=N[X],s[x+a]=N[X];if(s[x]=u.x,s[x+a]=u.x,++x,s[x]=u.y,s[x+a]=u.y,++x,s[x]=u.z,s[x+a]=u.z,++x,V){let X=b.length;for(let W=0;W<X;++W,++S)y[S]=b[W],y[S+h]=b[W];y[S]=p.x,y[S+h]=p.x,++S,y[S]=p.y,y[S+h]=p.y,++S}}}g=s.length;let R=Me.createTypedArray(g/3,g-e.length*6),E=0;for(g/=6,l=0;l<g;l++){let P=l,F=P+1,N=P+g,b=N+1;d=m.fromArray(s,P*3,A5e),u=m.fromArray(s,F*3,M5e),!m.equalsEpsilon(d,u,w.EPSILON10,w.EPSILON10)&&(R[E++]=P,R[E++]=N,R[E++]=F,R[E++]=F,R[E++]=N,R[E++]=b)}let I={attributes:new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:R,primitiveType:ve.TRIANGLES};return V&&(I.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:y})),new dt(I)};var Dn=nr;var y_n=_(T(),1);function kr(e,t){this.position=e,c(this.position)||(this.position=new D),this.tangentPlane=t,c(this.tangentPlane)||(this.tangentPlane=kr.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(kr.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=D.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(w.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=w.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=w.TWO_PI),e}}});var BC=new pe,N5e=new m;kr.prototype.getLatitude=function(e){c(e)||(e=re.default),BC.latitude=this.conformalLatitude,BC.longitude=this.longitude,BC.height=0;let t=this.ellipsoid.cartographicToCartesian(BC,N5e);return e.cartesianToCartographic(t,BC),BC.latitude};var k5e=new bn,U5e=new m,O5e=new m;kr.fromCartesian=function(e,t){C.defined("cartesian",e);let n=w.signNotZero(e.z),i=kr.NORTH_POLE_TANGENT_PLANE,o=kr.SOUTH_POLE;n<0&&(i=kr.SOUTH_POLE_TANGENT_PLANE,o=kr.NORTH_POLE);let r=k5e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=m.subtract(r.origin,o,U5e),m.normalize(r.direction,r.direction);let s=qn.rayPlane(r,i.plane,O5e),a=m.subtract(s,o,s),l=m.dot(i.xAxis,a),d=n*m.dot(i.yAxis,a);return c(t)?(t.position=new D(l,d),t.tangentPlane=i,t):new kr(new D(l,d),i)};kr.fromCartesianArray=function(e,t){C.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=kr.fromCartesian(e[i],t[i]);return t};kr.clone=function(e,t){if(c(e))return c(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new kr(e.position,e.tangentPlane)};kr.HALF_UNIT_SPHERE=Object.freeze(new re(.5,.5,.5));kr.NORTH_POLE=Object.freeze(new m(0,0,.5));kr.SOUTH_POLE=Object.freeze(new m(0,0,-.5));kr.NORTH_POLE_TANGENT_PLANE=Object.freeze(new $r(kr.NORTH_POLE,kr.HALF_UNIT_SPHERE));kr.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new $r(kr.SOUTH_POLE,kr.HALF_UNIT_SPHERE));var pc=kr;var D5e=new pe,sse=new pe;function B5e(e,t,n,i){let r=i.cartesianToCartographic(e,D5e).height,s=i.cartesianToCartographic(t,sse);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,sse);a.height=r-100,i.cartographicToCartesian(a,n)}var ase=new je,Y5e=new m,H5e=new m,z5e=new m,K5e=new m,J5e=new m,Q5e=new m,Q5=new m,Sh=new m,YC=new m,j5e=new D,q5e=new D,$5e=new m,cse=new Fe,eke=new te,tke=new te;function nz(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=c(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,l=e.top||a,d=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let u=e.boundingRectangle,f=e.rotationAxis,p=e.projectTo2d,y=e.ellipsoid,h=e.stRotation,g=e.perPositionHeight,x=j5e;x.x=u.x,x.y=u.y;let S=t.st?new Float32Array(2*(s/3)):void 0,V;t.normal&&(g&&l&&!a?V=n.attributes.normal.values:V=new Float32Array(s));let Z=t.tangent?new Float32Array(s):void 0,R=t.bitangent?new Float32Array(s):void 0,E=i?new Float32Array(s):void 0,I=0,v=0,P=H5e,F=z5e,N=K5e,b=!0,G=eke,X=tke;if(h!==0){let k=Fe.fromAxisAngle(f,h,cse);G=te.fromQuaternion(k,G),k=Fe.fromAxisAngle(f,-h,cse),X=te.fromQuaternion(k,X)}else G=te.clone(te.IDENTITY,G),X=te.clone(te.IDENTITY,X);let W=0,A=0;l&&d&&(W=s/2,A=s/3,s/=2);for(let k=0;k<s;k+=3){let B=m.fromArray(o,k,$5e);if(t.st&&!c(r)){let O=te.multiplyByVector(G,B,Y5e);O=y.scaleToGeodeticSurface(O,O);let H=p([O],q5e)[0];D.subtract(H,x,H);let U=w.clamp(H.x/u.width,0,1),K=w.clamp(H.y/u.height,0,1);d&&(S[I+A]=U,S[I+1+A]=K),l&&(S[I]=U,S[I+1]=K),I+=2}if(t.normal||t.tangent||t.bitangent||i){let O=v+1,H=v+2;if(a){if(k+3<s){let U=m.fromArray(o,k+3,J5e);if(b){let K=m.fromArray(o,k+s,Q5e);g&&B5e(B,U,K,y),m.subtract(U,B,U),m.subtract(K,B,K),P=m.normalize(m.cross(K,U,P),P),b=!1}m.equalsEpsilon(U,B,w.EPSILON10)&&(b=!0)}(t.tangent||t.bitangent)&&(N=y.geodeticSurfaceNormal(B,N),t.tangent&&(F=m.normalize(m.cross(N,P,F),F)))}else P=y.geodeticSurfaceNormal(B,P),(t.tangent||t.bitangent)&&(g&&(Q5=m.fromArray(V,v,Q5),Sh=m.cross(m.UNIT_Z,Q5,Sh),Sh=m.normalize(te.multiplyByVector(X,Sh,Sh),Sh),t.bitangent&&(YC=m.normalize(m.cross(Q5,Sh,YC),YC))),F=m.cross(m.UNIT_Z,P,F),F=m.normalize(te.multiplyByVector(X,F,F),F),t.bitangent&&(N=m.normalize(m.cross(P,F,N),N)));t.normal&&(e.wall?(V[v+W]=P.x,V[O+W]=P.y,V[H+W]=P.z):d&&(V[v+W]=-P.x,V[O+W]=-P.y,V[H+W]=-P.z),(l&&!g||a)&&(V[v]=P.x,V[O]=P.y,V[H]=P.z)),i&&(a&&(P=y.geodeticSurfaceNormal(B,P)),E[v+W]=-P.x,E[O+W]=-P.y,E[H+W]=-P.z),t.tangent&&(e.wall?(Z[v+W]=F.x,Z[O+W]=F.y,Z[H+W]=F.z):d&&(Z[v+W]=-F.x,Z[O+W]=-F.y,Z[H+W]=-F.z),l&&(g?(Z[v]=Sh.x,Z[O]=Sh.y,Z[H]=Sh.z):(Z[v]=F.x,Z[O]=F.y,Z[H]=F.z))),t.bitangent&&(d&&(R[v+W]=N.x,R[O+W]=N.y,R[H+W]=N.z),l&&(g?(R[v]=YC.x,R[O]=YC.y,R[H]=YC.z):(R[v]=N.x,R[O]=N.y,R[H]=N.z))),v+=3}}t.st&&!c(r)&&(n.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:S})),t.normal&&(n.attributes.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:V})),t.tangent&&(n.attributes.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:Z})),t.bitangent&&(n.attributes.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:R})),i&&(n.attributes.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:E}))}if(e.extrude&&c(e.offsetAttribute)){let u=o.length/3,f=new Uint8Array(u);if(e.offsetAttribute===$t.TOP)l&&d||a?f=f.fill(1,0,u/2):l&&(f=f.fill(1));else{let p=e.offsetAttribute===$t.NONE?0:1;f=f.fill(p)}n.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return n}var lse=[];function nke(e,t,n,i,o,r,s,a,l,d){let u={walls:[]},f;if(s||a){let V=Dn.createGeometryFromPositions(e,t,n,i,r,l,d),Z=V.attributes.position.values,R=V.indices,E,I;if(s&&a){let v=Z.concat(Z);E=v.length/3,I=Me.createTypedArray(E,R.length*2),I.set(R);let P=R.length,F=E/2;for(f=0;f<P;f+=3){let N=I[f]+F,b=I[f+1]+F,G=I[f+2]+F;I[f+P]=G,I[f+1+P]=b,I[f+2+P]=N}if(V.attributes.position.values=v,r&&l.normal){let N=V.attributes.normal.values;V.attributes.normal.values=new Float32Array(v.length),V.attributes.normal.values.set(N)}if(l.st&&c(n)){let N=V.attributes.st.values;V.attributes.st.values=new Float32Array(E*2),V.attributes.st.values=N.concat(N)}V.indices=I}else if(a){for(E=Z.length/3,I=Me.createTypedArray(E,R.length),f=0;f<R.length;f+=3)I[f]=R[f+2],I[f+1]=R[f+1],I[f+2]=R[f];V.indices=I}u.topAndBottom=new Rt({geometry:V})}let p=o.outerRing,y=$r.fromPoints(p,e),h=y.projectPointsOntoPlane(p,lse),g=ai.computeWindingOrder2D(h);g===qr.CLOCKWISE&&(p=p.slice().reverse());let x=Dn.computeWallGeometry(p,n,e,i,r,d);u.walls.push(new Rt({geometry:x}));let S=o.holes;for(f=0;f<S.length;f++){let V=S[f];h=y.projectPointsOntoPlane(V,lse),g=ai.computeWindingOrder2D(h),g===qr.COUNTER_CLOCKWISE&&(V=V.slice().reverse()),x=Dn.computeWallGeometry(V,n,e,i,r,d),u.walls.push(new Rt({geometry:x}))}return u}function vu(e){if(C.typeOf.object("options",e),C.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),c(e.perPositionHeight)&&e.perPositionHeight&&c(e.height))throw new L("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==Kt.GEODESIC&&e.arcType!==Kt.RHUMB)throw new L("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.vertexFormat??We.DEFAULT,i=e.ellipsoid??re.default,o=e.granularity??w.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,l=a&&c(e.extrudedHeight),d=e.height??0,u=e.extrudedHeight??d;if(!l){let f=Math.max(d,u);u=Math.min(d,u),d=f}this._vertexFormat=We.clone(n),this._ellipsoid=re.clone(i),this._granularity=o,this._stRotation=r,this._height=d,this._extrudedHeight=u,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=l,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??Kt.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Dn.computeHierarchyPackedLength(t,m)+re.packedLength+We.packedLength+(s?Dn.computeHierarchyPackedLength(s,D):1)+12}vu.fromPositions=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.positions",e.positions);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 vu(t)};vu.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,c(e._textureCoordinates)?n=Dn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var ike=re.clone(re.UNIT_SPHERE),oke=new We,rke={polygonHierarchy:{}};vu.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=Dn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,ike);t+=re.packedLength;let r=We.unpack(e,t,oke);t+=We.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++]===1,f=e[t++]===1,p=e[t++]===1,y=e[t++]===1,h=e[t++]===1,g=e[t++],x=e[t++],S=e[t]===-1?void 0:Dn.unpackPolygonHierarchy(e,t,D);c(S)?(t=S.startingIndex,delete S.startingIndex):t++;let V=e[t++];return c(n)||(n=new vu(rke)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=l,n._stRotation=d,n._perPositionHeightExtrude=u,n._perPositionHeight=f,n._closeTop=p,n._closeBottom=y,n._shadowVolume=h,n._offsetAttribute=g===-1?void 0:g,n._arcType=x,n._textureCoordinates=S,n.packedLength=V,n};var ske=new D,ake=new D,cke=new pc;function dse(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+w.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 l=e.getLatitude(n),d=l;if(r.south=Math.min(r.south,l),r.north=Math.max(r.north,l),i!==Kt.RHUMB){let p=D.subtract(t.position,e.position,ske),y=D.dot(t.position,p)/D.dot(p,p);if(y>0&&y<1){let h=D.add(t.position,D.multiplyByScalar(p,-y,p),ake),g=pc.clone(t,cke);g.position=h;let x=g.getLatitude(n);r.south=Math.min(r.south,x),r.north=Math.max(r.north,x),Math.abs(l)>Math.abs(x)&&(d=x)}}let u=t.x*e.y-e.x*t.y,f=Math.sign(u);f!==0&&(f*=D.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=f),d<=0&&(o.southAngle+=f)}var use=new pc,lke=new pc,Pu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};vu.computeRectangleFromPositions=function(e,t,n,i){if(C.defined("positions",e),c(i)||(i=new de),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Pu.northAngle=0,Pu.southAngle=0,Pu.westOverIdl=Number.POSITIVE_INFINITY,Pu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=pc.fromCartesian(e[0],lke);for(let s=1;s<o;s++){let a=pc.fromCartesian(e[s],use);dse(a,r,t,n,Pu,i),r=pc.clone(a,r)}return dse(pc.fromCartesian(e[0],use),r,t,n,Pu,i),i.east-i.west>Pu.eastOverIdl-Pu.westOverIdl&&(i.west=Pu.westOverIdl,i.east=Pu.eastOverIdl,i.east>w.PI&&(i.east=i.east-w.TWO_PI),i.west>w.PI&&(i.west=i.west-w.TWO_PI)),w.equalsEpsilon(Math.abs(Pu.northAngle),w.TWO_PI,w.EPSILON10)&&(i.north=w.PI_OVER_TWO,i.east=w.PI,i.west=-w.PI),w.equalsEpsilon(Math.abs(Pu.southAngle),w.TWO_PI,w.EPSILON10)&&(i.south=-w.PI_OVER_TWO,i.east=w.PI,i.west=-w.PI),i};var dke=new pc;function uke(e,t,n){return e.height>=w.PI||e.width>=w.PI?pc.fromCartesian(t[0],dke).tangentPlane:$r.fromPoints(t,n)}var mse=new pe;function mke(e,t,n){return(i,o)=>{if(e.height>=w.PI||e.width>=w.PI){if(e.south<0&&e.north>0){c(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],mse);o[s]=new D(a.longitude/w.PI,a.latitude/w.PI_OVER_TWO)}return o.length=i.length,o}return pc.fromCartesianArray(i,o)}return $r.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function fke(e,t,n){if(e.height>=w.PI||e.width>=w.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,mse);return c(r)||(r=new D),r.x=s.longitude/w.PI,r.y=s.latitude/w.PI_OVER_TWO,r}return pc.fromCartesian(o,r)};let i=$r.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function hke(e,t,n,i){return(o,r)=>!i&&(e.height>=w.PI_OVER_TWO||e.width>=2*w.PI_OVER_THREE)?Dn.splitPolygonsOnEquator(o,t,n,r):o}function pke(e,t,n,i){if(t.height>=w.PI||t.width>=w.PI)return je.fromRectangle(t,void 0,ase);let o=e,r=$r.fromPoints(o,n);return Dn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,ase)}vu.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,l=e._closeBottom,d=e._arcType,u=e._textureCoordinates,f=c(u),p=r.positions;if(p.length<3)return;let y=e.rectangle,h=Dn.polygonsFromHierarchy(r,f,mke(y,p,n),!s,n,hke(y,n,d,s)),g=h.hierarchy,x=h.polygons,S=function(W){return W},V=f?Dn.polygonsFromHierarchy(u,!0,S,!1,n).polygons:void 0;if(g.length===0)return;let Z=g[0].outerRing,R=pke(Z,y,n,o),E=[],I=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!w.equalsEpsilon(I,v,0,w.EPSILON2),F={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:uke(y,Z,n).plane.normal,projectTo2d:fke(y,Z,n),boundingRectangle:R,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},N;if(P)for(F.extrude=!0,F.top=a,F.bottom=l,F.shadowVolume=e._shadowVolume,F.offsetAttribute=e._offsetAttribute,N=0;N<x.length;N++){let W=nke(n,x[N],f?V[N]:void 0,i,g[N],s,a,l,t,d),A;a&&l?(A=W.topAndBottom,F.geometry=Dn.scaleToGeodeticHeightExtruded(A.geometry,I,v,n,s)):a?(A=W.topAndBottom,A.geometry.attributes.position.values=ai.scaleToGeodeticHeight(A.geometry.attributes.position.values,I,n,!s),F.geometry=A.geometry):l&&(A=W.topAndBottom,A.geometry.attributes.position.values=ai.scaleToGeodeticHeight(A.geometry.attributes.position.values,v,n,!0),F.geometry=A.geometry),(a||l)&&(F.wall=!1,A.geometry=nz(F),E.push(A));let k=W.walls;F.wall=!0;for(let B=0;B<k.length;B++){let O=k[B];F.geometry=Dn.scaleToGeodeticHeightExtruded(O.geometry,I,v,n,s),O.geometry=nz(F),E.push(O)}}else for(N=0;N<x.length;N++){let W=new Rt({geometry:Dn.createGeometryFromPositions(n,x[N],f?V[N]:void 0,i,s,t,d)});if(W.geometry.attributes.position.values=ai.scaleToGeodeticHeight(W.geometry.attributes.position.values,I,n,!s),F.geometry=W.geometry,W.geometry=nz(F),c(e._offsetAttribute)){let A=W.geometry.attributes.position.values.length,k=e._offsetAttribute===$t.NONE?0:1,B=new Uint8Array(A/3).fill(k);W.geometry.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}E.push(W)}let b=An.combineInstances(E)[0];b.attributes.position.values=new Float64Array(b.attributes.position.values),b.indices=Me.createTypedArray(b.attributes.position.values.length/3,b.indices);let G=b.attributes,X=ue.fromVertices(G.position.values);return t.position||delete G.position,new dt({attributes:G,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:X,offsetAttribute:e._offsetAttribute})};vu.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new vu({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function bke(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 dt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(vu.prototype,{rectangle:{get:function(){if(!c(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=vu.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=bke(this)),this._textureCoordinateRotationPoints}}});var ob=vu;function S_(e){C.typeOf.object("options",e),C.typeOf.object("options.positions",e.positions),C.typeOf.number.greaterThanOrEquals("options.positions.length",e.positions.length,3),this._ellipsoid=e.ellipsoid??re.default,this._positions=[...e.positions]}Object.defineProperties(S_.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});S_.clone=function(e,t){return C.typeOf.object("polygon",e),c(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new S_({positions:e.positions,ellipsoid:e.ellipsoid})};S_.equals=function(e,t){return C.typeOf.object("left",e),C.typeOf.object("right",t),e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};S_.prototype.computeRectangle=function(e){return ob.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var yke=new de,fse=new m;S_.prototype.computeSphericalExtents=function(e){c(e)||(e=new de);let t=this.computeRectangle(yke),n=pe.toCartesian(de.southwest(t),this.ellipsoid,fse),i=Math.sqrt(n.x*n.x+n.y*n.y),o=w.fastApproximateAtan2(i,n.z),r=w.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=pe.toCartesian(de.northeast(t),this.ellipsoid,fse),i=Math.sqrt(n.x*n.x+n.y*n.y),o=w.fastApproximateAtan2(i,n.z),r=w.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var HC=S_;var rTn=_(T(),1),gI=`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;
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);
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;
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;
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);
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;
}
}
vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
out_FragColor = min(out_FragColor, result);
}
lastPolygonIndex += positionsLength;
}
}
`;function ts(e){e=e??z.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new ye,this.polygonRemoved=new ye,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(c(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(ts.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}}});ts.prototype.add=function(e){C.typeOf.object("polygon",e);let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};ts.prototype.get=function(e){return C.typeOf.number("index",e),this._polygons[e]};ts.prototype.contains=function(e){return C.typeOf.object("polygon",e),this._polygons.some(t=>HC.equals(t,e))};ts.prototype.remove=function(e){C.typeOf.object("polygon",e);let t=this._polygons,n=t.findIndex(i=>HC.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var gke=new de;function xke(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),l=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=de.clone(a);u.south-=l,u.west-=d,u.north+=l,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI);let f=[r];for(let p=0;p<t.length;++p){let y=t[p];if(c(y)&&c(de.simpleIntersection(y,u))&&!de.equals(y,u)){let h=n[p];f.push(...h),h.reduce((g,x)=>de.union(e[x].computeSphericalExtents(gke),g,g),a),t[p]=void 0,n[p]=void 0,l=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=de.clone(a,u),u.south-=l,u.west-=d,u.north+=l,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(f)}let o=new Map;return n.filter(c).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(c),extentsIndexByPolygon:o}}ts.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 _ke(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=xke(i),s=0;for(let[l,d]of i.entries()){let u=d.length;t[s++]=u,t[s++]=r.get(l);for(let f=0;f<u;++f){let p=d.positions[f],y=Math.hypot(p.x,p.y),h=w.fastApproximateAtan2(y,p.z),g=w.fastApproximateAtan2(p.x,p.y);t[s++]=h,t[s++]=g}}let a=0;for(let l of o){let d=1/(l.east-l.west),u=1/(l.north-l.south);n[a++]=l.south,n[a++]=l.west,n[a++]=u,n[a++]=d}e._extentsCount=o.length}var iz=new D;ts.prototype.update=function(e){let t=e.context;if(!ts.isSupported(e))throw new le("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;c(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(c(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!c(i)){let s=ts.getTextureResolution(i,this.pixelsNeededForPolygonPositions,iz);i=new Pt({context:t,width:s.x,height:s.y,pixelFormat:ke.RG,pixelDatatype:Ue.FLOAT,sampler:en.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(c(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!c(o)){let s=ts.getTextureResolution(o,this.pixelsNeededForExtents,iz);o=new Pt({context:t,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:en.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(_ke(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}}),!c(r)){let s=ts.getClippingDistanceTextureResolution(this,iz);r=new Pt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?ke.RED:ke.LUMINANCE,pixelDatatype:Ue.FLOAT,sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=Tke(this)};ts.prototype.queueCommands=function(e){c(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function Tke(e){let t=e._polygonsTexture,n=e._extentsTexture;return new vc({fragmentShaderSource:gI,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 hse=new de,Ske=new de;ts.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=zt.OUTSIDE;this.inverse&&(o=zt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),l=e.rectangle;if(!c(l)&&c(e.boundingVolume?.computeCorners)){let u=e.boundingVolume.computeCorners();l=de.fromCartesianArray(u,t,hse)}c(l)||(l=de.fromBoundingSphere(e.boundingSphere,t,hse));let d=de.simpleIntersection(l,a,Ske);c(d)&&(o=zt.INTERSECTING)}return o};ts.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new L("ClippingPolygonCollection should only be assigned to one object");e._owner=t,t[n]=e}};ts.isSupported=function(e){return e?.context.webgl2};ts.getTextureResolution=function(e,t,n){if(c(e))return n.x=e.width,n.y=e.height,n;let i=mt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};ts.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return c(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(mt.maximumTextureSize,4096),t.y=Math.min(mt.maximumTextureSize,4096),t)};ts.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return c(n)?(t.x=n.width,t.y=n.height,t):ts.getTextureResolution(n,e.pixelsNeededForExtents,t)};ts.prototype.isDestroyed=function(){return!1};ts.prototype.destroy=function(){return c(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(),he(this)};var qm=ts;var VSn=_(T(),1);var FTn=_(T(),1);var ITn=_(T(),1),xI={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};xI.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?xI.SUNLIGHT:xI.SCENE_LIGHT:xI.NONE};var rb=Object.freeze(xI);function pse(){this.lightIntensity=10,this.rayleighCoefficient=new m(55e-7,13e-6,284e-7),this.mieCoefficient=new m(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=rb.NONE}pse.requiresColorCorrect=function(e){return!(w.equalsEpsilon(e.hueShift,0,w.EPSILON7)&&w.equalsEpsilon(e.saturationShift,0,w.EPSILON7)&&w.equalsEpsilon(e.brightnessShift,0,w.EPSILON7))};var C_=pse;var MTn=_(T(),1),$m=`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;
const int PRIMARY_STEPS_MAX = 16;
const int LIGHT_STEPS_MAX = 4;
void computeScattering(
czm_ray primaryRay,
float primaryRayLength,
vec3 lightDirection,
float atmosphereInnerRadius,
out vec3 rayleighColor,
out vec3 mieColor,
out float opacity
) {
rayleighColor = vec3(0.0);
mieColor = vec3(0.0);
opacity = 0.0;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
vec3 origin = vec3(0.0);
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
return;
}
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
float start_0 = primaryRayAtmosphereIntersect.start;
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
float x_o_a = start_0 - ATMOSPHERE_THICKNESS;
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);
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0);
float rayPositionLength = primaryRayAtmosphereIntersect.start;
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);
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
if (i >= PRIMARY_STEPS) {
break;
}
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
opticalDepth += sampleDensity;
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);
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
if (j >= LIGHT_STEPS) {
break;
}
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
lightPositionLength += lightStepLength;
}
vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
rayleighAccumulation += sampleDensity.x * attenuation;
mieAccumulation += sampleDensity.y * attenuation;
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
}
rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
mieColor = u_atmosphereMieCoefficient * mieAccumulation;
opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
}
vec4 computeAtmosphereColor(
vec3 positionWC,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
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;
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
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));
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
return vec4(color, opacity);
}
`;var kTn=_(T(),1),_I=`uniform samplerCube u_radianceMap;
in vec2 v_textureCoordinates;
const float twoSqrtPi = 2.0 * sqrt(czm_pi);
float computeShBasis(int index, vec3 s) {
if (index == 0) {
return 1.0 / twoSqrtPi;
}
if (index == 1) {
return -sqrt(3.0) * s.y / twoSqrtPi;
}
if (index == 2) {
return sqrt(3.0) * s.z / twoSqrtPi;
}
if (index == 3) {
return -sqrt(3.0) * s.x / twoSqrtPi;
}
if (index == 4) {
return sqrt(15.0) * s.y * s.x / twoSqrtPi;
}
if (index == 5) {
return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
}
if (index == 6) {
return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
}
if (index == 7) {
return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
}
if (index == 8) {
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));
}
const int samples = 256;
const float solidAngle = 1.0 / float(samples);
void main() {
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)));
float Ylm = computeShBasis(coefficientIndex, direction);
vec3 lookupDirection = -direction.xyz;
lookupDirection.z = -lookupDirection.z;
vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);
out_FragColor += Ylm * color * solidAngle * sinTheta;
}
}
`;var OTn=_(T(),1),TI=`precision highp float;
in vec2 v_textureCoordinates;
uniform vec3 u_faceDirection;
uniform vec3 u_positionWC;
uniform mat4 u_enuToFixedFrame;
uniform vec4 u_brightnessSaturationGammaIntensity;
uniform vec4 u_groundColor;
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);
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);
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;
lookupDirection.x = -lookupDirection.x;
lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
lookupDirection.x = -lookupDirection.x;
float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha);
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);
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));
color.rgb = czm_gammaCorrect(color.rgb);
out_FragColor = color;
}
`;var BTn=_(T(),1),SI=`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;
}
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;
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 HTn=_(T(),1),CI=`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 $n(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??z.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(mt.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=$n.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new ee;let n=Math.pow(2,t-1);this._textureDimensions=new D(n,n),this._radiiAndDynamicAtmosphereColor=new m,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??60*60,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??$n.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties($n.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){m.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=m.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});$n._maximumComputeCommandCount=8;$n._activeComputeCommandCount=0;$n._nextFrameCommandQueue=[];$n._queueCommand=(e,t)=>{if($n._activeComputeCommandCount>=$n._maximumComputeCommandCount){$n._nextFrameCommandQueue.push(e);return}t.commandList.push(e),$n._activeComputeCommandCount++};$n._updateCommandQueue=e=>{if($n._maximumComputeCommandCount=Math.log2(mt.maximumCubeMapSize),$n._nextFrameCommandQueue.length>0&&$n._activeComputeCommandCount<$n._maximumComputeCommandCount){let t=$n._nextFrameCommandQueue.shift();for(;c(t)&&$n._activeComputeCommandCount<$n._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=$n._nextFrameCommandQueue.shift();continue}e.commandList.push(t),$n._activeComputeCommandCount++,t=$n._nextFrameCommandQueue.shift()}c(t)&&$n._nextFrameCommandQueue.push(t)}};$n.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new L("DynamicEnvironmentMapManager should only be assigned to one object");e._owner=t,t[n]=e}};$n.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)c(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)c(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;c(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var Cke=new m,Vke=new m;function Lke(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,Vke),s=1.025,a=Cke,l=c(r)?m.magnitude(r):o.maximumRadius;return a.x=l*s,a.y=l,a.z=i.dynamicLighting,!m.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(m.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var bse=new m,Zke=new M,Rke=new ce,Gke=new Y;function Eke(e,t){let n=t.context,i=e._textureDimensions;if(c(e._radianceCubeMap)||(e._radianceCubeMap=new Uo({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;c(o)||(o=new Be({sources:[$m,TI]}),e._radianceMapFS=o),C_.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,l=wt.eastNorthUpToFixedFrame(r,a,Zke),d=Rke;d.x=e.brightness,d.y=e.saturation,d.z=e.gamma,d.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let u=0;for(let f of Uo.faceNames()){let p=e._radianceMapTextures[u];c(p)&&!p.isDestroyed()&&p.destroy(),p=new Pt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),e._radianceMapTextures[u]=p;let y=u,h=new vc({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>l,u_faceDirection:()=>Uo.getDirection(f,bse),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Gke)},owner:e});h.postExecute=()=>{if(e.isDestroyed()||h.canceled){$n._activeComputeCommandCount--;return}let g=e._radianceMapComputeCommands;g[y]=void 0;let x=new Fr({context:n,colorTextures:[e._radianceMapTextures[y]]});x._bind(),e._radianceCubeMap[f].copyFromFramebuffer(),x._unBind(),x.destroy(),$n._activeComputeCommandCount--,g.some(c)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=h,$n._queueCommand(h,t),u++}e._radianceCommandsDirty=!1}}function Xke(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,l=0,d=(f,p,y,h,g)=>()=>{if(e.isDestroyed()||f.canceled){$n._activeComputeCommandCount--;return}let x=e._convolutionComputeCommands;x[p]=void 0,n.copyFace(t,y,h,g),l++,$n._activeComputeCommandCount--,y.destroy(),e._specularMapTextures[p]=void 0;let S=e._specularMapTextures.length;l>=S&&(e._irradianceCommandDirty=!0,n.sampler=new en({minificationFilter:Jt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},u=0;for(let f=1;f<i;++f){for(let p of Uo.faceNames()){c(e._specularMapTextures[u])&&e._specularMapTextures[u].destroy();let y=e._specularMapTextures[u]=new Pt({context:a,width:r,height:s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),h=e._va;c(h)||(h=Uo.createVertexArray(a,p),e._va=h);let g=e._convolveSP;c(g)||(g=tn.fromCache({context:a,vertexShaderSource:CI,fragmentShaderSource:SI,attributeLocations:{positions:0}}),e._convolveSP=g);let x=new vc({shaderProgram:g,vertexArray:h,outputTexture:y,persists:!0,owner:e,uniformMap:{u_roughness:()=>f/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Uo.getDirection(p,bse)}});x.postExecute=d(x,u,y,p,f),e._convolutionComputeCommands[u]=x,$n._queueCommand(x,t),++u}r/=2,s/=2}}var yse=new D(3,3);function Ike(e,t){let n=t.context,i=yse,o=e._irradianceMapTexture;c(o)&&!o.isDestroyed()&&o.destroy(),o=new Pt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:ke.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;c(r)||(r=new Be({sources:[_I]}),e._irradianceMapFS=r);let s=new vc({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){$n._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,$n._activeComputeCommandCount--},e._irradianceComputeCommand=s,$n._queueCommand(s,t),e._irradianceTextureDirty=!0}function Wke(e,t){let n=t.context;if(!c(e._irradianceMapTexture))return;let i=new Fr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=yse,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=m.unpack(r,s*4),m.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}$n.prototype.update=function(e){let t=e.mode;if(!$n.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!c(this._position)||t===se.MORPHING){this._shouldRegenerateShaders=!1;return}$n._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=Lke(this,e)||i===rb.SUNLIGHT&&!ee.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=ee.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Eke(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Xke(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(Ike(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Wke(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};$n.prototype.isDestroyed=function(){return!1};$n.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(),c(this._va)&&this._va.destroy(),c(this._convolveSP)&&this._convolveSP.destroy(),he(this)};$n.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};$n.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(Y.fromCssColorString("#717145"));$n.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new m(.35449,.35449,.35449)),m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO,m.ZERO]);var sb=$n;var RSn=_(T(),1);var VI={HIGHLIGHT:0,REPLACE:1,MIX:2};VI.getColorBlend=function(e,t){if(e===VI.HIGHLIGHT)return 0;if(e===VI.REPLACE)return 1;if(e===VI.MIX)return w.clamp(t,w.EPSILON4,1)};var bc=Object.freeze(VI);var dLn=_(T(),1);var ESn=_(T(),1),wke={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},yc=Object.freeze(wke);var ISn=_(T(),1),Pke={STEP:0,LINEAR:1,CUBICSPLINE:2},ef=Object.freeze(Pke);var $Cn=_(T(),1);var WCn=_(T(),1);var YSn=_(T(),1);var MSn=_(T(),1);var gse={};function LI(e){C.typeOf.number.greaterThan("options.count",e.count,0),C.typeOf.object("options.properties",e.properties),this._count=e.count,this._properties=He(e.properties,!0)}LI.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,gse)};LI.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,gse,e)};LI.prototype.getProperty=function(e,t){if(C.typeOf.number("index",e),C.typeOf.string("propertyId",t),e<0||e>=this._count)throw new L(`index must be in the range [0, ${this._count})`);let n=this._properties[t];if(c(n))return He(n[e],!0)};LI.prototype.setProperty=function(e,t,n){if(C.typeOf.number("index",e),C.typeOf.string("propertyId",t),e<0||e>=this._count)throw new L(`index must be in the range [0, ${this._count})`);let i=this._properties[t];c(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=He(n,!0)};var ab=LI;function gc(e){e=e??z.EMPTY_OBJECT,C.typeOf.number("options.count",e.count),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(gc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(c(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 c(this._metadataTable)&&(e+=this._metadataTable.byteLength),c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});gc.prototype.hasProperty=function(e,t){return C.typeOf.number("index",e),C.typeOf.string("propertyId",t),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(t)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};gc.prototype.hasPropertyBySemantic=function(e,t){return C.typeOf.number("index",e),C.typeOf.string("semantic",t),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};gc.prototype.propertyExists=function(e){return C.typeOf.string("propertyId",e),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(e)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};gc.prototype.propertyExistsBySemantic=function(e){return C.typeOf.string("semantic",e),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var oz=[];gc.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,c(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(oz)),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,oz)),c(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(oz)),t};gc.prototype.getProperty=function(e,t){let n;if(c(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),c(n))||c(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),c(n))||c(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),c(n)))return n};gc.prototype.setProperty=function(e,t,n){c(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(c(this._jsonMetadataTable)||(this._jsonMetadataTable=new ab({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};gc.prototype.getPropertyBySemantic=function(e,t){if(c(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};gc.prototype.setPropertyBySemantic=function(e,t,n){return c(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};gc.prototype.getPropertyTypedArray=function(e){if(C.typeOf.string("propertyId",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};gc.prototype.getPropertyTypedArrayBySemantic=function(e){if(C.typeOf.string("semantic",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};function rz(e,t){if(!c(e)||e<0||e>=t)throw new L(`featureId is required and must be between zero and featuresLength - 1 (${t}`-+").")}gc.prototype.isClass=function(e,t){rz(e,this.count),C.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};gc.prototype.isExactClass=function(e,t){return rz(e,this.count),C.typeOf.string("className",t),this.getExactClassName(e)===t};gc.prototype.getExactClassName=function(e){rz(e,this.count);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};var qc=gc;var sCn=_(T(),1);var eCn=_(T(),1);function ZI(e){e=e??z.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures;C.typeOf.object("options.property",t),C.typeOf.object("options.classProperty",n),C.typeOf.object("options.textures",i);let o=c(t.channels)?t.channels:[0],r=t,s=vl.createModelTextureReader({textureInfo:r,channels:Ake(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,l=t.scale,d=n.hasValueTransform||c(a)||c(l);a=a??n.offset,l=l??n.scale,a=n.unpackVectorAndMatrixTypes(a),l=n.unpackVectorAndMatrixTypes(l),this._offset=a,this._scale=l,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(ZI.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}}});ZI.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(ht(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(ht(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==lt.SCALAR?(ht(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==At.UINT8?(ht(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:lt.isVectorType(t)||t===lt.SCALAR?n!==At.UINT8?(ht(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(ht(`Property texture property ${e.id} has an unsupported type`),!1)};var vke=[void 0,"float","vec2","vec3","vec4"],Fke=[void 0,"int","ivec2","ivec3","ivec4"];ZI.prototype.getGlslType=function(){let e=this._classProperty,t=lt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?vke[t]:Fke[t]};ZI.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function Ake(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var RI=ZI;function sz(e){e=e??z.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures;C.typeOf.object("options.propertyTexture",t),C.typeOf.object("options.class",n),C.typeOf.object("options.textures",i);let o=t.extensions,r=t.extras,s={};if(c(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new RI({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(sz.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}}});sz.prototype.getProperty=function(e){return C.typeOf.string("propertyId",e),this._properties[e]};var cb=sz;var yCn=_(T(),1);var uCn=_(T(),1);function xse(e){e=e??z.EMPTY_OBJECT;let t=e.property,n=e.classProperty;C.typeOf.object("options.property",t),C.typeOf.object("options.classProperty",n),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||c(i)||c(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(xse.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 GI=xse;function az(e){e=e??z.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class;C.typeOf.object("options.propertyAttribute",t),C.typeOf.object("options.class",n);let i={};if(c(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new GI({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(az.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}}});az.prototype.getProperty=function(e){return C.typeOf.string("propertyId",e),this._properties[e]};var V_=az;var SCn=_(T(),1);function EI(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.schema",e.schema),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=c(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(EI.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(!c(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}}});EI.prototype.getPropertyTable=function(e){return C.typeOf.number("propertyTableId",e),this._propertyTables[e]};EI.prototype.getPropertyTexture=function(e){return C.typeOf.number("propertyTextureId",e),this._propertyTextures[e]};EI.prototype.getPropertyAttribute=function(e){return C.typeOf.number("propertyAttributeId",e),this._propertyAttributes[e]};var Ds=EI;function Mke(e){e=e??z.EMPTY_OBJECT;let t=e.extension,n=e.schema;C.typeOf.object("options.extension",t),C.typeOf.object("options.schema",n);let i=[];if(c(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],l=n.classes[a.class],d=new Wu({count:a.count,properties:a.properties,class:l,bufferViews:e.bufferViews});i.push(new qc({id:s,name:a.name,count:a.count,metadataTable:d,extras:a.extras,extensions:a.extensions}))}let o=[];if(c(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new cb({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(c(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new V_({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ds({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var XI=Mke;var OCn=_(T(),1);function Nke(e){e=e??z.EMPTY_OBJECT;let t=e.extension,n=e.schema;C.typeOf.object("options.extension",t),C.typeOf.object("options.schema",n);let i,o=[],r;if(c(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTables[a],d=n.classes[l.class],u=new Wu({count:l.count,properties:l.properties,class:d,bufferViews:e.bufferViews});o.push(new qc({id:a,count:l.count,metadataTable:u,extras:l.extras,extensions:l.extensions}))}let s=[];if(c(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTextures[a];s.push(new cb({id:a,propertyTexture:kke(l),class:n.classes[l.class],textures:e.textures}))}return new Ds({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function kke(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:Uke(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=St(o.texture,r,!0)}return t}function Uke(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 II=Nke;function Sy(e){e=e??z.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:l,asynchronous:d=!0}=e;if(C.typeOf.object("options.gltf",t),C.typeOf.object("options.gltfResource",o),C.typeOf.object("options.baseResource",r),C.typeOf.object("options.supportedImageFormats",s),C.typeOf.object("options.frameState",a),!c(e.extension)&&!c(e.extensionLegacy))throw new L("One of options.extension or options.extensionLegacy must be specified");this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=l,this._asynchronous=d,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(Sy.prototype=Object.create(Ji.prototype),Sy.prototype.constructor=Sy);Object.defineProperties(Sy.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function Oke(e){try{let t=zke(e),n=qke(e),i=$ke(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=xt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=xt.FAILED,e.getError("Failed to load structural metadata",t)}}Sy.prototype.load=function(){return c(this._promise)?this._promise:(this._state=xt.LOADING,this._promise=Oke(this),this._promise)};function Dke(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function Bke(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function Yke(e){let t=e.propertyTables,n={};if(c(t))for(let i=0;i<t.length;i++){let o=t[i];Dke(o.properties,n)}return n}function Hke(e){let t=e.featureTables,n={};if(c(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;c(r)&&Bke(r,n)}}return n}async function zke(e){let t;c(e._extension)?t=Yke(e._extension):t=Hke(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Ri.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 Kke(e){let t={},n=e.propertyTextures;if(c(n))for(let i=0;i<n.length;i++){let r=n[i].properties;c(r)&&Jke(r,t)}return t}function Jke(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function Qke(e){let t={},n=e.featureTextures;if(c(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;c(r)&&jke(r,t)}}return t}function jke(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function qke(e){let t;c(e._extension)?t=Kke(e._extension):t=Qke(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,l=[];for(let d in t)if(t.hasOwnProperty(d)){let u=Ri.getTextureLoader({gltf:n,textureInfo:t[d],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(d),l.push(u.load())}return Promise.all(l)}async function $ke(e){let t=e._extension??e._extensionLegacy,n;if(c(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ri.getSchemaLoader({resource:i})}else n=Ri.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Sy.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let d=t[a].process(e);i=i&&d}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let l=this._bufferViewIds[a],d=this._bufferViewLoaders[a];if(!d.isDestroyed()){let u=new Uint8Array(d.typedArray);r[l]=u}}let s={};for(let a=0;a<this._textureIds.length;++a){let l=this._textureIds[a],d=t[a];d.isDestroyed()||(s[l]=d.texture)}return c(this._extension)?this._structuralMetadata=XI({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=II({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),_se(this),this._state=xt.READY,!0};function _se(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function eUe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ri.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Sy.prototype.unload=function(){_se(this),eUe(this),c(this._schemaLoader)&&Ri.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var WI=Sy;var n1n=_(T(),1);var zC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};zC.fromGltfSemantic=function(e){C.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return zC.TRANSLATION;case"ROTATION":return zC.ROTATION;case"SCALE":return zC.SCALE;case"_FEATURE_ID":return zC.FEATURE_ID}};var ns=Object.freeze(zC);var L1n=_(T(),1);var h1n=_(T(),1);var tUe=65534,nUe=255;function j5(e){e=e??z.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;C.typeOf.object("options.triangleIndices",t),C.typeOf.object("options.outlineIndices",n),C.typeOf.number("options.originalVertexCount",i),this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Cse(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],iUe(this)}Object.defineProperties(j5.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function iUe(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 l=t[a],d=t[a+1],u=t[a+2],f=!1,p=f||n.hasEdge(l,d),y=f||n.hasEdge(d,u),h=f||n.hasEdge(u,l),g=Tse(i,l,d,u,p,y,h);for(;c(g);){let x=s[g];if(!c(x)){x=r+o.length;let S=g;for(;S>=r;)S=o[S-r];o.push(S),s[g]=x}x>tUe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):x>nUe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),g===l?(l=x,t[a]=x):g===d?(d=x,t[a+1]=x):(u=x,t[a+2]=x),g=Tse(i,l,d,u,p,y,h)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Tse(e,t,n,i,o,r,s){let a=s?1:0,l=o?1:0,d=0,u=cz(e,t,a,l,d);if(u===0)return t;let f=0,p=o?1:0,y=r?1:0,h=cz(e,n,f,p,y);if(h===0)return n;let g=s?1:0,x=0,S=r?1:0,V=cz(e,i,g,x,S);if(V===0)return i;let Z=u&h&V,R,E,I;if(Z&1)R=0,E=1,I=2;else if(Z&2)R=0,I=1,E=2;else if(Z&4)E=0,R=1,I=2;else if(Z&8)E=0,I=1,R=2;else if(Z&16)I=0,R=1,E=2;else if(Z&32)I=0,E=1,R=2;else{let N=lz(u),b=lz(h),G=lz(V);return N<b&&N<G?t:b<G?n:i}let v=t*3;e[v+R]=a,e[v+E]=l,e[v+I]=d;let P=n*3;e[P+R]=f,e[P+E]=p,e[P+I]=y;let F=i*3;e[F+R]=g,e[F+E]=x,e[F+I]=S}function cz(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],l=e[r+2];return c(s)?(s===n&&a===i&&l===o)<<0|(s===n&&a===o&&l===i)<<1|(s===i&&a===n&&l===o)<<2|(s===i&&a===o&&l===n)<<3|(s===o&&a===n&&l===i)<<4|(s===o&&a===i&&l===n)<<5:63}function lz(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}j5.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 l=t[a]*i,d=n+a*i;for(let u=0;u<i;u++)s[d+u]=s[l+u]}return s};j5.createTexture=function(e){let t=e.cache.modelOutliningCache;if(c(t)||(t=e.cache.modelOutliningCache={}),c(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,mt.maximumTextureSize),i=n,o=Sse(i),r=[];for(;i>1;)i>>=1,r.push(Sse(i));let s=new Pt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ke.LUMINANCE,sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR_MIPMAP_LINEAR,magnificationFilter:di.LINEAR})});return t.outlineTexture=s,s};function Sse(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 Cse(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)}}Cse.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 L_=j5;function Vse(e){C.typeOf.object("attribute",e),this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function oUe(e){C.typeOf.object("indices",e),this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function q5(e){C.typeOf.object("primitive",e),this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}q5.prototype.postProcess=function(e){this.needsOutlines&&(rUe(this),aUe(this,e))};function rUe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new L_({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Me.fromTypedArray(n.typedArray);let r=sUe(o.outlineCoordinates),s=new Vse(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,l=e.attributePlans.length;for(let d=0;d<l;d++){let u=a[d].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function sUe(e){let t=new Cn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=q.FLOAT,t.type=rn.VEC3,t.normalized=!1,t.count=e.length/3,t}function aUe(e,t){cUe(e.attributePlans,t),c(e.indicesPlan)&&lUe(e.indicesPlan,t)}function cUe(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=_t.createVertexBuffer({typedArray:s,context:t,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function lUe(e,t){let n=e.indices;if(e.loadBuffer){let i=_t.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Ne.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}q5.AttributeLoadPlan=Vse;q5.IndicesLoadPlan=oUe;var Z_=q5;var G1n=_(T(),1);function dUe(e){e=e??z.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var wI=dUe;var sVn=_(T(),1);var I1n=_(T(),1);function Lse(e){C.typeOf.object("options.position",e.position),C.typeOf.object("options.adjustmentParams",e.adjustmentParams),this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Lse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var PI=Lse;var P1n=_(T(),1);function Zse(e){C.typeOf.object("options.position",e.position),C.typeOf.object("options.adjustmentParams",e.adjustmentParams),C.typeOf.object("options.covarianceMatrix",e.covarianceMatrix),this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Zse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var vI=Zse;var A1n=_(T(),1);function Rse(e){C.typeOf.object("options.groupFlags",e.groupFlags),C.typeOf.object("options.rotationThetas",e.rotationThetas),C.typeOf.object("options.params",e.params),this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Rse.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var FI=Rse;var Y1n=_(T(),1);var N1n=_(T(),1),uUe={Direct:"Direct",Indirect:"Indirect"},Ch=Object.freeze(uUe);function Gse(e){if(C.typeOf.string("options.storageType",e.storageType),this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect,this.storageType===Ch.Indirect){if(!c(this.anchorPointsIndirect))throw new le("The anchorPointsIndirect are required for 'Indirect' storage");if(!c(this.intraTileCorrelationGroups))throw new le("The intraTileCorrelationGroups are required for 'Indirect' storage");if(c(this.anchorPointsDirect))throw new le("The anchorPointsDirect must be omitted for 'Indirect' storage");if(c(this.covarianceDirect))throw new le("The covarianceDirect must be omitted for 'Indirect' storage")}else{if(!c(this.anchorPointsDirect))throw new le("The anchorPointsDirect are required for 'Direct' storage");if(!c(this.covarianceDirect))throw new le("The covarianceDirect is required for 'Direct' storage");if(c(this.anchorPointsIndirect))throw new le("The anchorPointsIndirect must be omitted for 'Direct' storage");if(c(this.intraTileCorrelationGroups))throw new le("The intraTileCorrelationGroups must be omitted for 'Direct' storage")}}Object.defineProperties(Gse.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 KC=Gse;var K1n=_(T(),1);function Ese(e){C.typeOf.number.greaterThan("options.A",e.A,0),C.typeOf.number.lessThanOrEquals("options.A",e.A,1),C.typeOf.number.greaterThanOrEquals("options.alpha",e.alpha,0),C.typeOf.number.lessThan("options.alpha",e.alpha,1),C.typeOf.number.greaterThanOrEquals("options.beta",e.beta,0),C.typeOf.number.lessThanOrEquals("options.beta",e.beta,10),C.typeOf.number.greaterThan("options.T",e.T,0),this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Ese.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 AI=Ese;function JC(){}function Xse(e){return new te(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function mUe(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m);return new PI({position:t,adjustmentParams:n})}function fUe(e){let t=m.fromArray(e.position,0,new m),n=m.fromArray(e.adjustmentParams,0,new m),i=Xse(e.covarianceMatrix);return new vI({position:t,adjustmentParams:n,covarianceMatrix:i})}function hUe(e){let t=e.groupFlags,n=m.fromArray(e.rotationThetas,0,new m),i=[];for(let r of e.params){let s=new AI({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new FI({groupFlags:t,rotationThetas:n,params:i})}JC.load=function(e){C.typeOf.object("gltfGpmLocalJson",e);let t=e.storageType;if(t===Ch.Direct)return JC.loadDirect(e);if(t===Ch.Indirect)return JC.loadIndirect(e);throw new le(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};JC.loadDirect=function(e){C.typeOf.object("gltfGpmLocalJson",e),C.typeOf.object("gltfGpmLocalJson.anchorPointsDirect",e.anchorPointsDirect),C.typeOf.object("gltfGpmLocalJson.covarianceDirectUpperTriangle",e.covarianceDirectUpperTriangle);let t=[],n=e.anchorPointsDirect;for(let r of n){let s=mUe(r);t.push(s)}let i=Xse(e.covarianceDirectUpperTriangle);return new KC({storageType:Ch.Direct,anchorPointsDirect:t,covarianceDirect:i})};JC.loadIndirect=function(e){C.typeOf.object("gltfGpmLocalJson",e),C.typeOf.object("gltfGpmLocalJson.anchorPointsIndirect",e.anchorPointsIndirect),C.typeOf.object("gltfGpmLocalJson.intraTileCorrelationGroups",e.intraTileCorrelationGroups);let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=fUe(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=hUe(s);o.push(a)}return new KC({storageType:Ch.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var MI=JC;var GVn=_(T(),1);var lVn=_(T(),1);function Ise(e){C.typeOf.object("options.traits",e.traits),C.typeOf.number.greaterThanOrEquals("options.index",e.index,0),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(Ise.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 NI=Ise;var mVn=_(T(),1);function Wse(e){C.typeOf.string("options.source",e.source),this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(Wse.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var kI=Wse;var hVn=_(T(),1);function wse(e){this._ppeTextures=e}Object.defineProperties(wse.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var UI=wse;function Gr(e){e=e??z.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,l=e.asynchronous??!0;C.typeOf.object("options.gltf",t),C.typeOf.object("options.extension",n),C.typeOf.object("options.gltfResource",i),C.typeOf.object("options.baseResource",o),C.typeOf.object("options.supportedImageFormats",r),C.typeOf.object("options.frameState",s),this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=l,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=xt.UNLOADED,this._promise=void 0}c(Object.create)&&(Gr.prototype=Object.create(Ji.prototype),Gr.prototype.constructor=Gr);Object.defineProperties(Gr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Gr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=xt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=xt.FAILED,this.getError("Failed to load GPM data",e)}};Gr.prototype.load=function(){return c(this._promise)?this._promise:(this._state=xt.LOADING,this._promise=this._loadResources(this),this._promise)};function pUe(e){let t={},n=e.ppeTextures;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}Gr.prototype._loadTextures=function(){let e;c(this._extension)&&(e=pUe(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let l in e)if(e.hasOwnProperty(l)){let d=Ri.getTextureLoader({gltf:t,textureInfo:e[l],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(d),this._textureIds.push(l),a.push(d.load())}return Promise.all(a)};Gr.ppeTexturesMetadataSchemaCache=new Map;Gr._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}}}};Gr._obtainPpeTexturesMetadataSchema=function(e){let n=Gr._collectPpeTexturePropertyIdentifiers(e).toString(),i=Gr.ppeTexturesMetadataSchemaCache.get(n);if(c(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Gr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let l=s[a],d=`ppeTexture_${a}`,u=Gr._createPpeTextureClassJson(l,a);r.classes[d]=u}return i=Cd.fromJson(r),Gr.ppeTexturesMetadataSchemaCache.set(n,i),i};Gr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Gr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};Gr._convertToStructuralMetadata=function(e,t){let n=[],i=Gr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],l=`ppeTexture_${s}`,u=a.traits.source,f=i.classes[l],p={class:l,properties:{[u]:{index:a.index,texCoord:a.texCoord}}};n.push(new cb({id:s,name:a.name,propertyTexture:p,class:f,textures:t}))}return new Ds({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Gr.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===xt.READY)return!0;if(this._state!==xt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let d=0;d<n;++d){let f=t[d].process(e);i=i&&f}if(!i)return!1;let o={};for(let d=0;d<this._textureIds.length;++d){let u=this._textureIds[d],f=t[d];f.isDestroyed()||(o[u]=f.texture)}let r=[],s=this._extension;if(c(s.ppeTextures)){let d=s.ppeTextures;for(let u of d){let f=u.traits,p=new kI({min:f.min,max:f.max,source:f.source}),y=new NI({traits:p,noData:u.noData,offset:u.offset,scale:u.scale,index:u.index,texCoord:u.texCoord});r.push(y)}}let a=new UI(r);this._meshPrimitiveGpmLocal=a;let l=Gr._convertToStructuralMetadata(a,o);return this._structuralMetadata=l,this._state=xt.READY,!0};Gr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ri.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Gr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var OI=Gr;var{Attribute:bUe,Indices:yUe,FeatureIdAttribute:Pse,FeatureIdTexture:vse,FeatureIdImplicitRange:Fse,MorphTarget:gUe,Primitive:xUe,Instances:_Ue,Skin:TUe,Node:SUe,AnimatedPropertyType:CUe,AnimationSampler:VUe,AnimationTarget:LUe,AnimationChannel:ZUe,Animation:RUe,ArticulationStage:GUe,Articulation:EUe,Asset:XUe,Scene:IUe,Components:WUe,MetallicRoughness:wUe,SpecularGlossiness:PUe,Specular:vUe,Anisotropy:dz,Clearcoat:uz,Material:FUe}=Cn,vo={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function tf(e){e=e??z.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Po.Y,forwardAxis:a=Po.Z,loadAttributesAsTypedArray:l=!1,loadAttributesFor2D:d=!1,enablePick:u=!1,loadIndicesForWireframe:f=!1,loadPrimitiveOutline:p=!0,loadForClassification:y=!1,renameBatchIdSemantic:h=!1}=e;C.typeOf.object("options.gltfResource",t);let{baseResource:g=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=g,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=l,this._loadAttributesFor2D=d,this._enablePick=u,this._loadIndicesForWireframe=f,this._loadPrimitiveOutline=p,this._loadForClassification=y,this._renameBatchIdSemantic=h,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=vo.NOT_LOADED,this._textureState=vo.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}c(Object.create)&&(tf.prototype=Object.create(Ji.prototype),tf.prototype.constructor=tf);Object.defineProperties(tf.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return c(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function AUe(e){e._state=vo.LOADING,e._textureState=vo.LOADING;try{let t=Ri.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=vo.LOADED,e._textureState=vo.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=vo.FAILED,e._textureState=vo.FAILED,$5(e,t)}}async function MUe(e,t){Ot.supportsWebP.initialized||await Ot.supportsWebP.initialize(),e._supportedImageFormats=new wI({webp:Ot.supportsWebP(),basis:t.context.supportsBasis});let n=UOe(e,t);return e._state=vo.PROCESSING,e._textureState=vo.PROCESSING,c(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ri.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}tf.prototype.load=async function(){return c(this._promise)?this._promise:(this._promise=AUe(this),this._promise)};function $5(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function NUe(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&c(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(c(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(c(r)){let s=r.process(t);s&&(c(e._components.structuralMetadata)&&ht("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=vo.POST_PROCESSING)}function kUe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&UUe(e,o)}}function UUe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;c(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let l=r[a];c(l.buffer)&&n.push(l.buffer)}let s=i.indices;c(s)&&c(s.buffer)&&n.push(s.buffer)}tf.prototype._process=function(e){return this._state===vo.READY?!0:(this._state===vo.PROCESSING&&NUe(this,e),this._resourcesLoaded&&this._state===vo.POST_PROCESSING&&(kUe(this,e.context),this._state=vo.PROCESSED),this._resourcesLoaded&&this._state===vo.PROCESSED?(Yse(this),this._typedArray=void 0,this._state=vo.READY,!0):!1)};tf.prototype._processTextures=function(e){if(this._textureState===vo.READY)return!0;if(this._textureState!==vo.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&c(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=vo.READY,this._texturesLoaded=!0,!0):!1};tf.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===vo.LOADED&&!c(this._loadResourcesPromise)&&(this._loadResourcesPromise=MUe(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),c(this._processError)){this._state=vo.FAILED;let o=this._processError;this._processError=void 0,$5(this,o)}let t=this._textureErrors.pop();if(c(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===vo.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=vo.FAILED,$5(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=vo.FAILED,$5(this,o)}return this._incrementallyLoadTextures?n:n&&i};function OUe(e,t,n,i,o,r,s,a){let l=e.gltfJson,u=l.accessors[t].bufferView;return Ri.getVertexBufferLoader({gltf:l,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:u,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function DUe(e,t,n,i,o,r,s){return Ri.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 BUe(e,t){let n=Ri.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function Ase(e,t,n){let i=t.byteOffset,o=Pl(e,t),r=t.count,s=Sd(t.type),a=t.componentType,l=q.getSizeInBytes(a),d=l*s,u=r*s;if(o===d)return n=new Uint8Array(n),q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let f=q.createTypedArray(a,u),p=new DataView(n.buffer),y=new Array(s),h=nb(t.componentType);i=n.byteOffset+i;for(let g=0;g<r;++g){h(p,i,s,l,y);for(let x=0;x<s;++x)f[g*s+x]=y[x];i+=o}return f}function YUe(e,t){let n=e.type;if(n===rn.SCALAR)return t.fill(0);let i=rn.getMathType(n);return t.fill(i.clone(i.ZERO))}function HUe(e,t,n,i){let o=e.type,r=e.count;if(o===rn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===rn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Fe.unpack(t,s*4);else{let s=rn.getMathType(o),a=rn.getNumberOfComponents(o);for(let l=0;l<r;l++)n[l]=s.unpack(t,l*a)}return n}async function zUe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=Ase(r,n,t.typedArray);i=i??!1,HUe(n,s,o,i)}function ek(e,t,n){let i=new Array(t.count),o=t.bufferView;if(c(o)){let r=BUe(e,o),s=zUe(e,r,t,n,i);return e._loaderPromises.push(s),i}return YUe(t,i)}function Vd(e,t){if(c(t))return e===Number?t[0]:e.unpack(t)}function KUe(e){return e===Number?0:new e}function JUe(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 QUe={VEC2:new D(-1,-1),VEC3:new m(-1,-1,-1),VEC4:new ce(-1,-1,-1,-1)};function jUe(e,t){let n=JUe(e.componentDatatype),i=QUe[e.type],o=e.min;c(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;c(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function qUe(e,t,n){let i=e.decodeMatrix,o=Vd(n,e.decodedMin),r=Vd(n,e.decodedMax);c(o)&&c(r)&&(t.min=o,t.max=r);let s=new Cn.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 D(i[6],i[7]),s.quantizedVolumeStepSize=new D(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new m(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new m(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new ce(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new ce(i[0],i[6],i[12],i[18])),t.quantization=s}function $Ue(e,t,n,i,o){let r=e.accessors[t],s=rn.getMathType(r.type),a=r.normalized??!1,l=new bUe;l.name=n,l.semantic=i,l.setIndex=o,l.constant=KUe(s),l.componentDatatype=r.componentType,l.normalized=a,l.count=r.count,l.type=r.type,l.min=Vd(s,r.min),l.max=Vd(s,r.max),l.byteOffset=r.byteOffset,l.byteStride=Pl(e,r),ri(r,"WEB3D_quantized_attributes")&&qUe(r.extensions.WEB3D_quantized_attributes,l,s);let d=l.semantic===pt.POSITION||l.semantic===pt.NORMAL||l.semantic===pt.TANGENT||l.semantic===pt.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&jUe(l,s),l}function Mse(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var eOe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function mz(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=eOe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function tOe(e){let t=e===pt.POSITION,n=e===pt.FEATURE_ID,i=e===pt.TEXCOORD;return t||n||i}function nOe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=c(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=q.createArrayBufferView(o,t.typedArray.buffer)}}function iOe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=Ase(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function Nse(e,t,n,i,o,r,s,a){let l=e.gltfJson,d=l.accessors[t],u=d.bufferView,f=n.gltfSemantic,p=n.renamedSemantic,y=n.modelSemantic,h=c(y)?Mse(p):void 0,x=$Ue(l,t,f,y,h);if(!c(o)&&!c(u))return x;let S=OUe(e,t,f,i,o,r,s,a),V=e._geometryLoaders.length;e._geometryLoaders.push(S);let Z=S.load();return e._loaderPromises.push(Z),e._geometryCallbacks[V]=()=>{c(o)&&c(o.attributes)&&c(o.attributes[f])?nOe(x,S,r,s):iOe(l,d,x,S,r,s)},x}function kse(e,t,n,i,o,r,s,a){let l=n.modelSemantic,d=l===pt.POSITION,u=l===pt.FEATURE_ID,f=d&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=d&&e._enablePick&&!a.context.webgl2,y=e._loadForClassification&&u,h=e._loadAttributesAsTypedArray,g=!h,x=h||f||p||y,Z=Nse(e,t,n,i,o,s?!1:g,s?!0:x,a),R=new Z_.AttributeLoadPlan(Z);return R.loadBuffer=g,R.loadTypedArray=x,R}function oOe(e,t,n,i,o){let r=e.gltfJson.accessors,s=c(n.ROTATION),a=c(n.TRANSLATION)&&c(r[n.TRANSLATION].min)&&c(r[n.TRANSLATION].max),l=mz(e,ns,i),d=l.modelSemantic,u=d===ns.TRANSLATION||d===ns.ROTATION||d===ns.SCALE,f=d===ns.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,y=e._enablePick&&!o.context.webgl2,h=!p,g=e._loadAttributesFor2D&&!o.scene3DOnly;return Nse(e,t,l,void 0,void 0,h,p||f&&(!a||g||y),o)}function rOe(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],l=a.bufferView;if(!c(i)&&!c(l))return;let d=new yUe;d.count=a.count;let u=e._loadAttributesAsTypedArray,f=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,h=!u,g=u||f||p,V=DUe(e,t,n,i,r?!1:h,r?!0:g,s),Z=e._geometryLoaders.length;e._geometryLoaders.push(V);let R=V.load();e._loaderPromises.push(R),e._geometryCallbacks[Z]=()=>{d.indexDatatype=V.indexDatatype,d.buffer=V.buffer,d.typedArray=V.typedArray};let E=new Z_.IndicesLoadPlan(d);return E.loadBuffer=h,E.loadTypedArray=g,E}function $c(e,t,n,i){let o=e.gltfJson,r=vl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!c(r))return;let s=Ri.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=vl.createModelTextureReader({textureInfo:t}),l=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=vo.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[l]=()=>{a.texture=s.texture,c(i)&&(a.texture.sampler=i)},a}function sOe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,l=new PUe;return c(i)&&(l.diffuseTexture=$c(e,i,n)),c(o)&&(l.specularGlossinessTexture=$c(e,o,n)),l.diffuseFactor=Vd(ce,r),l.specularFactor=Vd(m,s),l.glossinessFactor=a,l}function aOe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,l=new wUe;return c(i)&&(l.baseColorTexture=$c(e,i,n)),c(o)&&(l.metallicRoughnessTexture=$c(e,o,n)),l.baseColorFactor=Vd(ce,r),l.metallicFactor=s,l.roughnessFactor=a,l}function cOe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new vUe;return c(o)&&(a.specularTexture=$c(e,o,n)),c(s)&&(a.specularColorTexture=$c(e,s,n)),a.specularFactor=i,a.specularColorFactor=Vd(m,r),a}function lOe(e,t,n){let{anisotropyStrength:i=dz.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=dz.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new dz;return c(r)&&(s.anisotropyTexture=$c(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function dOe(e,t,n){let{clearcoatFactor:i=uz.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=uz.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,l=new uz;return c(o)&&(l.clearcoatTexture=$c(e,o,n)),c(s)&&(l.clearcoatRoughnessTexture=$c(e,s,n)),c(a)&&(l.clearcoatNormalTexture=$c(e,a,n)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function uOe(e,t,n){let i=new FUe,o=t.extensions??z.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=c(o.KHR_materials_unlit),c(r)?i.specularGlossiness=sOe(e,r,n):(c(d)&&(i.metallicRoughness=aOe(e,d,n)),c(s)&&!i.unlit&&(i.specular=cOe(e,s,n)),c(a)&&!i.unlit&&(i.anisotropy=lOe(e,a,n)),c(l)&&!i.unlit&&(i.clearcoat=dOe(e,l,n))),c(t.emissiveTexture)&&(i.emissiveTexture=$c(e,t.emissiveTexture,n)),c(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=$c(e,t.normalTexture,n)),c(t.occlusionTexture)&&(i.occlusionTexture=$c(e,t.occlusionTexture,n)),i.emissiveFactor=Vd(m,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function Use(e,t){let n=new Pse;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 Ose(e,t,n,i){let o=new Pse,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Mse(r.attribute),o.positionalLabel=i,o}function Dse(e,t){let n=new Fse;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 Bse(e,t,n,i){let o=new Fse,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 mOe(e,t,n,i){let o=new vse;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=$c(e,r,n,en.NEAREST);let a=(c(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=a,o}function fOe(e,t,n,i,o,r){let s=new vse,a=t.featureIds,l=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=$c(e,l,i,en.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function hOe(e,t,n,i,o){let r=new gUe,s=void 0,a=void 0,l=!1;for(let d in t){if(!t.hasOwnProperty(d))continue;let u=t[d],f=mz(e,pt,d),p=kse(e,u,f,s,a,l,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function pOe(e,t,n,i){let o=new xUe,r=new Z_(o);e._primitiveLoadPlans.push(r);let s=t.material;c(s)&&(o.material=uOe(e,e.gltfJson.materials[s],i));let a=t.extensions??z.EMPTY_OBJECT,l=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&c(d)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=bOe(e,d,r));let u=e._loadForClassification,f=a.KHR_draco_mesh_compression,p=!1,y=t.attributes;if(c(y))for(let E in y){if(!y.hasOwnProperty(E))continue;let I=y[E],v=mz(e,pt,E),P=v.modelSemantic;if(u&&!tOe(P))continue;P===pt.FEATURE_ID&&(p=!0);let F=kse(e,I,v,t,f,n,l,i);r.attributePlans.push(F),o.attributes.push(F.attribute)}let h=t.targets;if(c(h)&&!u)for(let E=0;E<h.length;++E)o.morphTargets.push(hOe(e,h[E],l,r,i));let g=t.indices;if(c(g)){let E=rOe(e,g,t,f,p,l,i);c(E)&&(r.indicesPlan=E,o.indices=E.indices)}let x=a.EXT_structural_metadata,S=a.EXT_mesh_features,V=a.EXT_feature_metadata,Z=c(V);c(S)?yOe(e,o,S,i):Z&&gOe(e,o,V,i),c(x)?xOe(o,x):Z&&_Oe(e,o,V);let R=t.mode;if(u&&R!==ve.TRIANGLES)throw new le("Only triangle meshes can be used for classification.");return o.primitiveType=R,o}function bOe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return ek(e,i,!1)}function yOe(e,t,n,i){let o;c(n)&&c(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,l;c(s.texture)?l=mOe(e,s,i,a):c(s.attribute)?l=Use(s,a):l=Dse(s,a),t.featureIds.push(l)}}function gOe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(c(s))for(let l=0;l<s.length;++l){let d=s[l],u=d.featureTable,f=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,y=`featureId_${r}`;r++;let h;c(d.featureIds.attribute)?h=Ose(d,f,p,y):h=Bse(d,f,p,y),t.featureIds.push(h)}let a=n.featureIdTextures;if(c(a))for(let l=0;l<a.length;++l){let d=a[l],u=d.featureTable,f=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,y=`featureId_${r}`;r++;let h=fOe(e,d,f,i,p,y);t.featureIds.push(h)}}function xOe(e,t){if(!c(t))return;let{propertyTextures:n,propertyAttributes:i}=t;c(n)&&(e.propertyTextureIds=n),c(i)&&(e.propertyAttributeIds=i)}function _Oe(e,t,n){c(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function TOe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new _Ue,r=i.attributes;if(c(r))for(let d in r){if(!r.hasOwnProperty(d))continue;let u=r[d];o.attributes.push(oOe(e,u,r,d,n))}let s=i.extensions??z.EMPTY_OBJECT,a=t.EXT_instance_features,l=s.EXT_feature_metadata;return c(a)?SOe(o,a):c(l)&&COe(e.gltfJson,o,l,e._sortedPropertyTableIds),o}function SOe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;c(o.attribute)?s=Use(o,r):s=Dse(o,r),e.featureIds.push(s)}}function COe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(c(r))for(let s=0;s<r.length;++s){let a=r[s],l=a.featureTable,d=i.indexOf(l),u=o[l].count,f=`instanceFeatureId_${s}`,p;c(a.featureIds.attribute)?p=Ose(a,d,u,f):p=Bse(a,d,u,f),t.featureIds.push(p)}}function VOe(e,t,n){let i=new SUe;i.name=t.name,i.matrix=Vd(M,t.matrix),i.translation=Vd(m,t.translation),i.rotation=Vd(Fe,t.rotation),i.scale=Vd(m,t.scale);let o=t.extensions??z.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(c(r)){if(e._loadForClassification)throw new le("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=TOe(e,o,n)}c(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(c(a)){let l=e.gltfJson.meshes[a],d=l.primitives;for(let p=0;p<d.length;++p)i.primitives.push(pOe(e,d[p],c(i.instances),n));let u=t.weights??l.weights,f=i.primitives[0].morphTargets;i.morphWeights=c(u)?u.slice():new Array(f.length).fill(0)}return i}function LOe(e,t){let n=e.gltfJson.nodes;if(!c(n))return[];let i=n.map(function(o,r){let s=VOe(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(c(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function ZOe(e,t,n){let i=new TUe,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(c(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=ek(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function ROe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!c(n))return[];let i=n.map(function(r,s){let a=ZOe(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;c(s)&&(t[r].skin=i[s])}return i}async function GOe(e,t,n,i){let o=new WI({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 EOe(e,t,n,i){let o=new OI({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 XOe(e,t){let n=new VUe,i=e.gltfJson.accessors,o=i[t.input];n.input=ek(e,o);let r=t.interpolation;n.interpolation=ef[r]??ef.LINEAR;let s=i[t.output];return n.output=ek(e,s,!0),n}function IOe(e,t){let n=new LUe,i=e.node;if(!c(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=CUe[o],n}function WOe(e,t,n){let i=new ZUe,o=e.sampler;return i.sampler=t[o],i.target=IOe(e.target,n),i}function wOe(e,t,n){let i=new RUe;i.name=t.name;let o=t.samplers.map(function(s,a){let l=XOe(e,s);return l.index=a,l}),r=t.channels.map(function(s){return WOe(s,o,n)});return i.samplers=o,i.channels=r,i}function POe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!c(n)?[]:n.map(function(o,r){let s=wOe(e,o,t);return s.index=r,s})}function vOe(e){let t=new GUe;t.name=e.name;let n=e.type.toUpperCase();return t.type=yc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function FOe(e){let t=new EUe;return t.name=e.name,t.stages=e.stages.map(vOe),t}function AOe(e){let n=(e.extensions??z.EMPTY_OBJECT).AGI_articulations?.articulations;return c(n)?n.map(FOe):[]}function MOe(e){let t;return c(e.scenes)&&c(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=c(t)?t:[],t}function NOe(e,t){let n=new IUe,i=MOe(e);return n.nodes=i.map(function(o){return t[o]}),n}var kOe=new m;function UOe(e,t){let n=e.gltfJson,i=n.extensions??z.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(c(r)){let V=r.featureTables,Z=r.featureTextures,R=c(V)?V:[],E=c(Z)?Z:[];e._sortedPropertyTableIds=Object.keys(R).sort(),e._sortedFeatureTextureIds=Object.keys(E).sort()}let a=LOe(e,t),l=ROe(e,a),d=POe(e,a),u=AOe(n),f=NOe(n,a),p=new WUe,y=new XUe,h=n.asset.copyright;if(c(h)){let V=h.split(";").map(function(Z){return new Ct(Z.trim())});y.credits=V}if(p.asset=y,p.scene=f,p.nodes=a,p.skins=l,p.animations=d,p.articulations=u,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,c(s)){let V=m.fromArray(s.center,0,kOe);p.transform=M.fromTranslation(V,p.transform)}if(e._components=p,c(o)||c(r)){let V=GOe(e,o,r,t);e._loaderPromises.push(V)}let g=i.NGA_gpm_local;if(c(g)){let V=MI.load(g);e._components.extensions.NGA_gpm_local=V}let x=n.meshes;if(c(x))for(let V of x){let Z=V.primitives;if(c(Z))for(let R of Z){let E=R.extensions;if(c(E)){let I=E.NGA_gpm_local;if(c(I)){let v=EOe(e,n,I,t);e._loaderPromises.push(v)}}}}let S=[];return S.push.apply(S,e._loaderPromises),e._incrementallyLoadTextures||S.push.apply(S,e._texturesPromises),Promise.all(S)}function OOe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._textureLoaders.length=0}function Yse(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._bufferViewLoaders.length=0}function DOe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ri.unload(t[n]);e._geometryLoaders.length=0}function BOe(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 YOe(e){c(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function HOe(e){c(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}tf.prototype.isUnloaded=function(){return this._state===vo.UNLOADED};tf.prototype.unload=function(){c(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ri.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,OOe(this),Yse(this),DOe(this),BOe(this),YOe(this),HOe(this),this._components=void 0,this._typedArray=void 0,this._state=vo.UNLOADED};var nf=tf;var ILn=_(T(),1);var GLn=_(T(),1);var mLn=_(T(),1),DI=`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));
if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
return vec2(0.0);
}
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)
{
discard;
}
vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);
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);
gl_FragDepth = depthOrLogDepth;
}
`;function QC(){this._framebuffer=new hi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(QC.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 zOe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var fz=new D;function KOe(e,t){let n=new Be({defines:["LOG_DEPTH_WRITE"],sources:[DI]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return fz.x=e._radius,fz.y=e._strength,fz}},o=Oe.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Xe.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ti({framebuffer:e.framebuffer,color:new Y(0,0,0,0),depth:1,renderState:Oe.fromCache(),pass:Xe.CESIUM_3D_TILE,owner:e})}function JOe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),KOe(e,t)}function Hse(e){return e.drawBuffers&&e.fragmentDepth}QC.isSupported=Hse;function QOe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!c(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=Be.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}QC.prototype.update=function(e,t,n,i){if(!Hse(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,JOe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==ve.POINTS||d.pass===Xe.TRANSLUCENT)continue;let u,f,p=d.derivedCommands.pointCloudProcessor;c(p)&&(u=p.command,f=p.originalShaderProgram),(!c(u)||d.dirty||f!==d.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=et.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=QOe(e.context,d.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,c(p)||(p={command:u,originalShaderProgram:d.shaderProgram},d.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=d.shaderProgram),r[o]=u}let a=this._clearCommand,l=this._drawCommand;l.boundingVolume=i,r.push(l),r.push(a)};QC.prototype.isDestroyed=function(){return!1};QC.prototype.destroy=function(){return zOe(this),he(this)};var lb=QC;function zse(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}zse.isSupported=function(e){return lb.isSupported(e.context)};var Vh=zse;var HLn=_(T(),1);var Ma={},jOe=new ce(0,0,0,1),xc=new ce,qOe=new je,hz=new D,pz=new D;Ma.worldToWindowCoordinates=function(e,t,n){return Ma.worldWithEyeOffsetToWindowCoordinates(e,t,m.ZERO,n)};var Kse=new ce,Jse=new m;function BI(e,t,n,i){let o=n.viewMatrix,r=M.multiplyByVector(o,ce.fromElements(e.x,e.y,e.z,1,Kse),Kse),s=m.multiplyComponents(t,m.normalize(r,Jse),Jse);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 $Oe=new pe(Math.PI,w.PI_OVER_TWO),eDe=new m,tDe=new m;Ma.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!c(e))throw new L("scene is required.");if(!c(t))throw new L("position is required.");let o=e.frameState,r=Ma.computeActualEllipsoidPosition(o,t,jOe);if(!c(r))return;let s=e.canvas,a=qOe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let l=e.camera,d=!1;if(o.mode===se.SCENE2D){let u=e.mapProjection,f=$Oe,p=u.project(f,eDe),y=m.clone(l.position,tDe),h=l.frustum.clone(),g=M.computeViewportTransformation(a,0,1,new M),x=l.frustum.projectionMatrix,S=l.positionWC.y,V=m.fromElements(w.sign(S)*p.x-S,0,-l.positionWC.x),Z=wt.pointToGLWindowCoordinates(x,g,V);if(S===0||Z.x<=0||Z.x>=s.clientWidth)d=!0;else{if(Z.x>s.clientWidth*.5){a.width=Z.x,l.frustum.right=p.x-S,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,hz),a.x+=Z.x,l.position.x=-l.position.x;let R=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-R,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,pz)}else{a.x+=Z.x,a.width-=Z.x,l.frustum.left=-p.x-S,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,hz),a.x=a.x-a.width,l.position.x=-l.position.x;let R=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-R,xc=BI(r,n,l,xc),Ma.clipToGLWindowCoordinates(a,xc,pz)}m.clone(y,l.position),l.frustum=h.clone(),i=D.clone(hz,i),(i.x<0||i.x>s.clientWidth)&&(i.x=pz.x)}}if(o.mode!==se.SCENE2D||d){if(xc=BI(r,n,l,xc),xc.z<0&&!(l.frustum instanceof sn)&&!(l.frustum instanceof Oo))return;i=Ma.clipToGLWindowCoordinates(a,xc,i)}return i.y=s.clientHeight-i.y,i};Ma.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ma.worldToWindowCoordinates(e,t,n),!!c(n))return Ma.transformWindowToDrawingBuffer(e,n,n)};var db=new m,nDe=new pe;Ma.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===se.SCENE3D)return m.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,nDe);if(!c(r))return;if(o.project(r,db),i===se.COLUMBUS_VIEW)return m.fromElements(db.z,db.x,db.y,n);if(i===se.SCENE2D)return m.fromElements(0,db.x,db.y,n);let s=e.morphTime;return m.fromElements(w.lerp(db.z,t.x,s),w.lerp(db.x,t.y,s),w.lerp(db.y,t.z,s),n)};var Qse=new m,jse=new m,qse=new M;Ma.clipToGLWindowCoordinates=function(e,t,n){return m.divideByScalar(t,t.w,Qse),M.computeViewportTransformation(e,0,1,qse),M.multiplyByPoint(qse,Qse,jse),D.fromCartesian3(jse,n)};Ma.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return D.fromElements(t.x*o,t.y*r,n)};var iDe=new ce,$se=new ce;Ma.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,l=s.y;if(e.frameState.useLogDepth){let y=n*r.log2FarDepthFromNearPlusOne,h=Math.pow(2,y)-1;n=l*(1-a/(h+a))/(l-a)}let d=e.view.passState.viewport,u=ce.clone(ce.UNIT_W,iDe);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let f,p=e.camera.frustum;if(c(p.fovy)){f=M.multiplyByVector(r.inverseViewProjection,u,$se);let y=1/f.w;m.multiplyByScalar(f,y,f)}else{let y=p.offCenterFrustum;c(y)&&(p=y),f=$se,f.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,f.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,f.z=(u.z*(a-l)-a-l)*.5,f.w=1,f=M.multiplyByVector(r.inverseView,f,f)}return m.fromCartesian4(f,i)};var Oi=Ma;var OZn=_(T(),1);var qLn=_(T(),1);var jC={};jC._deprecationWarning=Cs;var ub=Uint32Array.BYTES_PER_ELEMENT;jC.parse=function(e,t){let n=t??0;C.defined("arrayBuffer",e),t=n;let i=new Uint8Array(e),o=new DataView(e);t+=ub;let r=o.getUint32(t,!0);if(r!==1)throw new le(`Only Batched 3D Model version 1 is supported.  Version ${r} is not.`);t+=ub;let s=o.getUint32(t,!0);t+=ub;let a=o.getUint32(t,!0);t+=ub;let l=o.getUint32(t,!0);t+=ub;let d=o.getUint32(t,!0);t+=ub;let u=o.getUint32(t,!0);t+=ub;let f;d>=570425344?(t-=ub*2,f=a,d=l,u=0,a=0,l=0,jC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=ub,f=d,d=a,u=l,a=0,l=0,jC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:f??0}:(p=er(i,t,a),t+=a);let y=new Uint8Array(e,t,l);t+=l;let h,g;d>0&&(h=er(i,t,d),t+=d,u>0&&(g=new Uint8Array(e,t,u),g=new Uint8Array(g),t+=u));let x=n+s-t;if(x===0)throw new le("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,x):(jC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+x))),{batchLength:f,featureTableJson:p,featureTableBinary:y,batchTableJson:h,batchTableBinary:g,gltf:S}};var YI=jC;var nZn=_(T(),1);function HI(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function eae(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return c(a)||(a=q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function oDe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return c(r)||(r=q.createTypedArray(n,i),o[t]=r),r}HI.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(t=t??q.UNSIGNED_INT,n=n??1,eae(this,e,t,n,1,i.byteOffset)):i};HI.prototype.hasProperty=function(e){return c(this.json[e])};HI.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(c(i.componentType)&&(t=q.fromName(i.componentType)),eae(this,e,t,n,this.featuresLength,i.byteOffset)):oDe(this,e,t,i)};HI.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!c(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 of=HI;var SZn=_(T(),1);function zI(e){C.typeOf.number("options.count",e.count),C.typeOf.object("options.batchTable",e.batchTable);let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput;if(o&&!c(r))throw new L("customAttributeOutput is required when parsing batch table as property attributes");let s=rDe(n),a;c(s.jsonProperties)&&(a=new ab({count:t,properties:s.jsonProperties}));let l;c(s.hierarchy)&&(l=new t_({extension:s.hierarchy,binaryBody:i}));let d=Jm.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,f,p,y;if(o){let x=aDe(t,d,u,i,r);y=x.transcodedSchema,p=[new V_({propertyAttribute:x.propertyAttributeJson,class:x.transcodedClass})]}else{let x=sDe(t,d,u,i);y=x.transcodedSchema;let S=x.featureTableJson;f=new Wu({count:S.count,properties:S.properties,class:x.transcodedClass,bufferViews:x.bufferViewsTypedArrays}),p=[]}let h=[];if(c(f)||c(a)||c(l)){let x=new qc({id:0,name:"Batch Table",count:t,metadataTable:f,jsonMetadataTable:a,batchTableHierarchy:l});h.push(x)}let g={schema:y,propertyTables:h,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ds(g)}function rDe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;c(t)?(zI._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):c(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 l=e[a];Array.isArray(l)?(r=c(r)?r:{},r[a]=l):s[a]=l}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function sDe(e,t,n,i){let o={},r={},s={},a=0;for(let f in n){if(!n.hasOwnProperty(f))continue;if(!c(i))throw new le(`Property ${f} requires a batch table binary.`);let p=n[f],y=_d(p);r[f]={bufferView:a},o[f]=tae(p),s[a]=y.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let l={classes:{}};l.classes[t]={properties:o};let d=Cd.fromJson(l);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function aDe(e,t,n,i,o){let r={},s={},a=0;for(let f in n){if(!n.hasOwnProperty(f))continue;let p=n[f];if(!c(i)&&!c(p.typedArray))throw new le(`Property ${f} requires a batch table binary.`);let y=qt.sanitizeGlslIdentifier(f);(y===""||r.hasOwnProperty(y))&&(y=`property_${a}`,a++);let h=tae(p);h.name=f,r[y]=h;let g=y.toUpperCase();g.startsWith("_")||(g=`_${g}`);let x=p.typedArray;c(x)||(x=_d(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let S=new Cn.Attribute;S.name=g,S.count=e,S.type=p.type;let V=q.fromTypedArray(x);(V===q.INT||V===q.UNSIGNED_INT||V===q.DOUBLE)&&(zI._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${g}" 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.`),x=new Float32Array(x)),S.componentDatatype=q.fromTypedArray(x),S.typedArray=x,o.push(S),s[y]={attribute:g}}let l={classes:{}};l.classes[t]={properties:r};let d=Cd.fromJson(l);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function tae(e){let t=cDe(e.componentType);return{type:e.type,componentType:t}}function cDe(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"}}zI._deprecationWarning=Cs;zI._oneTimeWarning=ht;var mb=zI;var R_={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},lDe=Cn.FeatureIdAttribute;function Cy(e){e=e??z.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,l=e.upAxis??Po.Y,d=e.forwardAxis??Po.X,u=e.loadAttributesAsTypedArray??!1,f=e.loadAttributesFor2D??!1,p=e.enablePick??!1,y=e.loadIndicesForWireframe??!1,h=e.loadPrimitiveOutline??!0,g=e.loadForClassification??!1;C.typeOf.object("options.b3dmResource",t),C.typeOf.object("options.arrayBuffer",i),n=c(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=l,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=p,this._loadIndicesForWireframe=y,this._loadPrimitiveOutline=h,this._loadForClassification=g,this._state=R_.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}c(Object.create)&&(Cy.prototype=Object.create(Ji.prototype),Cy.prototype.constructor=Cy);Object.defineProperties(Cy.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Cy.prototype.load=function(){if(c(this._promise))return this._promise;let e=YI.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new of(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",q.FLOAT,3);c(a)&&(this._transform=M.fromTranslation(m.fromArray(a))),this._batchTable={json:o,binary:r};let l=new nf({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=l,this._state=R_.LOADING;let d=this;return this._promise=l.load().then(function(){if(!d.isDestroyed())return d._state=R_.PROCESSING,d}).catch(function(u){if(!d.isDestroyed())return dDe(d,u)}),this._promise};function dDe(e,t){return e.unload(),e._state=R_.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Cy.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===R_.READY)return!0;if(this._state!==R_.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=M.multiplyTransformation(this._transform,n.transform,n.transform),uDe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=R_.READY,!0};function uDe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(c(n.json))o=mb({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new qc({name:Jm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ds({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)nae(r[a]);t.structuralMetadata=o}function nae(e){let t=e.children.length;for(let i=0;i<t;i++)nae(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=qt.getAttributeBySemantic(o,pt.FEATURE_ID);if(c(r)){r.setIndex=0;let s=new lDe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Cy.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var KI=Cy;var uRn=_(T(),1);function Vy(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.geoJson",e.geoJson),this._geoJson=e.geoJson,this._components=void 0}c(Object.create)&&(Vy.prototype=Object.create(Ji.prototype),Vy.prototype.constructor=Vy);Object.defineProperties(Vy.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Vy.prototype.load=function(){return Promise.resolve(this)};Vy.prototype.process=function(e){return C.typeOf.object("frameState",e),c(this._components)||(this._components=VDe(this._geoJson,e),this._geoJson=void 0),!0};function mDe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function fDe(){this.features=[]}function bz(e){let t=e[0],n=e[1],i=e[2]??0;return new m(t,n,i)}function yz(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=bz(e[o]);return[n]}function hDe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=yz(e[i])[0];return n}function iae(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=yz(e[i])[0];return n}function pDe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,iae(e[i]));return n}function bDe(e){return[bz(e)]}function yDe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=bz(e[i]);return n}var gDe={LineString:yz,MultiLineString:hDe,MultiPolygon:pDe,Polygon:iae,MultiPoint:yDe,Point:bDe},xDe={LineString:ve.LINES,MultiLineString:ve.LINES,MultiPolygon:ve.LINES,Polygon:ve.LINES,MultiPoint:ve.POINTS,Point:ve.POINTS};function oae(e,t){if(!c(e.geometry))return;let n=e.geometry.type,i=gDe[n],o=xDe[n],r=e.geometry.coordinates;if(!c(i)||!c(r))return;let s=new mDe;o===ve.LINES?s.lines=i(r):o===ve.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function _De(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)oae(n[o],t)}var TDe={FeatureCollection:_De,Feature:oae},tk=new m;function SDe(e,t,n){let i=0,o=0,r=e.length;for(let F=0;F<r;F++){let N=e[F];if(c(N.lines)){let b=N.lines.length;for(let G=0;G<b;G++){let X=N.lines[G];i+=X.length,o+=(X.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),l=Me.createTypedArray(i,o),d=Me.fromTypedArray(l),u=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),f=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,y=0;for(let F=0;F<r;F++){let N=e[F];if(!c(N.lines))continue;let b=N.lines.length;for(let G=0;G<b;G++){let X=N.lines[G],W=X.length;for(let A=0;A<W;A++){let k=X[A],B=m.fromDegrees(k.x,k.y,k.z,re.WGS84,tk),O=M.multiplyByPoint(t,B,tk);m.minimumByComponent(u,O,u),m.maximumByComponent(f,O,f),m.pack(O,s,p*3),a[p]=F,A<W-1&&(l[y*2]=p,l[y*2+1]=p+1,y++),p++}}}let h=_t.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});h.vertexArrayDestroyable=!1;let g=_t.createVertexBuffer({typedArray:a,context:n.context,usage:Ne.STATIC_DRAW});g.vertexArrayDestroyable=!1;let x=_t.createIndexBuffer({typedArray:l,context:n.context,usage:Ne.STATIC_DRAW,indexDatatype:d});x.vertexArrayDestroyable=!1;let S=new Cn.Attribute;S.semantic=pt.POSITION,S.componentDatatype=q.FLOAT,S.type=rn.VEC3,S.count=i,S.min=u,S.max=f,S.buffer=h;let V=new Cn.Attribute;V.semantic=pt.FEATURE_ID,V.setIndex=0,V.componentDatatype=q.FLOAT,V.type=rn.SCALAR,V.count=i,V.buffer=g;let Z=[S,V],R=new Cn.Material;R.unlit=!0;let E=new Cn.Indices;E.indexDatatype=d,E.count=l.length,E.buffer=x;let I=new Cn.FeatureIdAttribute;I.featureCount=r,I.propertyTableId=0,I.setIndex=0,I.positionalLabel="featureId_0";let v=[I],P=new Cn.Primitive;return P.attributes=Z,P.indices=E,P.featureIds=v,P.primitiveType=ve.LINES,P.material=R,P}function CDe(e,t,n){let i=0,o=e.length;for(let Z=0;Z<o;Z++){let R=e[Z];c(R.points)&&(i+=R.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=0;for(let Z=0;Z<o;Z++){let R=e[Z];if(!c(R.points))continue;let E=R.points.length;for(let I=0;I<E;I++){let v=R.points[I],P=m.fromDegrees(v.x,v.y,v.z,re.WGS84,tk),F=M.multiplyByPoint(t,P,tk);m.minimumByComponent(a,F,a),m.maximumByComponent(l,F,l),m.pack(F,r,d*3),s[d]=Z,d++}}let u=_t.createVertexBuffer({typedArray:r,context:n.context,usage:Ne.STATIC_DRAW});u.vertexArrayDestroyable=!1;let f=_t.createVertexBuffer({typedArray:s,context:n.context,usage:Ne.STATIC_DRAW});f.vertexArrayDestroyable=!1;let p=new Cn.Attribute;p.semantic=pt.POSITION,p.componentDatatype=q.FLOAT,p.type=rn.VEC3,p.count=i,p.min=a,p.max=l,p.buffer=u;let y=new Cn.Attribute;y.semantic=pt.FEATURE_ID,y.setIndex=0,y.componentDatatype=q.FLOAT,y.type=rn.SCALAR,y.count=i,y.buffer=f;let h=[p,y],g=new Cn.Material;g.unlit=!0;let x=new Cn.FeatureIdAttribute;x.featureCount=o,x.propertyTableId=0,x.setIndex=0,x.positionalLabel="featureId_0";let S=[x],V=new Cn.Primitive;return V.attributes=h,V.featureIds=S,V.primitiveType=ve.POINTS,V.material=g,V}function VDe(e,t){let n=new fDe,i=TDe[e.type];c(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new le("GeoJSON must have at least one feature");let s={};for(let F=0;F<r;F++){let b=o[F].properties??z.EMPTY_OBJECT;for(let G in b)b.hasOwnProperty(G)&&(c(s[G])||(s[G]=new Array(r)))}for(let F=0;F<r;F++){let N=o[F];for(let b in s)if(s.hasOwnProperty(b)){let G=N.properties[b]??"";s[b][F]=G}}let a=new ab({count:r,properties:s}),d=[new qc({id:0,count:r,jsonMetadataTable:a})],u=Cd.fromJson({}),f=new Ds({schema:u,propertyTables:d}),p=new m(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),y=new m(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),h=!1,g=!1;for(let F=0;F<r;F++){let N=o[F];if(c(N.lines)){h=!0;let b=N.lines.length;for(let G=0;G<b;G++){let X=N.lines[G],W=X.length;for(let A=0;A<W;A++)m.minimumByComponent(p,X[A],p),m.maximumByComponent(y,X[A],y)}}if(c(N.points)){g=!0;let b=N.points.length;for(let G=0;G<b;G++){let X=N.points[G];m.minimumByComponent(p,X,p),m.maximumByComponent(y,X,y)}}}let x=m.midpoint(p,y,new m),S=m.fromDegrees(x.x,x.y,x.z,re.WGS84,new m),V=wt.eastNorthUpToFixedFrame(S,re.WGS84,new M),Z=M.inverseTransformation(V,new M),R=[];h&&R.push(SDe(o,Z,t)),g&&R.push(CDe(o,Z,t));let E=new Cn.Node;E.index=0,E.primitives=R;let I=[E],v=new Cn.Scene;v.nodes=I;let P=new Cn.Components;return P.scene=v,P.nodes=I,P.transform=V,P.structuralMetadata=f,P}Vy.prototype.unload=function(){this._components=void 0};var JI=Vy;var KRn=_(T(),1);var yRn=_(T(),1);var nk={};nk._deprecationWarning=Cs;var Ly=Uint32Array.BYTES_PER_ELEMENT;nk.parse=function(e,t){C.defined("arrayBuffer",e);let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Ly;let r=o.getUint32(t,!0);if(r!==1)throw new le(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=Ly;let s=o.getUint32(t,!0);t+=Ly;let a=o.getUint32(t,!0);if(a===0)throw new le("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Ly;let l=o.getUint32(t,!0);t+=Ly;let d=o.getUint32(t,!0);t+=Ly;let u=o.getUint32(t,!0);t+=Ly;let f=o.getUint32(t,!0);if(f!==1&&f!==0)throw new le(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${f} is not.`);t+=Ly;let p=er(i,t,a);t+=a;let y=new Uint8Array(e,t,l);t+=l;let h,g;d>0&&(h=er(i,t,d),t+=d,u>0&&(g=new Uint8Array(e,t,u),g=new Uint8Array(g),t+=u));let x=n+s-t;if(x===0)throw new le("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,x):(nk._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+x))),{gltfFormat:f,featureTableJson:p,featureTableBinary:y,batchTableJson:h,batchTableBinary:g,gltf:S}};var QI=nk;var fb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},ik=Cn.Attribute,LDe=Cn.FeatureIdAttribute,sae=Cn.Instances;function hb(e){e=e??z.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,l=e.upAxis??Po.Y,d=e.forwardAxis??Po.X,u=e.loadAttributesAsTypedArray??!1,f=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,y=e.enablePick??!1;C.typeOf.object("options.i3dmResource",t),C.typeOf.object("options.arrayBuffer",n),i=c(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=l,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=f,this._loadPrimitiveOutline=p,this._enablePick=y,this._state=fb.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}c(Object.create)&&(hb.prototype=Object.create(Ji.prototype),hb.prototype.constructor=hb);Object.defineProperties(hb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});hb.prototype.load=function(){if(c(this._promise))return this._promise;let e=QI.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new of(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!c(a))throw new le("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let l=s.getGlobalProperty("RTC_CENTER",q.FLOAT,3);c(l)&&(this._transform=M.fromTranslation(m.fromArray(l))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let f=Il(e.gltf);f=f.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:f});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new nf(d);return this._gltfLoader=u,this._state=fb.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=fb.PROCESSING,this}).catch(f=>{if(!this.isDestroyed())throw ZDe(this,f)}),this._promise};function ZDe(e,t){return e.unload(),e._state=fb.FAILED,e.getError("Failed to load i3dm",t)}hb.prototype.process=function(e){if(C.typeOf.object("frameState",e),this._state===fb.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===fb.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),EDe(this,i,e),RDe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=fb.READY,!0};function RDe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(c(n.json))o=mb({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new qc({name:Jm.BATCH_TABLE_CLASS_NAME,count:i});o=new Ds({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var ok=new m,gz=new Array(4),GDe=new M;function EDe(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"),l=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=IDe(o,r),f;l&&(f=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let y=new Float32Array(r),h=m.unpackArray(u),g=new m,x=new m,S=new m,V=new m,Z=new te,R=new Fe,E=new Array(4),I=new m,v=new Array(3),P=new M;if(!c(s)||m.equals(m.unpack(s),m.ZERO)){let O=ue.fromPoints(h);for(i=0;i<h.length;i++)m.subtract(h[i],O.center,ok),u[3*i+0]=ok.x,u[3*i+1]=ok.y,u[3*i+2]=ok.z;let H=M.fromTranslation(O.center,GDe);t.transform=M.multiplyTransformation(H,t.transform,t.transform)}for(i=0;i<r;i++){g=m.clone(h[i]),c(s)&&m.add(g,m.unpack(s),g),l&&(WDe(o,a,i,R,g,S,x,V,Z,P),Fe.pack(R,E,0),f[4*i+0]=E[0],f[4*i+1]=E[1],f[4*i+2]=E[2],f[4*i+3]=E[3]),d&&(wDe(o,i,I),m.pack(I,v,0),p[3*i+0]=v[0],p[3*i+1]=v[1],p[3*i+2]=v[2]);let O=o.getProperty("BATCH_ID",q.UNSIGNED_SHORT,1,i);c(O)||(O=i),y[i]=O}let F=new sae;F.transformInWorldSpace=!0;let N=e._buffers,b=new ik;if(b.name="Instance Translation",b.semantic=ns.TRANSLATION,b.componentDatatype=q.FLOAT,b.type=rn.VEC3,b.count=r,b.typedArray=u,!l){let O=_t.createVertexBuffer({context:n.context,typedArray:u,usage:Ne.STATIC_DRAW});O.vertexArrayDestroyable=!1,N.push(O),b.buffer=O}if(F.attributes.push(b),l){let O=new ik;O.name="Instance Rotation",O.semantic=ns.ROTATION,O.componentDatatype=q.FLOAT,O.type=rn.VEC4,O.count=r,O.typedArray=f,F.attributes.push(O)}if(d){let O=new ik;if(O.name="Instance Scale",O.semantic=ns.SCALE,O.componentDatatype=q.FLOAT,O.type=rn.VEC3,O.count=r,l)O.typedArray=p;else{let H=_t.createVertexBuffer({context:n.context,typedArray:p,usage:Ne.STATIC_DRAW});H.vertexArrayDestroyable=!1,N.push(H),O.buffer=H}F.attributes.push(O)}let G=new ik;G.name="Instance Feature ID",G.setIndex=0,G.semantic=ns.FEATURE_ID,G.componentDatatype=q.FLOAT,G.type=rn.SCALAR,G.count=r;let X=_t.createVertexBuffer({context:n.context,typedArray:y,usage:Ne.STATIC_DRAW});X.vertexArrayDestroyable=!1,N.push(X),G.buffer=X,F.attributes.push(G);let W=new LDe;W.propertyTableId=0,W.setIndex=0,W.positionalLabel="instanceFeatureId_0",F.featureIds.push(W);let A=t.nodes,k=A.length,B=!1;for(i=0;i<k;i++){let O=A[i];O.primitives.length>0&&(O.instances=B?XDe(F):F,B=!0)}}function XDe(e){let t=new sae;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=He(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function IDe(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(!c(i))throw new le("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",q.FLOAT,3);if(!c(o))throw new le("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 l=3*s+a;r[l]=n[l]/65535*o[a]+i[a]}return r}else throw new le("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var rae=new Array(4);function WDe(e,t,n,i,o,r,s,a,l,d){let u=e.getProperty("NORMAL_UP",q.FLOAT,3,n,gz),f=e.getProperty("NORMAL_RIGHT",q.FLOAT,3,n,rae),p=!1;if(c(u)){if(!c(f))throw new le("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");m.unpack(u,0,r),m.unpack(f,0,s),p=!0}else{let y=e.getProperty("NORMAL_UP_OCT32P",q.UNSIGNED_SHORT,2,n,gz),h=e.getProperty("NORMAL_RIGHT_OCT32P",q.UNSIGNED_SHORT,2,n,rae);if(c(y)){if(!c(h))throw new le("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Fn.octDecodeInRange(y[0],y[1],65535,r),Fn.octDecodeInRange(h[0],h[1],65535,s),p=!0}else t?(wt.eastNorthUpToFixedFrame(o,re.WGS84,d),M.getMatrix3(d,l)):te.clone(te.IDENTITY,l)}p&&(m.cross(s,r,a),m.normalize(a,a),te.setColumn(l,0,s,l),te.setColumn(l,1,r,l),te.setColumn(l,2,a,l)),Fe.fromRotationMatrix(l,i)}function wDe(e,t,n){n=m.fromElements(1,1,1,n);let i=e.getProperty("SCALE",q.FLOAT,1,t);c(i)&&m.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",q.FLOAT,3,t,gz);c(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function PDe(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}hb.prototype.isUnloaded=function(){return this._state===fb.UNLOADED};hb.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),PDe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=fb.UNLOADED};var jI=hb;var CEn=_(T(),1);var mEn=_(T(),1);var QRn=_(T(),1),vDe={STOPPED:0,ANIMATING:1},rf=Object.freeze(vDe);var oEn=_(T(),1);var cGn=_(T(),1);var iGn=_(T(),1);function qC(){this.times=void 0,this.points=void 0,L.throwInstantiationError()}qC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof m)return m;if(e instanceof Fe)return Fe;throw new L("point must be a Cartesian3, Quaternion, or number.")};qC.prototype.evaluate=L.throwInstantiationError;qC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(C.typeOf.number("time",e),e<n[0]||e>n[i-1])throw new L("time is out of range.");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};qC.prototype.wrapTime=function(e){C.typeOf.number("time",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};qC.prototype.clampTime=function(e){C.typeOf.number("time",e);let t=this.times;return w.clamp(e,t[0],t[t.length-1])};var Pi=qC;function $C(e){this._value=e,this._valueType=Pi.getPointType(e)}Object.defineProperties($C.prototype,{value:{get:function(){return this._value}}});$C.prototype.findTimeInterval=function(e){throw new L("findTimeInterval cannot be called on a ConstantSpline.")};$C.prototype.wrapTime=function(e){return C.typeOf.number("time",e),0};$C.prototype.clampTime=function(e){return C.typeOf.number("time",e),0};$C.prototype.evaluate=function(e,t){C.typeOf.number("time",e);let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var qI=$C;var IGn=_(T(),1);var pGn=_(T(),1);function e1(e){e=e??z.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new L("points and times are required.");if(t.length<2)throw new L("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new L("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Pi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(e1.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});e1.prototype.findTimeInterval=Pi.prototype.findTimeInterval;e1.prototype.wrapTime=Pi.prototype.wrapTime;e1.prototype.clampTime=Pi.prototype.clampTime;e1.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]:(c(t)||(t=new m),m.lerp(n[o],n[o+1],r,t))};var Zy=e1;var _Gn=_(T(),1);var aae={};aae.solve=function(e,t,n,i){if(!c(e)||!(e instanceof Array))throw new L("The array lower is required.");if(!c(t)||!(t instanceof Array))throw new L("The array diagonal is required.");if(!c(n)||!(n instanceof Array))throw new L("The array upper is required.");if(!c(i)||!(i instanceof Array))throw new L("The array right is required.");if(t.length!==i.length)throw new L("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new L("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new L("lower and upper must be one less than the length of diagonal.");let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new m,s[a]=new m;o[0]=n[0]/t[0],r[0]=m.multiplyByScalar(i[0],1/t[0],r[0]);let l;for(a=1;a<o.length;++a)l=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*l,r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],l,r[a]);for(l=1/(t[a]-o[a-1]*e[a-1]),r[a]=m.subtract(i[a],m.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=m.multiplyByScalar(r[a],l,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=m.subtract(r[a],m.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var t1=aae;var cae=[],lae=[],dae=[],uae=[];function FDe(e,t,n){let i=cae,o=dae,r=lae,s=uae;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let l=s[0];for(c(l)||(l=s[0]=new m),m.clone(t,l),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new m),m.subtract(e[a+1],e[a-1],l),m.multiplyByScalar(l,3,l);return i[a]=0,o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new m),m.subtract(e[a+1],e[a-1],l),m.multiplyByScalar(l,3,l),r[a+1]=1,l=s[a+1],c(l)||(l=s[a+1]=new m),m.clone(n,l),t1.solve(i,r,o,s)}function ADe(e){let t=cae,n=dae,i=lae,o=uae;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(c(s)||(s=o[0]=new m),m.subtract(e[1],e[0],s),m.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],c(s)||(s=o[r]=new m),m.subtract(e[r+1],e[r-1],s),m.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],c(s)||(s=o[r]=new m),m.subtract(e[r],e[r-1],s),m.multiplyByScalar(s,3,s),t1.solve(t,i,n,o)}function Ml(e){e=e??z.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;if(!c(t)||!c(n)||!c(i)||!c(o))throw new L("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new L("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new L("times.length must be equal to points.length.");if(i.length!==o.length||i.length!==t.length-1)throw new L("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=n,this._points=t,this._pointType=Pi.getPointType(t[0]),this._pointType!==Pi.getPointType(i[0])||this._pointType!==Pi.getPointType(o[0]))throw new L("inTangents and outTangents must be of the same type as points.");this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(Ml.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}}});Ml.createC1=function(e){e=e??z.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents;if(!c(n)||!c(t)||!c(i))throw new L("points, times and tangents are required.");if(n.length<2)throw new L("points.length must be greater than or equal to 2.");if(t.length!==n.length||t.length!==i.length)throw new L("times, points and tangents must have the same length.");let o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Ml({times:t,points:n,inTangents:r,outTangents:o})};Ml.createNaturalCubic=function(e){e=e??z.EMPTY_OBJECT;let t=e.times,n=e.points;if(!c(n)||!c(t))throw new L("points and times are required.");if(n.length<2)throw new L("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new L("times.length must be equal to points.length.");if(n.length<3)return new Zy({points:n,times:t});let i=ADe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new Ml({times:t,points:n,inTangents:r,outTangents:o})};Ml.createClampedCubic=function(e){e=e??z.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent;if(!c(n)||!c(t)||!c(i)||!c(o))throw new L("points, times, firstTangent and lastTangent are required.");if(n.length<2)throw new L("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new L("times.length must be equal to points.length.");let r=Pi.getPointType(n[0]);if(r!==Pi.getPointType(i)||r!==Pi.getPointType(o))throw new L("firstTangent and lastTangent must be of the same type as points.");if(n.length<3)return new Zy({points:n,times:t});let s=FDe(n,i,o),a=s.slice(0,s.length-1),l=s.slice(1,s.length);return new Ml({times:t,points:n,inTangents:l,outTangents:a})};Ml.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Ml.prototype.findTimeInterval=Pi.prototype.findTimeInterval;var MDe=new ce,n1=new m;Ml.prototype.wrapTime=Pi.prototype.wrapTime;Ml.prototype.clampTime=Pi.prototype.clampTime;Ml.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],l=(e-i[s])/a,d=MDe;d.z=l,d.y=l*l,d.x=d.y*l,d.w=1;let u=M.multiplyByVector(Ml.hermiteCoefficientMatrix,d,d);u.z*=a,u.w*=a;let f=this._pointType;return f===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(c(t)||(t=new f),t=f.multiplyByScalar(n[s],u.x,t),f.multiplyByScalar(n[s+1],u.y,n1),f.add(t,n1,t),f.multiplyByScalar(r[s],u.z,n1),f.add(t,n1,t),f.multiplyByScalar(o[s],u.w,n1),f.add(t,n1,t))};var Ry=Ml;var AGn=_(T(),1);function i1(e){e=e??z.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new L("points and times are required.");if(t.length<2)throw new L("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new L("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Pi.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(i1.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});i1.prototype.findTimeInterval=Pi.prototype.findTimeInterval;i1.prototype.wrapTime=Pi.prototype.wrapTime;i1.prototype.clampTime=Pi.prototype.clampTime;i1.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]:(c(t)||(t=new o),o.clone(n[i],t))};var $I=i1;var BGn=_(T(),1);function NDe(e){let t=e.points,n=e.times;return function(i,o){c(o)||(o=new Fe);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],l=t[r+1];return Fe.fastSlerp(a,l,s,o)}}function o1(e){e=e??z.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new L("points and times are required.");if(t.length<2)throw new L("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new L("times.length must be equal to points.length.");this._times=n,this._points=t,this._evaluateFunction=NDe(this),this._lastTimeIndex=0}Object.defineProperties(o1.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});o1.prototype.findTimeInterval=Pi.prototype.findTimeInterval;o1.prototype.wrapTime=Pi.prototype.wrapTime;o1.prototype.clampTime=Pi.prototype.clampTime;o1.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var eW=o1;var r1=Cn.AnimatedPropertyType;function xz(e){e=e??z.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;C.typeOf.object("options.channel",t),C.typeOf.object("options.runtimeAnimation",n),C.typeOf.object("options.runtimeNode",i),this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,BDe(this)}Object.defineProperties(xz.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 kDe(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 Ry({times:e,points:n,inTangents:i,outTangents:o})}function mae(e,t,n,i){if(e.length===1&&t.length===1)return new qI(t[0]);switch(n){case ef.STEP:return new $I({times:e,points:t});case ef.CUBICSPLINE:return kDe(e,t);case ef.LINEAR:return i===r1.ROTATION?new eW({times:e,points:t}):new Zy({times:e,points:t})}}function UDe(e,t,n,i,o){let r=[];if(i===r1.WEIGHTS){let a=t.length/o,l,d;for(l=0;l<o;l++){let u=new Array(a),f=l;if(n===ef.CUBICSPLINE)for(d=0;d<a;d+=3)u[d]=t[f],u[d+1]=t[f+o],u[d+2]=t[f+2*o],f+=o*3;else for(d=0;d<a;d++)u[d]=t[f],f+=o;r.push(mae(e,u,n,i))}}else r.push(mae(e,t,n,i));return r}var ODe=new m,DDe=new Fe;function BDe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,l=e._runtimeNode,d=c(l.morphWeights)?l.morphWeights.length:1,u=UDe(i,o,r,a,d);e._splines=u,e._path=a}xz.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===r1.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let l=t[a],d=i.clampAnimations?l.clampTime(e):l.wrapTime(e);r[a]=l.evaluate(d)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===r1.TRANSLATION||n===r1.SCALE?o[n]=r.evaluate(s,ODe):n===r1.ROTATION&&(o[n]=r.evaluate(s,DDe))}}};var tW=xz;function _z(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=ee.clone(n.startTime),this._delay=n.delay??0,this._stopTime=ee.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Al.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new ye,this.update=new ye,this.stop=new ye,this._state=rf.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,YDe(this)}Object.defineProperties(_z.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}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function YDe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let l=0;l<s;l++){let d=r[l],u=d.target;if(!c(u))continue;let f=u.node.index,p=i._runtimeNodes[f],y=new tW({channel:d,runtimeAnimation:e,runtimeNode:p}),h=d.sampler.input;t=Math.min(t,h[0]),n=Math.max(n,h[h.length-1]),a.push(y)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}_z.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var nW=_z;function pb(e){this.animationAdded=new ye,this.animationRemoved=new ye,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(pb.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function Tz(e,t,n){let i=e._model,o=new nW(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}pb.prototype.add=function(e){e=e??z.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new L("Animations are not loaded.  Wait for Model.ready to be true.");let n=t.sceneGraph.components.animations;if(!c(e.name)&&!c(e.index))throw new L("Either options.name or options.index must be defined.");if(c(e.multiplier)&&e.multiplier<=0)throw new L("options.multiplier must be greater than zero.");if(c(e.index)&&(e.index>=n.length||e.index<0))throw new L("options.index must be a valid animation index.");let i=e.index;if(c(i))return Tz(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}if(!c(i))throw new L("options.name must be a valid animation name.");return Tz(this,n[i],e)};pb.prototype.addAll=function(e){e=e??z.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new L("Animations are not loaded.  Wait for Model.ready to be true.");if(c(e.multiplier)&&e.multiplier<=0)throw new L("options.multiplier must be greater than zero.");let n=t.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=Tz(this,n[r],e);i.push(s)}return i};pb.prototype.remove=function(e){if(!c(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};pb.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])};pb.prototype.contains=function(e){return c(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};pb.prototype.get=function(e){if(!c(e))throw new L("index is required.");if(e>=this._runtimeAnimations.length||e<0)throw new L("index must be valid within the range of the collection");return this._runtimeAnimations[e]};var rk=[];function HDe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}pb.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&ee.equals(e.time,this._previousTime))return!1;this._previousTime=ee.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];c(a._computedStartTime)||(a._computedStartTime=ee.addSeconds(a.startTime??o,a.delay,new ee)),c(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let l=a._computedStartTime,d=a._duration,u=a.stopTime,f=ee.lessThanOrEquals(l,o),p=c(u)&&ee.greaterThan(o,u),y=0;if(d!==0){let x=ee.secondsDifference(p?u:o,l);y=c(a._animationTime)?a._animationTime(d,x):x/d}let h=a.loop===Al.REPEAT||a.loop===Al.MIRRORED_REPEAT,g=(f||h&&!c(a.startTime))&&(y<=1||h)&&!p;if(y===a._prevAnimationDelta){let x=a._state===rf.STOPPED;if(g!==x)continue}if(a._prevAnimationDelta=y,g||a._state===rf.ANIMATING){if(g&&a._state===rf.STOPPED&&(a._state=rf.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Al.REPEAT)y=y-Math.floor(y);else if(a.loop===Al.MIRRORED_REPEAT){let V=Math.floor(y),Z=y-V;y=V%2===1?1-Z:Z}let x=a.startOffset;a.reverse&&(y=1-y,x=-x);let S=y*d*a.multiplier+x;S=w.clamp(S,a.localStartTime,a.localStopTime),a.animate(S),a.update.numberOfListeners>0&&(a._updateEventTime=S,e.afterRender.push(a._raiseUpdateEvent)),i=!0,g||(a._state=rf.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&rk.push(a))}}n=rk.length;for(let s=0;s<n;++s){let a=rk[s];t.splice(t.indexOf(a),1),e.afterRender.push(HDe(this,r,a))}return rk.length=0,i};var iW=pb;var BEn=_(T(),1);var REn=_(T(),1);function G_(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(G_.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return c(this._color)||(this._color=new Y),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}}});G_.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};G_.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};G_.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};G_.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};G_.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var oW=G_;var EEn=_(T(),1),rW={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};rW.getStyleCommandsNeeded=function(e,t){return t===0?rW.ALL_OPAQUE:t===e?rW.ALL_TRANSLUCENT:rW.OPAQUE_AND_TRANSLUCENT};var sf=Object.freeze(rW);var wEn=_(T(),1);var Gy={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Gy.is3DTiles=function(e){switch(C.typeOf.string("modelType",e),e){case Gy.TILE_GLTF:case Gy.TILE_B3DM:case Gy.TILE_I3DM:case Gy.TILE_PNTS:case Gy.TILE_GEOJSON:return!0;case Gy.GLTF:return!1;default:throw new L("modelType is not a valid value.")}};var mr=Object.freeze(Gy);function Ur(e){let t=e.model,n=e.propertyTable;C.typeOf.object("propertyTable",n),C.typeOf.object("model",t),this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=sf.ALL_OPAQUE,zDe(this)}Object.defineProperties(Ur.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return c(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function zDe(e){let t=e._model,n=mr.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 Us(s,o)}else for(o=0;o<i;o++)r[o]=new oW({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Qc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Ur.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=sf.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Ur.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Ur.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Ur.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Ur.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Ur.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Ur.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Ur.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Ur.prototype.getFeature=function(e){return this._features[e]};Ur.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Ur.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Ur.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Ur.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Ur.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Ur.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Ur.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Ur.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Ur.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var KDe=new Y;Ur.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(Qc.DEFAULT_COLOR_VALUE),this.setAllShow(Qc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=c(e.color)?e.color.evaluateColor(n,KDe)??Qc.DEFAULT_COLOR_VALUE:Qc.DEFAULT_COLOR_VALUE,o=c(e.show)?e.show.evaluate(n)??Qc.DEFAULT_SHOW_VALUE:Qc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Ur.prototype.isDestroyed=function(){return!1};Ur.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),he(this)};var sW=Ur;var z9n=_(T(),1);var QEn=_(T(),1);var fae={name:"TilesetPipelineStage"};fae.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,xe.FRAGMENT);let r={u_polygonOffset:function(){return D.ZERO}};e.uniformMap=St(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK};var aW=fae;var aXn=_(T(),1);var qEn=_(T(),1),cW=`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;
vec2 tTrigs = vec2(0.70710678118);
vec2 v = radii * tTrigs;
vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
vec2 q = normalize(p - evolute) * length(v - evolute);
tTrigs = (q + evolute) * inverseRadii;
tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
v = radii * tTrigs;
return v * sign(pos);
}
vec3 computeEllipsoidPositionWC(vec3 positionMC) {
vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);
return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
}
void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {
vec3 fogColor = groundAtmosphereColor.rgb;
const float NONE = 0.0;
if (czm_atmosphereDynamicLighting != NONE) {
float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
fogColor *= darken;
}
#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;
if (false) {
positionWC = computeEllipsoidPositionWC(attributes.positionMC);
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
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;
}
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 {
}
}
`;var eXn=_(T(),1),lW=`void atmosphereStage(ProcessedAttributes attributes) {
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);
czm_computeGroundAtmosphereScattering(
v_positionWC,
lightDirection,
v_atmosphereRayleighColor,
v_atmosphereMieColor,
v_atmosphereOpacity
);
}
`;var hae={name:"AtmospherePipelineStage"};hae.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,xe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,xe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([lW]),i.addFragmentLines([cW]),i.addUniform("bool","u_isInFog",xe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=m.distance(n.camera.positionWC,t.boundingSphere.center);return w.fog(o,n.fog.density)>w.EPSILON3}};var dW=hae;var yXn=_(T(),1);var lXn=_(T(),1),uW=`#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)
{
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)
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);
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
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 pae={name:"ImageBasedLightingPipelineStage"},JDe=new D;pae.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;c(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,xe.FRAGMENT),r.addUniform("vec2","model_iblFactor",xe.FRAGMENT),Bm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",xe.FRAGMENT),c(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,xe.BOTH),c(a)&&c(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,xe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,xe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",xe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,xe.FRAGMENT),c(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||c(s)?(r.addDefine("SPECULAR_IBL",void 0,xe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,xe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",xe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",xe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,xe.FRAGMENT)),r.addFragmentLines(uW);let l={model_iblFactor:function(){return D.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,JDe)},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}};c(s)&&(l.model_specularEnvironmentMaps=function(){return s},l.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=St(l,e.uniformMap)};var mW=pae;var wXn=_(T(),1);var ZXn=_(T(),1);var QDe=w.EPSILON16;function Cz(e){e=e??z.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;C.typeOf.object("options.stage",t),C.typeOf.object("options.runtimeArticulation",n),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(Cz.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){C.typeOf.number("value",e),e=w.clamp(e,this.minimumValue,this.maximumValue),w.equalsEpsilon(this._currentValue,e,QDe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var jDe=new m,Sz=new te;Cz.prototype.applyStageToMatrix=function(e){C.typeOf.object("result",e);let t=this.type,n=this.currentValue,i=jDe,o;switch(t){case yc.XROTATE:o=te.fromRotationX(w.toRadians(n),Sz),e=M.multiplyByMatrix3(e,o,e);break;case yc.YROTATE:o=te.fromRotationY(w.toRadians(n),Sz),e=M.multiplyByMatrix3(e,o,e);break;case yc.ZROTATE:o=te.fromRotationZ(w.toRadians(n),Sz),e=M.multiplyByMatrix3(e,o,e);break;case yc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case yc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case yc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case yc.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case yc.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case yc.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case yc.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var fW=Cz;function sk(e){e=e??z.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;C.typeOf.object("options.articulation",t),C.typeOf.object("options.sceneGraph",n),this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,qDe(this)}Object.defineProperties(sk.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 qDe(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],l=new fW({stage:a,runtimeArticulation:e});o.push(l);let d=a.name;r[d]=l}}sk.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];c(n)&&(n.currentValue=t)};var $De=new M,eBe=new M;sk.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,$De),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,eBe);s.transform=a}};var hW=sk;var OXn=_(T(),1);var vXn=_(T(),1),pW=`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 s1={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};s1.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,xe.FRAGMENT),i.addFragmentLines(pW);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=Xe.TRANSLUCENT),i.addUniform("vec4",s1.COLOR_UNIFORM_NAME,xe.FRAGMENT),o[s1.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",s1.COLOR_BLEND_UNIFORM_NAME,xe.FRAGMENT),o[s1.COLOR_BLEND_UNIFORM_NAME]=function(){return bc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=St(o,e.uniformMap)};var Ey=s1;var qXn=_(T(),1);var BXn=_(T(),1),bW=`#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;
float v = (float(pixY) + 0.5) * pixelHeight;
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
return czm_transformPlane(plane, transform);
}
#else
vec4 getClippingPlane(
highp sampler2D packedClippingPlanes,
int clippingPlaneNumber,
mat4 transform
) {
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
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;
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;
#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 bae={name:"ModelClippingPlanesPipelineStage"},tBe=new D;bae.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,xe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,xe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,xe.FRAGMENT),hs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,xe.FRAGMENT);let s=hs.getTextureResolution(i,o,tBe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,xe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,xe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",xe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",xe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",xe.FRAGMENT),r.addFragmentLines(bW);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let l=Y.clone(i.edgeColor);return l.alpha=i.edgeWidth,l},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=St(a,e.uniformMap)};var yW=bae;var cIn=_(T(),1);var eIn=_(T(),1),gW=`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 nIn=_(T(),1),xW=`void modelClippingPolygonsStage()
{
vec2 clippingPosition = v_clippingPosition;
int regionIndex = v_regionIndex;
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var yae={name:"ModelClippingPolygonsPipelineStage"};yae.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,xe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,xe.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,xe.BOTH),o.addUniform("sampler2D","model_clippingDistance",xe.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",xe.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(gW),o.addFragmentLines(xW);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=St(r,e.uniformMap)};var _W=yae;var mIn=_(T(),1);function gae(e,t){C.typeOf.object("model",e),C.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}Object.defineProperties(gae.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){c(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 TW=gae;var aWn=_(T(),1);var kIn=_(T(),1);var hIn=_(T(),1),SW=`mat4 getInstancingTransform()
{
mat4 instancingTransform;
#ifdef HAS_INSTANCE_MATRICES
instancingTransform = mat4(
a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0,
a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0,
a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0,
a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0
);
#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,
a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0,
a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0,
a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0
);
#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 bIn=_(T(),1),CW=`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 gIn=_(T(),1),VW=`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 ak=new M,nBe=new M,iBe=new M,_ae={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Lae,_transformsToTypedArray:Lz};_ae.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(SW);let s=e.model,a=s.sceneGraph,l=e.runtimeNode,d=n.mode!==se.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,f=[];gBe(e,n,i,f,d,u),TBe(e,n,i,f);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,xe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",xe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",xe.VERTEX),p.u_instance_modifiedModelView=function(){let y=M.multiplyTransformation(s.modelMatrix,a.components.transform,ak);return d?M.multiplyTransformation(n.context.uniformState.view3D,y,ak):(n.mode!==se.SCENE3D&&(y=wt.basisTo2D(n.mapProjection,y,ak)),M.multiplyTransformation(n.context.uniformState.view,y,ak))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,l.computedTransform,nBe)},r.addVertexLines(VW)):r.addVertexLines(CW),d){r.addDefine("USE_2D_INSTANCING",void 0,xe.VERTEX),r.addUniform("mat4","u_modelView2D",xe.VERTEX);let y=n.context,h=M.fromTranslation(l.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(y.uniformState.view,h,iBe)}}e.uniformMap=St(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,f)};var LW=new M,oBe=new m;function rBe(e,t,n,i,o){let r=M.multiplyTransformation(t,e,LW);return r=M.multiplyTransformation(r,n,LW),o=wt.basisTo2D(i.mapProjection,r,o),o}function sBe(e,t,n,i,o){let r=M.fromTranslation(e,LW),s=M.multiplyTransformation(t,r,LW);s=M.multiplyTransformation(s,n,LW);let a=M.getTranslation(s,oBe);return o=Oi.computeActualEllipsoidPosition(i,a,o),o}function Tae(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 Sae=new M,Cae=new M,aBe=new M,cBe=new m;function lBe(e,t,n,i){let o=Sae,r=Cae;Tae(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let d=0;d<l;d++){let u=e[d],f=rBe(u,o,r,n,aBe),p=M.getTranslation(f,cBe),y=m.subtract(p,a,p);i[d]=M.setTranslation(f,y,i[d])}return i}function dBe(e,t,n,i){let o=Sae,r=Cae;Tae(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let d=0;d<l;d++){let u=e[d],f=sBe(u,o,r,n,u);i[d]=m.subtract(f,a,i[d])}return i}var uBe=new m,mBe=new m;function Vae(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=M.multiplyByPoint(i,n.instancingTranslationMin,uBe),r=Oi.computeActualEllipsoidPosition(t,o,o),s=M.multiplyByPoint(i,n.instancingTranslationMax,mBe),a=Oi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=m.lerp(r,a,.5,new m)}function Lz(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 fBe(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 hBe=new m,pBe=new Fe,bBe=new m;function Lae(e,t,n){let i=new Array(t),o=qt.getAttributeBySemantic(e,ns.TRANSLATION),r=qt.getAttributeBySemantic(e,ns.ROTATION),s=qt.getAttributeBySemantic(e,ns.SCALE),a=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=c(o),u=c(r),f=c(s),p=d?o.typedArray:new Float32Array(t*3),y=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(y=Fn.dequantize(y,r.componentDatatype,r.type,t));let h;f?h=s.typedArray:(h=new Float32Array(t*3),h.fill(1));for(let x=0;x<t;x++){let S=new m(p[x*3],p[x*3+1],p[x*3+2],hBe);m.maximumByComponent(a,S,a),m.minimumByComponent(l,S,l);let V=new Fe(y[x*4],y[x*4+1],y[x*4+2],u?y[x*4+3]:1,pBe),Z=new m(h[x*3],h[x*3+1],h[x*3+2],bBe),R=M.fromTranslationQuaternionRotationScale(S,V,Z,new M);i[x]=R}let g=n.runtimeNode;return g.instancingTranslationMin=l,g.instancingTranslationMax=a,d&&(o.typedArray=void 0),u&&(r.typedArray=void 0),f&&(s.typedArray=void 0),i}function yBe(e,t,n){let i=new Array(t),o=e.typedArray,r=new m(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new m(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<t;l++){let d=new m(o[l*3],o[l*3+1],o[l*3+2]);i[l]=d,m.minimumByComponent(r,d,r),m.maximumByComponent(s,d,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function Zz(e,t){let n=_t.createVertexBuffer({context:t.context,typedArray:e,usage:Ne.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function gBe(e,t,n,i,o,r){let s=qt.getAttributeBySemantic(n,ns.ROTATION);c(s)?xBe(e,n,i,t,o,r):_Be(e,n,i,t,o)}function xBe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,l=e.model,d=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",f,p=d.instancingTransformsBuffer;if(!c(p)){f=Lae(t,a,e);let x=Lz(f);p=Zz(x,i),l._modelResources.push(p),r&&(d.transformsTypedArray=x),d.instancingTransformsBuffer=p}if(xae(e,p,n,u),!o)return;let y=He(i);y.mode=se.COLUMBUS_VIEW,Vae(e,y);let h=d.instancingTransformsBuffer2D;if(!c(h)){let x=lBe(f,e,y,f),S=Lz(x);h=Zz(S,i),l._modelResources.push(h),d.instancingTransformsBuffer2D=h}xae(e,h,n,"Transform2D")}function _Be(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,l=qt.getAttributeBySemantic(t,ns.TRANSLATION),d=qt.getAttributeBySemantic(t,ns.SCALE);if(c(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),Vz(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!c(l))return;let u,f=l.typedArray;if(c(f)?u=yBe(l,l.count,e):c(a.instancingTranslationMin)||(a.instancingTranslationMin=l.min,a.instancingTranslationMax=l.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),Vz(e,l.buffer,l.byteOffset,l.byteStride,n,"Translation"),!o&&!r)return;let y=He(i);y.mode=se.COLUMBUS_VIEW,Vae(e,y);let h=a.instancingTranslationBuffer2D;if(!c(h)){let V=dBe(u,e,y,u),Z=fBe(V);r&&(a.transformsTypedArray=Z),h=Zz(Z,i),e.model._modelResources.push(h),a.instancingTranslationBuffer2D=h}if(!o)return;Vz(e,h,0,void 0,n,"Translation2D")}function xae(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}],l=e.shaderBuilder;l.addAttribute("vec4",`a_instancing${i}Row0`),l.addAttribute("vec4",`a_instancing${i}Row1`),l.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function Vz(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 TBe(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===ns.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:rn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var ZW=_ae;var YIn=_(T(),1);var Rz={};Rz.name="ModelMatrixUpdateStage";Rz.update=function(e,t,n){let i=n.mode!==se.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Zae(e,t,o,e.transformToRoot),e._transformDirty=!1}};function SBe(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=qt.getCullFace(e.modelMatrix,e.primitiveType)}function Zae(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];SBe(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),Zae(a,t,n,i),a._transformDirty=!1}}var RW=Rz;var KIn=_(T(),1);var Rae={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:Gae,_countGeneratedBuffers:Eae};Rae.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;Gae(i,o),Eae(i,r)};function Gae(e,t){if(!c(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r.buffer)&&e.addBuffer(r.buffer,!1)}}function Eae(e,t){c(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),c(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),c(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var GW=Rae;function a1(e){e=e??z.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;C.typeOf.object("options.node",t),C.typeOf.object("options.transform",n),C.typeOf.object("options.transformToRoot",i),C.typeOf.object("options.sceneGraph",o),C.typeOf.object("options.children",r),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,CBe(this)}Object.defineProperties(a1.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 c(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new L("The translation of a node cannot be set if it was defined using a matrix in the model.");let n=t.translation;m.equals(n,e)||(t.translation=m.clone(e,t.translation),Gz(this,t))}},rotation:{get:function(){return c(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new L("The rotation of a node cannot be set if it was defined using a matrix in the model.");let n=t.rotation;Fe.equals(n,e)||(t.rotation=Fe.clone(e,t.rotation),Gz(this,t))}},scale:{get:function(){return c(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new L("The scale of a node cannot be set if it was defined using a matrix in the model.");let n=t.scale;m.equals(n,e)||(t.scale=m.clone(e,t.scale),Gz(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;if(this._morphWeights.length!==t)throw new L("value must have the same length as the original weights array.");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 CBe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let o=e.node;c(o.matrix)||(e._transformParameters=new ey(o.translation,o.rotation,o.scale)),c(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(c(r)){let l=e.sceneGraph._runtimeArticulations[r];c(l)&&l.runtimeNodes.push(e)}}function Gz(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}a1.prototype.getChild=function(e){if(C.typeOf.number("index",e),e<0||e>=this.children.length)throw new L("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]};a1.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,c(e.instances)&&t.push(ZW),t.push(GW),n.push(RW)};a1.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};a1.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!c(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){c(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 EW=a1;var gFn=_(T(),1);var fWn=_(T(),1);var Xae={name:"AlphaPipelineStage"};Xae.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Xe.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;c(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,xe.FRAGMENT),s.addUniform("float","u_alphaCutoff",xe.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var XW=Xae;var bWn=_(T(),1);var Iae={name:"BatchTexturePipelineStage"};Iae.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 l=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return l.batchTexture??l.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return l.textureStep},l.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=St(o,e.uniformMap)};var IW=Iae;var CWn=_(T(),1);var Wae={name:"ClassificationPipelineStage"};Wae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,xe.BOTH);let o=e.runtimePrimitive;c(o.batchLengths)||VBe(t,o)};function VBe(e,t){let n=qt.getAttributeBySemantic(e,pt.POSITION);if(!c(n))throw new le("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=c(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=qt.getAttributeBySemantic(e,pt.FEATURE_ID,0);if(!c(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let l=a.typedArray;a.typedArray=void 0;let d=[],u=[0],f=r?i[0]:0,p=l[f],y=0;for(let g=1;g<s;g++){let x=r?i[g]:g,S=l[x];if(S!==p){let V=g-y,Z=g;d.push(V),u.push(Z),y=Z,p=S}}let h=s-y;d.push(h),t.batchLengths=d,t.batchOffsets=u}var WW=Wae;var FWn=_(T(),1);var LWn=_(T(),1),wW=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
{
bool styleTranslucent = (featureColor.a != 1.0);
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
{
#ifdef HAS_SILHOUETTE
positionMC *= float(model_silhouettePass);
#else
positionMC *= 0.0;
#endif
}
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 RWn=_(T(),1),PW=`void filterByPassType(vec4 featureColor)
{
bool styleTranslucent = (featureColor.a != 1.0);
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
{
#ifdef HAS_SILHOUETTE
if(!model_silhouettePass) {
discard;
}
#else
discard;
#endif
}
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 defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
filterByPassType(featureColor);
#endif
featureColor = czm_gammaCorrect(featureColor);
#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 wae={name:"CPUStylingPipelineStage"};wae.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(wW),o.addFragmentLines(PW),o.addDefine("USE_CPU_STYLING",void 0,xe.BOTH),c(i.color)||(o.addUniform("float",Ey.COLOR_BLEND_UNIFORM_NAME,xe.FRAGMENT),e.uniformMap[Ey.COLOR_BLEND_UNIFORM_NAME]=function(){return bc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",xe.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Xe.TRANSLUCENT}};var vW=wae;var MWn=_(T(),1),Pae={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};Pae.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var bb=Object.freeze(Pae);var Pwn=_(T(),1);var kWn=_(T(),1),FW=`void customShaderStage(
inout czm_modelVertexOutput vsOutput,
inout ProcessedAttributes attributes,
FeatureIds featureIds,
Metadata metadata,
MetadataClass metadataClass,
MetadataStatistics metadataStatistics
) {
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 OWn=_(T(),1),AW=`void customShaderStage(
inout czm_modelMaterial material,
ProcessedAttributes attributes,
FeatureIds featureIds,
Metadata metadata,
MetadataClass metadataClass,
MetadataStatistics metadataStatistics
) {
FragmentInput fsInput;
initializeInputStruct(fsInput, attributes);
fsInput.featureIds = featureIds;
fsInput.metadata = metadata;
fsInput.metadataClass = metadataClass;
fsInput.metadataStatistics = metadataStatistics;
fragmentMain(fsInput, material);
}
`;var rwn=_(T(),1);var BWn=_(T(),1),MW=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
}
`;var HWn=_(T(),1),NW=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
{
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
setFeatureIdVaryings();
}
`;var Di={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()"};Di.process=function(e,t,n){let i=e.shaderBuilder;LBe(i);let o=e.runtimeNode.node.instances;c(o)&&ZBe(e,o,n),RBe(e,t,n),i.addVertexLines(NW),i.addFragmentLines(MW)};function LBe(e){e.addStruct(Di.STRUCT_ID_FEATURE_IDS_VS,Di.STRUCT_NAME_FEATURE_IDS,xe.VERTEX),e.addStruct(Di.STRUCT_ID_FEATURE_IDS_FS,Di.STRUCT_NAME_FEATURE_IDS,xe.FRAGMENT),e.addFunction(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Di.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,xe.VERTEX),e.addFunction(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Di.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,xe.FRAGMENT),e.addFunction(Di.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Di.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,xe.VERTEX),e.addFunction(Di.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Di.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,xe.FRAGMENT),e.addFunction(Di.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Di.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,xe.VERTEX)}function ZBe(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 Cn.FeatureIdAttribute?GBe(e,s,a):vae(e,s,a,o,1,n);let l=s.label;c(l)&&Fae(e,a,l,xe.BOTH)}}function RBe(e,t,n){let i=t.featureIds,r=qt.getAttributeBySemantic(t,pt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],l=a.positionalLabel,d=xe.BOTH;a instanceof Cn.FeatureIdAttribute?EBe(e,a,l):a instanceof Cn.FeatureIdImplicitRange?vae(e,a,l,r,void 0,n):(XBe(e,a,l,s,n),d=xe.FRAGMENT);let u=a.label;c(u)&&Fae(e,l,u,d)}}function GBe(e,t,n){let i=e.shaderBuilder;i.addStructField(Di.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Di.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,l=`featureIds.${n} = int(czm_round(${s}));`,d=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[l]),i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(Di.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function EBe(e,t,n){let i=e.shaderBuilder;i.addStructField(Di.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Di.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(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function vae(e,t,n,i,o,r){IBe(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let l=`v_implicit_${n}`;s.addVarying("float",l),s.addStructField(Di.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Di.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Di.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${l} = ${a};`]),s.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${l}));`])}function XBe(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 l=a.channels,d=e.shaderBuilder;d.addStructField(Di.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,xe.FRAGMENT);let f=`v_texCoord_${a.texCoord}`,p=f,y=a.transform;if(c(y)&&!te.equals(y,te.IDENTITY)){let x=`${r}Transform`;d.addUniform("mat3",x,xe.FRAGMENT),s[x]=function(){return y},p=`vec2(${x} * vec3(${f}, 1.0))`}let h=`texture(${r}, ${p}).${l}`,g=`featureIds.${n} = czm_unpackUint(${h});`;d.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[g])}function Fae(e,t,n,i){let o=e.shaderBuilder,r=xe.includesVertexShader(i);r&&o.addStructField(Di.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Di.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function IBe(e,t,n,i,o){let r=e.model,s,a;if(c(t.repeat)){let d=WBe(t,n);s=_t.createVertexBuffer({context:o.context,typedArray:d,usage:Ne.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let l={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(l)}function WBe(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 Xy=Di;var gwn=_(T(),1);var awn=_(T(),1),kW=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var lwn=_(T(),1),UW=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
setMetadataVaryings();
}
`;var Gi={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"}]};Gi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,l=wBe(r.propertyAttributes,t,a),d=vBe(r.propertyTextures,a),u=l.concat(d);ABe(i,u),kBe(i),i.addVertexLines(UW),i.addFragmentLines(kW);for(let f=0;f<l.length;f++){let p=l[f];UBe(e,p)}for(let f=0;f<d.length;f++){let p=d[f];DBe(e,p)}};function wBe(e,t,n){return c(e)?e.flatMap(i=>PBe(i,t,n)):[]}function PBe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=qt,s=e.class.id,a=n?.classes[s],l=Object.entries(e.properties),d=new Array(l.length);for(let u=0;u<l.length;u++){let[f,p]=l[u],y=i(t,p.attribute),{glslType:h,variableName:g}=o(y);d[u]={metadataVariable:r(f),property:p,type:p.classProperty.type,glslType:h,variableName:g,propertyStatistics:a?.properties[f],shaderDestination:xe.BOTH}}return d}function vBe(e,t){return c(e)?e.flatMap(n=>FBe(n,t)):[]}function FBe(e,t){let{sanitizeGlslIdentifier:n}=qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,l])=>l.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[l,d]=r[a];s[a]={metadataVariable:n(l),property:d,type:d.classProperty.type,glslType:d.getGlslType(),propertyStatistics:o?.properties[l],shaderDestination:xe.FRAGMENT}}return s}function ABe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:l,glslType:d,propertyStatistics:u}=t[a];n.add(d),c(u)&&l!==lt.ENUM&&i.add(d)}let o=Gi.METADATA_CLASS_FIELDS;for(let a of n){let l=`${a}MetadataClass`;s(l,a,o)}let r=Gi.METADATA_STATISTICS_FIELDS;for(let a of i){let l=`${a}MetadataStatistics`;s(l,a,r)}function s(a,l,d){e.addStruct(a,a,xe.BOTH);for(let u=0;u<d.length;u++){let{shaderName:f}=d[u],p=d[u].type==="float"?NBe(l):l;e.addStructField(a,p,f)}}}var MBe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function NBe(e){let t=MBe[e];return c(t)?t:e}function kBe(e){e.addStruct(Gi.STRUCT_ID_METADATA_VS,Gi.STRUCT_NAME_METADATA,xe.VERTEX),e.addStruct(Gi.STRUCT_ID_METADATA_FS,Gi.STRUCT_NAME_METADATA,xe.FRAGMENT),e.addStruct(Gi.STRUCT_ID_METADATA_CLASS_VS,Gi.STRUCT_NAME_METADATA_CLASS,xe.VERTEX),e.addStruct(Gi.STRUCT_ID_METADATA_CLASS_FS,Gi.STRUCT_NAME_METADATA_CLASS,xe.FRAGMENT),e.addStruct(Gi.STRUCT_ID_METADATA_STATISTICS_VS,Gi.STRUCT_NAME_METADATA_STATISTICS,xe.VERTEX),e.addStruct(Gi.STRUCT_ID_METADATA_STATISTICS_FS,Gi.STRUCT_NAME_METADATA_STATISTICS,xe.FRAGMENT),e.addFunction(Gi.FUNCTION_ID_INITIALIZE_METADATA_VS,Gi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,xe.VERTEX),e.addFunction(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,Gi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,xe.FRAGMENT),e.addFunction(Gi.FUNCTION_ID_SET_METADATA_VARYINGS,Gi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,xe.VERTEX)}function UBe(e,t){OBe(e,t),Aae(e.shaderBuilder,t),Mae(e.shaderBuilder,t)}function OBe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=kae({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:xe.BOTH,property:o});n.addStructField(Gi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Gi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function DBe(e,t){BBe(e,t),Aae(e.shaderBuilder,t),Mae(e.shaderBuilder,t)}function BBe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:l,index:d,texture:u,transform:f}=s.textureReader,p=`u_propertyTexture_${d}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,xe.FRAGMENT),i[p]=()=>u),n.addStructField(Gi.STRUCT_ID_METADATA_FS,r,o);let y=`attributes.texCoord_${a}`,h=y;if(c(f)&&!te.equals(f,te.IDENTITY)){let Z=`${p}Transform`;n.addUniform("mat3",Z,xe.FRAGMENT),i[Z]=function(){return f},h=`vec2(${Z} * vec3(${y}, 1.0))`}let g=`texture(${p}, ${h}).${l}`,x=s.unpackInShader(g),S=kae({valueExpression:x,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:xe.FRAGMENT,property:s}),V=`metadata.${o} = ${S};`;n.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function Aae(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Nae(Gi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Gi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),xe.includesVertexShader(r)&&(e.addStructField(Gi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function Mae(e,t){let{propertyStatistics:n}=t;if(!c(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===lt.ENUM)return;let s=Gi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,l=Nae(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Gi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_FS,l),xe.includesVertexShader(t.shaderDestination)&&(e.addStructField(Gi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Gi.FUNCTION_ID_INITIALIZE_METADATA_VS,l))}function Nae(e,t,n,i){function o(r){let s=t[r.specName];if(c(s))return`${n}.${r.shaderName} = ${i}(${s});`}return c(t)?e.map(o).filter(c):[]}function kae(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:l,shaderDestination:d}=e;s.addUniform(l,o,d),s.addUniform(l,r,d);let{offset:u,scale:f}=n;return a[o]=()=>u,a[r]=()=>f,`czm_valueTransform(${o}, ${r}, ${t})`}var Fu=Gi;var _wn=_(T(),1),YBe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Iy=Object.freeze(YBe);var pa={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:ht};pa.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:l}=s;c(a)&&(e.lightingOptions.lightingModel=a),l===Iy.TRANSLUCENT?r.pass=Xe.TRANSLUCENT:l===Iy.OPAQUE&&(r.pass=void 0);let d=$Be(s,t);if(!d.customShaderEnabled)return;if(i3e(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,xe.BOTH),c(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,xe.VERTEX),c(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,xe.FRAGMENT);let p=bb.getDefineName(s.mode);i.addDefine(p,void 0,xe.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let y=u[p];i.addUniform(y.type,p)}let f=s.varyings;for(let p in f)if(f.hasOwnProperty(p)){let y=f[p];i.addVarying(y,p)}e.uniformMap=St(e.uniformMap,s.uniformMap)};function HBe(e){let t={};for(let n=0;n<e.length;n++){let i=qt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var zBe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},KBe={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 Uae(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=zBe[t],i=KBe[t];if(c(n))return{attributeField:[n,e],value:i}}function JBe(e,t){if(!c(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=Oae(t,n,!1),o=Dae(t,n,!1),r,s=[],a=[];for(let l in i){if(!i.hasOwnProperty(l))continue;let u=[i[l].glslType,l];s.push(u),r=`vsInput.attributes.${l} = attributes.${l};`,a.push(r)}for(let l=0;l<o.length;l++){let d=o[l],u=Uae(d);if(!c(u))return pa._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};s.push(u.attributeField),r=`vsInput.attributes.${d} = ${u.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function QBe(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 jBe(e,t){if(!c(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=Oae(t,n,!0),o=Dae(t,n,!0),r,s=[],a=[];for(let d in i){if(!i.hasOwnProperty(d))continue;let f=[i[d].glslType,d];s.push(f),r=`fsInput.attributes.${d} = attributes.${d};`,a.push(r)}for(let d=0;d<o.length;d++){let u=o[d],f=Uae(u);if(!c(f))return pa._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${u}, disabling custom fragment shader.`),{enabled:!1};s.push(f.attributeField),r=`fsInput.attributes.${u} = ${f.value};`,a.push(r)}let l=QBe(e);return{enabled:!0,attributeFields:s.concat(l.attributeFields),initializationLines:l.initializationLines.concat(a)}}var qBe={positionWC:!0,positionEC:!0};function Oae(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 Dae(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||qBe.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 $Be(e,t){let n=HBe(t.attributes),i=JBe(e,n),o=jBe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function e3e(e,t){let n=pa.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,pa.STRUCT_NAME_ATTRIBUTES,xe.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=pa.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,pa.STRUCT_NAME_VERTEX_INPUT,xe.VERTEX),e.addStructField(n,pa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Xy.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Fu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Fu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Fu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=pa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,pa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,xe.VERTEX),e.addFunctionLines(r,o)}function t3e(e,t){let n=pa.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,pa.STRUCT_NAME_ATTRIBUTES,xe.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=pa.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,pa.STRUCT_NAME_FRAGMENT_INPUT,xe.FRAGMENT),e.addStructField(n,pa.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Xy.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Fu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Fu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Fu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=pa.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,pa.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,xe.FRAGMENT),e.addFunctionLines(r,o)}var n3e=[];function i3e(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=n3e;i.enabled&&(e3e(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,FW),e.addVertexLines(r)),o.enabled&&(t3e(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,AW),e.addFragmentLines(r))}var OW=pa;var Uwn=_(T(),1);var DW={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};DW.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=c(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,xe.VERTEX),i.addFunction(DW.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,DW.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,xe.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let l=s[a],d=l.quantization;if(!c(d))continue;let u=l.semantic===pt.POSITION,f=l.semantic===pt.TEXCOORD;if(r&&!u&&!f)continue;let p=qt.getAttributeInfo(l);r3e(i,p),o3e(e,p)}};function o3e(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,xe.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,l=t.glslType;n.addUniform(l,s,xe.VERTEX),n.addUniform(l,a,xe.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=Bae(d,0),u=Bae(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function Bae(e,t){return e instanceof ce?e:new ce(e.x,e.y,e.z,t)}function r3e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=s3e(n,i):o=a3e(n),e.addFunctionLines(DW.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function s3e(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 a3e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var BW=DW;var pPn=_(T(),1);var Dwn=_(T(),1),YW=`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
attributes.normalEC = normalize(v_normalEC);
#endif
#ifdef HAS_TANGENTS
attributes.tangentEC = normalize(v_tangentEC);
#endif
#ifdef HAS_BITANGENTS
attributes.bitangentEC = normalize(v_bitangentEC);
#endif
setDynamicVaryings(attributes);
}
`;var Ywn=_(T(),1),HW=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
{
vec4 computedPosition;
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
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
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
setDynamicVaryings(attributes);
return computedPosition;
}
`;var ePn=_(T(),1);var zwn=_(T(),1),c1=`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);
}
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 zW={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};zW.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=c3e(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),l3e(i);let l=s.featureIds.nullFeatureId,d=e.uniformMap;c(l)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return l}),s.shaderDestination===xe.BOTH&&i.addVertexLines(c1),i.addFragmentLines(c1)};function Yae(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Hae(e){return e instanceof Cn.FeatureIdTexture?xe.FRAGMENT:xe.BOTH}function c3e(e,t,n){let i,o;return c(t.instances)&&(o=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Hae(o),featureIdDefine:Yae(o)}):(o=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Hae(o),featureIdDefine:Yae(o)})}function l3e(e){e.addStructField(zW.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(zW.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(zW.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Wy=zW;var Bs={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)"};Bs.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",xe.VERTEX),i.addStruct(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",xe.FRAGMENT),i.addStruct(Wy.STRUCT_ID_SELECTED_FEATURE,Wy.STRUCT_NAME_SELECTED_FEATURE,xe.BOTH),i.addFunction(Bs.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Bs.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,xe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,xe.VERTEX),i.addFunction(Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Bs.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,xe.FRAGMENT),o.type===mr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,xe.FRAGMENT);let r=n.mode!==se.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=c(e.runtimeNode.node.instances),a=r&&!s,l=t.attributes.length;for(let d=0;d<l;d++){let u=t.attributes[d],f=rn.getAttributeLocationCount(u.type);if(!c(u.buffer)&&!c(u.constant))throw new L("Attributes must be provided as a Buffer or constant value");let p=u.semantic===pt.POSITION,y;f>1?(y=e.attributeIndex,e.attributeIndex+=f):p&&!a?y=0:y=e.attributeIndex++,d3e(e,u,y,f,r,s)}x3e(i,t.attributes),t.primitiveType===ve.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(HW),i.addFragmentLines(YW)};function d3e(e,t,n,i,o,r){let s=e.shaderBuilder,a=qt.getAttributeInfo(t),l=o&&!r;i>1?f3e(e,t,n,i):m3e(e,t,n,l),p3e(s,a,l),h3e(s,a),c(t.semantic)&&u3e(s,t),b3e(s,a,o),y3e(s,a,l),g3e(s,a)}function u3e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case pt.NORMAL:e.addDefine("HAS_NORMALS");break;case pt.TANGENT:e.addDefine("HAS_TANGENTS");break;case pt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case pt.TEXCOORD:case pt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function m3e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:l}=c(o)?o:t;r===pt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===pt.POSITION,u=d?0:n,f=rn.getNumberOfComponents(a),p={index:u,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:f,componentDatatype:l,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let y=e.runtimePrimitive.positionBuffer2D,h={index:n,vertexBuffer:y,count:t.count,componentsPerAttribute:f,componentDatatype:q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(h)}function f3e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=c(o)?o:t,d=rn.getNumberOfComponents(s)/i,u=q.getSizeInBytes(a),f=d*u,p=t.byteStride;for(let y=0;y<i;y++){let h=t.byteOffset+y*f,g={index:n+y,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:h,strideInBytes:p,normalize:r};e.attributes.push(g)}}function h3e(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 p3e(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===pt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function b3e(e,t,n){let i=Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Bs.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 y3e(e,t,n){let i=Bs.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 g3e(e,t){let{semantic:n,setIndex:i}=t.attribute;if(c(n)&&!c(i))return;let o=Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Bs.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function x3e(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===pt.NORMAL?n=!0:r.semantic===pt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Bs.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var KW=Bs;var LPn=_(T(),1);var yPn=_(T(),1),JW=`#ifdef USE_IBL_LIGHTING
vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
#if defined(DIFFUSE_IBL) || defined(SPECULAR_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);
vec3 f0 = vec3(0.04);
vec3 f90 = vec3(1.0);
float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
vec3 F = fresnelSchlick2(f0, f90, NdotV);
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
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;
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;
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
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
#ifndef HDR
color = czm_pbrNeutralTonemapping(color);
#endif
#else // unlit
vec3 color = material.diffuse;
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
color = czm_gammaCorrect(color);
#elif !defined(HDR)
color = czm_linearToSrgb(color);
#endif
material.diffuse = color;
}
`;var xPn=_(T(),1),_3e={UNLIT:0,PBR:1},Lh=Object.freeze(_3e);var zae={name:"LightingPipelineStage"};zae.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(c(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,xe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",xe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Lh.PBR?o.addDefine("LIGHTING_PBR",void 0,xe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,xe.FRAGMENT),o.addFragmentLines(JW)};var QW=zae;var UPn=_(T(),1);var RPn=_(T(),1),jW=`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();
#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
#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)
{
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));
material.alpha = diffuse.a;
material.specular = specular;
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
const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);
material.specular = f0;
material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
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
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;
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);
#ifdef HAS_BASE_COLOR_TEXTURE
baseColorWithAlpha = getBaseColorFromTexture();
#elif defined(HAS_BASE_COLOR_FACTOR)
baseColorWithAlpha = u_baseColorFactor;
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
baseColorWithAlpha = v_pointCloudColor;
#elif defined(HAS_COLOR_0)
vec4 color = attributes.color_0;
#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:T3e,MetallicRoughness:Ez,SpecularGlossiness:Xz,Specular:Kae,Clearcoat:Jae}=Cn,Qae={name:"MaterialPipelineStage",_processTexture:Nl,_processTextureTransform:jae};Qae.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=c(o.classificationType),l=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:f}=n.context;C3e(i,r,s,d,u,f,l),c(i.specularGlossiness)?V3e(i.specularGlossiness,r,s,d,l):(c(i.specular)&&qt.supportedExtensions.KHR_materials_specular&&L3e(i.specular,r,s,d,l),c(i.anisotropy)&&qt.supportedExtensions.KHR_materials_anisotropy&&R3e(i.anisotropy,r,s,d,l),c(i.clearcoat)&&qt.supportedExtensions.KHR_materials_clearcoat&&G3e(i.clearcoat,r,s,d,l),E3e(i.metallicRoughness,r,s,d,l));let p=qt.getAttributeBySemantic(t,pt.NORMAL),y=e.lightingOptions;i.unlit||!p||a?y.lightingModel=Lh.UNLIT:y.lightingModel=Lh.PBR;let h=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=h;let g=e.alphaOptions;i.alphaMode===Th.BLEND?g.pass=Xe.TRANSLUCENT:i.alphaMode===Th.MASK&&(g.alphaCutoff=i.alphaCutoff),s.addFragmentLines(jW),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,xe.BOTH)};function jae(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,xe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,xe.FRAGMENT),t[s]=function(){return n.transform}}function S3e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,xe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,xe.FRAGMENT),t[s]=function(){return n.scale}}function Nl(e,t,n,i,o,r){e.addUniform("sampler2D",i,xe.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,xe.FRAGMENT);let l=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,l,xe.FRAGMENT);let u=n.transform;c(u)&&!te.equals(u,te.IDENTITY)&&jae(e,t,n,i,o);let{scale:f}=n;c(f)&&f!==1&&S3e(e,t,n,i,o)}function C3e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:l,normalTexture:d,occlusionTexture:u}=e;c(a)&&!m.equals(a,T3e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",xe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,xe.FRAGMENT),c(l)&&!s&&Nl(n,t,l,"u_emissiveTexture","EMISSIVE",r)),c(d)&&!s&&Nl(n,t,d,"u_normalTexture","NORMAL",o),c(u)&&!s&&Nl(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function V3e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:l,glossinessFactor:d}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,xe.FRAGMENT),c(r)&&!o&&Nl(n,t,r,"u_diffuseTexture","DIFFUSE",i),c(s)&&!ce.equals(s,Xz.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",xe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,xe.FRAGMENT)),c(a)&&!o&&Nl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),c(l)&&!m.equals(l,Xz.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",xe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,xe.FRAGMENT)),c(d)&&d!==Xz.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",xe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,xe.FRAGMENT))}function L3e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:l}=e;n.addDefine("USE_SPECULAR",void 0,xe.FRAGMENT),c(r)&&!o&&Nl(n,t,r,"u_specularTexture","SPECULAR",i),c(s)&&s!==Kae.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",xe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,xe.FRAGMENT)),c(a)&&!o&&Nl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),c(l)&&!m.equals(l,Kae.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",xe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,xe.FRAGMENT))}var Z3e=new m;function R3e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,xe.FRAGMENT),c(a)&&!o&&Nl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let l=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",xe.FRAGMENT),t.u_anisotropy=function(){return m.fromElements(l,d,r,Z3e)}}function G3e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:l,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,xe.FRAGMENT),c(r)&&r!==Jae.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",xe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,xe.FRAGMENT)),c(s)&&!o&&Nl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),c(a)&&r!==Jae.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",xe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,xe.FRAGMENT)),c(l)&&!o&&Nl(n,t,l,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),c(d)&&!o&&Nl(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function E3e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,xe.FRAGMENT);let r=e.baseColorTexture;c(r)&&!o&&Nl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;c(s)&&!ce.equals(s,Ez.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",xe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,xe.FRAGMENT));let a=e.metallicRoughnessTexture;c(a)&&!o&&Nl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let l=e.metallicFactor;c(l)&&l!==Ez.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",xe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,xe.FRAGMENT));let d=e.roughnessFactor;c(d)&&d!==Ez.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",xe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,xe.FRAGMENT))}var qW=Qae;var BPn=_(T(),1);var el={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"};el.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(el.METADATA_PICKING_VALUE_TYPE,"float",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_STRING,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",xe.FRAGMENT),i.addDefine(el.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",xe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",xe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${el.METADATA_PICKING_VALUE_TYPE} value = ${el.METADATA_PICKING_VALUE_TYPE}(${el.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${el.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${el.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${el.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${el.METADATA_PICKING_VALUE_COMPONENT_W};`],xe.FRAGMENT)};var Ld=el;var e2n=_(T(),1);var HPn=_(T(),1),$W=`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 Na={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)"};Na.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,xe.VERTEX),v3e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let l=t.morphTargets[a].attributes,d=l.length;for(let u=0;u<d;u++){let f=l[u],p=f.semantic;p!==pt.POSITION&&p!==pt.NORMAL&&p!==pt.TANGENT||(I3e(e,f,e.attributeIndex,a),e.attributeIndex++)}}F3e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,xe.VERTEX),n.addVertexLines($W);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=St(s,e.uniformMap)};var X3e={attributeString:void 0,functionId:void 0};function I3e(e,t,n,i){let o=e.shaderBuilder;W3e(e,t,n);let r=w3e(t,X3e);P3e(o,r,i)}function W3e(e,t,n){let i={index:n,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:rn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function w3e(e,t){switch(e.semantic){case pt.POSITION:t.attributeString="Position",t.functionId=Na.FUNCTION_ID_GET_MORPHED_POSITION;break;case pt.NORMAL:t.attributeString="Normal",t.functionId=Na.FUNCTION_ID_GET_MORPHED_NORMAL;break;case pt.TANGENT:t.attributeString="Tangent",t.functionId=Na.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function P3e(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 v3e(e){e.addFunction(Na.FUNCTION_ID_GET_MORPHED_POSITION,Na.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,xe.VERTEX),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Na.FUNCTION_ID_GET_MORPHED_NORMAL,Na.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,xe.VERTEX),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Na.FUNCTION_ID_GET_MORPHED_TANGENT,Na.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,xe.VERTEX),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function F3e(e){e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Na.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var ew=Na;var d2n=_(T(),1);var qae={name:"PickingPipelineStage"};qae.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)A3e(e,t,a,i);else if(c(a))M3e(e,i);else{let l=$ae(e),d=i.createPickId(l);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",xe.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function $ae(e,t){let n=e.model;if(c(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(mr.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,c(t)&&(o.instanceId=t),o}function A3e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;c(i.featureTableId)?o=i.featureTableId:c(n)?(r=qt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=qt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let l=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",xe.FRAGMENT);let u=l.batchTexture;e.uniformMap.model_pickTexture=function(){return u.pickTexture??u.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function M3e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let f=0;f<n;f++){let p=$ae(e,f),y=t.createPickId(p);s.push(y),i[f]=y;let h=y.color;o[f*4+0]=Y.floatToByte(h.red),o[f*4+1]=Y.floatToByte(h.green),o[f*4+2]=Y.floatToByte(h.blue),o[f*4+3]=Y.floatToByte(h.alpha)}r._pickIds=i;let a=_t.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,xe.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var tw=qae;var W2n=_(T(),1);var m2n=_(T(),1),N3e={ADD:0,REPLACE:1},Bo=Object.freeze(N3e);var h2n=_(T(),1),nw=`float getPointSizeFromAttenuation(vec3 positionEC) {
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)
return step(-v_normalEC.z, 0.0);
#else
return 1.0;
#endif
}
#endif
`;var k3e=new ce,tce={name:"PointCloudStylingPipelineStage"};tce.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=c(s)?s.propertyAttributes:void 0,l=c(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!c(a)&&l;if(c(r)&&!d){let g=B3e(a),x=Y3e(r,g);H3e(i,x);let V=z3e(x).indexOf("normalMC")>=0,Z=qt.getAttributeBySemantic(t,pt.NORMAL);if(V&&!Z)throw new le("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,xe.VERTEX),x.styleTranslucent&&(e.alphaOptions.pass=Xe.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,xe.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,xe.VERTEX);let f,p,y;mr.is3DTiles(o.type)&&(p=!0,f=o.content,y=f.tile.refine===Bo.ADD),i.addUniform("vec4","model_pointCloudParameters",xe.VERTEX),i.addVertexLines(nw);let h=e.uniformMap;h.model_pointCloudParameters=function(){let g=k3e,x=1;p&&(x=y?5:f.tileset.memoryAdjustedScreenSpaceError),g.x=u.maximumAttenuation??x,g.x*=n.pixelRatio;let S=U3e(e,t,u,f);g.y=S*u.geometricErrorScale;let V=n.context,Z=n.camera.frustum,R;return n.mode===se.SCENE2D||Z instanceof sn?R=Number.POSITIVE_INFINITY:R=V.drawingBufferHeight/n.camera.frustum.sseDenominator,g.z=R,p&&(g.w=f.tileset.timeSinceLoad),g}};var ece=new m;function U3e(e,t,n,i){if(c(i)){let u=i.tile.geometricError;if(u>0)return u}if(c(n.baseResolution))return n.baseResolution;let o=qt.getAttributeBySemantic(t,pt.POSITION),r=o.count,s=e.runtimeNode.transform,a=m.subtract(o.max,o.min,ece);a=M.multiplyByPointAsVector(s,a,ece);let l=a.x*a.y*a.z;return w.cbrt(l/r)}var O3e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},D3e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function B3e(e){let t=He(D3e);if(!c(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 Iz="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Y3e(e,t){let n=O3e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${Iz})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${Iz})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${Iz})`,t,i),n.styleTranslucent=c(n.colorStyleFunction)&&i.translucent,n}function H3e(e,t){let n=t.colorStyleFunction;c(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,xe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;c(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,xe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;c(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,xe.VERTEX),e.addVertexLines(o))}function Wz(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 z3e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return c(t)&&Wz(t,o),c(n)&&Wz(n,o),c(i)&&Wz(i,o),o}var iw=tce;var D2n=_(T(),1);var P2n=_(T(),1),ow=`void primitiveOutlineStage() {
v_outlineCoordinates = a_outlineCoordinates;
}
`;var F2n=_(T(),1),rw=`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 nce={name:"PrimitiveOutlinePipelineStage"};nce.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,xe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:rn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",xe.FRAGMENT);let a=L_.createTexture(n.context);o.model_outlineTexture=function(){return a};let l=e.model;i.addUniform("vec4","model_outlineColor",xe.FRAGMENT),o.model_outlineColor=function(){return l.outlineColor},i.addUniform("bool","model_showOutline",xe.FRAGMENT),o.model_showOutline=function(){return l.showOutline},i.addVertexLines(ow),i.addFragmentLines(rw)};var sw=nce;var J2n=_(T(),1);var ice={name:"PrimitiveStatisticsPipelineStage",_countGeometry:oce,_count2DPositions:rce,_countMorphTargetAttributes:sce,_countMaterialTextures:ace,_countFeatureIdTextures:cce,_countBinaryMetadata:lce};ice.process=function(e,t,n){let i=e.model,o=i.statistics;oce(o,t),rce(o,e.runtimePrimitive),sce(o,t),ace(o,t.material),cce(o,t.featureIds),lce(o,i)};function oce(e,t){let n=c(t.indices)?t.indices.count:qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===ve.POINTS?e.pointsLength+=n:ve.isTriangles(i)&&(e.trianglesLength+=K3e(i,n));let o=t.attributes,r=o.length;for(let l=0;l<r;l++){let d=o[l];if(c(d.buffer)){let u=c(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;c(s)&&c(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(c(a)&&c(a.buffer)){let l=c(a.typedArray);e.addBuffer(a.buffer,l)}}function K3e(e,t){switch(e){case ve.TRIANGLES:return t/3;case ve.TRIANGLE_STRIP:case ve.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function rce(e,t){let n=t.positionBuffer2D;c(n)&&e.addBuffer(n,!0)}function sce(e,t){let n=t.morphTargets;if(!c(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 l=0;l<a;l++){let d=s[l];c(d.buffer)&&e.addBuffer(d.buffer,i)}}}function ace(e,t){let n=J3e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r)&&c(r.texture)&&e.addTexture(r.texture)}}function J3e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return c(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function cce(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Cn.FeatureIdTexture){let r=o.textureReader;c(r.texture)&&e.addTexture(r.texture)}}}function lce(e,t){let n=t.structuralMetadata;c(n)&&(Q3e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!c(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function Q3e(e,t){let n=t.propertyTextures;if(!c(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;c(d.texture)&&e.addTexture(d.texture)}}}var aw=ice;var dvn=_(T(),1);var j3e=new M,q3e=new M,dce={name:"SceneMode2DPipelineStage"};dce.process=function(e,t,n){let i=qt.getAttributeBySemantic(t,pt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,l=M.multiplyTransformation(s,a,j3e),d=tYe(e,l,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let f=e.runtimeNode.node.instances;if(c(f))return;if(c(i.typedArray)){let g=oYe(i,l,d,n);u.positionBuffer2D=g,r._modelResources.push(g),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,xe.VERTEX),o.addUniform("mat4","u_modelView2D",xe.VERTEX);let p=M.fromTranslation(d.center,new M),y=n.context,h={u_modelView2D:function(){return M.multiplyTransformation(y.uniformState.view,p,q3e)}};e.uniformMap=St(h,e.uniformMap)};var $3e=new m,eYe=new m;function tYe(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,$3e),o=Oi.computeActualEllipsoidPosition(n,i,i),r=M.multiplyByPoint(t,e.positionMax,eYe),s=Oi.computeActualEllipsoidPosition(n,r,r);return ue.fromCornerPoints(o,s,new ue)}var uce=new m;function nYe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=m.fromArray(e,s,uce),l=m.multiplyComponents(a,r,a),d=m.add(l,o,l);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function iYe(e,t,n,i){let o;c(e.quantization)?o=nYe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=c(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let l=r;l<s;l+=a){let d=m.fromArray(o,l,uce);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=M.multiplyByPoint(t,d,d),f=Oi.computeActualEllipsoidPosition(i,u,u),p=m.subtract(f,n,f);o[l]=p.x,o[l+1]=p.y,o[l+2]=p.z}return o}function oYe(e,t,n,i){let o=He(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=iYe(e,t,r,o),a=_t.createVertexBuffer({context:i.context,typedArray:s,usage:Ne.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var cw=dce;var gvn=_(T(),1);var mvn=_(T(),1),lw=`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 E_={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};E_.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,xe.VERTEX),sYe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,xe.VERTEX),n.addVertexLines(lw);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=St(r,e.uniformMap)};function rYe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===pt.JOINTS||r.semantic===pt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function sYe(e,t){e.addFunction(E_.FUNCTION_ID_GET_SKINNING_MATRIX,E_.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,xe.VERTEX),e.addFunctionLines(E_.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=rYe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let l=r[o],d=`skinnedMatrix += a_weights_${i}.${l} * u_jointMatrices[int(a_joints_${i}.${l})];`;e.addFunctionLines(E_.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(E_.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var dw=E_;var Lvn=_(T(),1);var _vn=_(T(),1),uw=`void verticalExaggerationStage(
inout ProcessedAttributes attributes
) {
vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;
vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
vec3 vertexNormal = normalize(centerToVertex);
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;
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;
vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
vertexNormalMC = normalize(vertexNormalMC);
float stretch = u_verticalExaggerationAndRelativeHeight.x;
float shift = u_verticalExaggerationAndRelativeHeight.y;
float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
attributes.positionMC += exaggeration * vertexNormalMC;
}
`;var mce={name:"VerticalExaggerationPipelineStage"},aYe=new D;mce.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(uw),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,xe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",xe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return D.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,aYe)}};var mw=mce;var Uvn=_(T(),1);var Xvn=_(T(),1);var wz={};function cYe(e){let t=Me.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 lYe(e,t){let n=t.length,i=Me.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],l=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=l,i[o++]=l,i[o++]=s}return i}function dYe(e){let t=e-2,n=2+t*4,i=Me.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 uYe(e,t){let i=t.length-2,o=2+i*4,r=Me.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let l=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=l}return r}function mYe(e){let t=e-2,n=2+t*4,i=Me.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 fYe(e,t){let i=t.length-2,o=2+i*4,r=Me.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let l=0;l<i;l++){let d=t[l+1],u=t[l+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}wz.createWireframeIndices=function(e,t,n){let i=c(n);if(e===ve.TRIANGLES)return i?lYe(t,n):cYe(t);if(e===ve.TRIANGLE_STRIP)return i?uYe(t,n):dYe(t);if(e===ve.TRIANGLE_FAN)return i?fYe(t,n):mYe(t)};wz.getWireframeIndicesCount=function(e,t){return e===ve.TRIANGLES?t*2:e===ve.TRIANGLE_STRIP||e===ve.TRIANGLE_FAN?2+(t-2)*4:t};var l1=wz;var fce={name:"WireframePipelineStage"};fce.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,xe.FRAGMENT);let o=e.model,r=hYe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,l=e.count;e.primitiveType=ve.LINES,e.count=l1.getWireframeIndicesCount(a,l)};function hYe(e,t,n){let o=qt.getAttributeBySemantic(e,pt.POSITION).count,r=n.context.webgl2,s;if(c(t)){let u=t.buffer,f=t.count;c(u)&&r?(s=u.sizeInBytes===f?new Uint8Array(f):Me.createTypedArray(o,f),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,l=l1.createWireframeIndices(a,o,s),d=Me.fromSizeInBytes(l.BYTES_PER_ELEMENT);return _t.createIndexBuffer({context:n.context,typedArray:l,usage:Ne.STATIC_DRAW,indexDatatype:d})}var fw=fce;function hce(e){e=e??z.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;C.typeOf.object("options.primitive",t),C.typeOf.object("options.node",n),C.typeOf.object("options.model",i),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=[]}hce.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,d=e.mode!==se.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,f=c(n.morphTargets)&&n.morphTargets.length>0,p=c(i.skin),y=c(r),g=!(y&&c(r.fragmentShaderText))||r.mode!==bb.REPLACE_MATERIAL,x=qt.hasQuantizedAttributes(n.attributes),S=o.debugWireframe&&ve.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,Z=c(V)&&V.attenuation,R=c(V)&&V.backFaceCulling,E=n.primitiveType===ve.POINTS&&(c(s)||Z||R),I=o._enableShowOutline&&c(n.outlineCoordinates),v=pYe(o,i,n),P=c(o.classificationType);d&&t.push(cw),t.push(KW),S&&t.push(fw),P&&t.push(WW),f&&t.push(ew),p&&t.push(dw),E&&t.push(iw),x&&t.push(BW),g&&t.push(qW),t.push(Xy),t.push(Fu),t.push(Ld),v.hasPropertyTable&&(t.push(Wy),t.push(IW),t.push(vW)),u&&t.push(mw),y&&t.push(OW),t.push(QW),o.allowPicking&&t.push(tw),I&&t.push(sw),t.push(XW),t.push(aw)};function pYe(e,t,n){let i;return c(t.instances)&&(i=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(i))?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:(i=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),c(i)?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var hw=hce;var CFn=_(T(),1);function Pz(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.skin",e.skin),C.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],bYe(this)}Object.defineProperties(Pz.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 bYe(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 l=0;l<o;l++){let d=i[l].index,u=r[d];s.push(u);let f=n[l],p=pce(u,f,new M);a.push(p)}}function pce(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}Pz.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]=pce(i,o,e[n])}};var pw=Pz;var WFn=_(T(),1);var LFn=_(T(),1);function yYe(){this.pass=void 0,this.alphaCutoff=void 0}var bw=yYe;function gYe(e){C.typeOf.object("model",e),this.shaderBuilder=new Lx,this.model=e,this.uniformMap={},this.alphaOptions=new bw,this.renderStateOptions=Oe.getState(Oe.fromCache({depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var yw=gYe;var DFn=_(T(),1);var PFn=_(T(),1),gw=`void silhouetteStage(inout vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
}
`;var FFn=_(T(),1),xw=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
#ifdef HAS_NORMALS
if(model_silhouettePass) {
vec3 normal = normalize(czm_normal3D * attributes.normalMC);
normal.x *= czm_projection[0][0];
normal.y *= czm_projection[1][1];
positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
}
#endif
}
`;var ck={name:"ModelSilhouettePipelineStage"};ck.silhouettesLength=0;ck.process=function(e,t,n){c(t._silhouetteId)||(t._silhouetteId=++ck.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,xe.BOTH),i.addVertexLines(xw),i.addFragmentLines(gw),i.addUniform("vec4","model_silhouetteColor",xe.FRAGMENT),i.addUniform("float","model_silhouetteSize",xe.VERTEX),i.addUniform("bool","model_silhouettePass",xe.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 _w=ck;var QFn=_(T(),1);var YFn=_(T(),1),Tw=`void modelSplitterStage()
{
#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 lk={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};lk.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,xe.FRAGMENT),i.addFragmentLines(Tw);let o={};i.addUniform("float",lk.SPLIT_DIRECTION_UNIFORM_NAME,xe.FRAGMENT),o[lk.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=St(o,e.uniformMap)};var Sw=lk;var eAn=_(T(),1);function xYe(e,t){C.typeOf.object("modelRenderResources",e),C.typeOf.object("runtimeNode",t),this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=He(e.uniformMap),this.alphaOptions=He(e.alphaOptions),this.renderStateOptions=He(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}var Cw=xYe;var fAn=_(T(),1);var oAn=_(T(),1);function _Ye(e){e=e??z.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Lh.UNLIT}var Vw=_Ye;function TYe(e,t){C.typeOf.object("nodeRenderResources",e),C.typeOf.object("runtimePrimitive",t),this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=He(e.uniformMap),this.alphaOptions=He(e.alphaOptions),this.renderStateOptions=He(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=c(n.indices)?n.indices.count:qt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=qt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=m.clone(i.min,new m),this.positionMax=m.clone(i.max,new m),this.boundingSphere=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new Vw,this.pickId=void 0}var Lw=TYe;var y9n=_(T(),1);var GAn=_(T(),1);function Fz(e){e=e??z.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;C.typeOf.object("options.command",t),C.typeOf.object("options.primitiveRenderResources",n);let 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!==Un.CESIUM_3D_TILE,this._classifies3DTiles=o!==Un.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],LYe(this)}function SYe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:e,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},depthMask:!1}}var CYe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},VYe={stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:On.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},gce=[];function LYe(e){let t=e._command,n=gce;if(e._useDebugWireframe){t.pass=Xe.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=Zw(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let l=r[a];l.count*=2,l.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Xe.TERRAIN_CLASSIFICATION,s=vz(t,r),a=bce(t,r);n.length=0,n.push(s,a),e._commandListTerrain=Zw(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=yce(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Xe.CESIUM_3D_TILE_CLASSIFICATION,s=vz(t,r),a=bce(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=Zw(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=yce(e,n,e._commandList3DTilesPicking))}}function Zw(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let l=0;l<s;l++){let d=o[l],u=r[l];for(let f=0;f<a;f++){let p=t[f],y=et.shallowClone(p);y.count=d,y.offset=u,n.push(y)}}return n}function vz(e,t){let n=et.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Xe.TERRAIN_CLASSIFICATION?On.ALWAYS:On.EQUAL,o=SYe(i);return n.renderState=Oe.fromCache(o),n}function bce(e,t){let n=et.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Oe.fromCache(CYe),n}var ZYe=[];function yce(e,t,n){let i=Oe.fromCache(VYe),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 l=ZYe;return l.length=0,l.push(s,a),Zw(e,l,n)}Object.defineProperties(Fz.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=ue.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});Fz.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Xe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=vz(this._command,o),s=gce;s.length=0,s.push(r),this._commandListIgnoreShow=Zw(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var Rw=Fz;var QAn=_(T(),1);function dk(e){e=e??z.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;C.typeOf.object("options.command",t),C.typeOf.object("options.primitiveRenderResources",n);let i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Xe.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,l=n.hasSilhouette,d=!r&&!l,u=n.hasSkipLevelOfDetail&&!r,f=l;this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=ue.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new ue,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=f,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._derivedCommands=[],this._has2DCommands=!1,RYe(this)}function yb(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}yb.clone=function(e){return new yb({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function RYe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new yb({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new yb({command:PYe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new yb({command:kYe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new yb({command:UYe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new yb({command:vYe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new yb({command:FYe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(dk.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=ue.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,EYe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,XYe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,IYe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,WYe(this))}}});function GYe(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=w.sign(n[13])*2*w.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function EYe(e){let t=e.shadows,n=Sn.castShadows(t),i=Sn.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 XYe(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=He(r.renderState,!0);s.cull.enabled=t,r.renderState=Oe.fromCache(s)}}}function IYe(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=He(r.renderState,!0);s.cull.face=t,r.renderState=Oe.fromCache(s)}}}function WYe(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}}}dk.prototype.pushCommands=function(e,t){let n=xce(this,e);n&&!this._has2DCommands&&(wYe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(GYe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&c(i)&&(i!==sf.ALL_OPAQUE&&u1(t,this._translucentCommand,n),i===sf.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||u1(o._backfaceCommands,this._skipLodBackfaceCommand,n),AYe(this,r,n),u1(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){u1(t,this._silhouetteModelCommand,n);return}return u1(t,this._originalCommand,n),t}};dk.prototype.pushSilhouetteCommands=function(e,t){let n=xce(this,e);return u1(t,this._silhouetteColorCommand,n),t};function u1(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function xce(e,t){if(t.mode!==se.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*w.PI;return o<s&&r>s||o<-s&&r>-s}function d1(e,t){if(!c(t))return;let n=yb.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 wYe(e){d1(e,e._originalCommand),d1(e,e._translucentCommand),d1(e,e._skipLodBackfaceCommand),d1(e,e._skipLodStencilCommand),d1(e,e._silhouetteModelCommand),d1(e,e._silhouetteColorCommand)}function PYe(e){let t=et.shallowClone(e);t.pass=Xe.TRANSLUCENT;let n=He(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Oe.fromCache(n),t}function vYe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),o=He(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:oe.ALWAYS,backFunction:oe.ALWAYS,reference:n,mask:-1,frontOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.REPLACE},backOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Oe.fromCache(o),i}function FYe(e,t){let n=t._silhouetteId%255,i=et.shallowClone(e),o=He(e.renderState,!0);o.cull.enabled=!1,(e.pass===Xe.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Xe.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:oe.NOTEQUAL,backFunction:oe.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.KEEP},backOperation:{fail:oe.KEEP,zFail:oe.KEEP,zPass:oe.KEEP}};let s=He(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Oe.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function AYe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=MYe(o);if(r!==s){let a=NYe(r),l=He(o.renderState,!0);l.stencilTest.reference=a,o.renderState=Oe.fromCache(l),n&&(i.derivedCommand2D.renderState=l)}}function MYe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function NYe(e){return kt.CESIUM_3D_TILE_MASK|e<<kt.SKIP_LOD_BIT_SHIFT}function kYe(e){let t=et.shallowClone(e),n=He(e.renderState,!0);n.cull.enabled=!0,n.cull.face=_i.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=He(t.uniformMap),o=new D(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Oe.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function UYe(e){let t=et.shallowClone(e),n=He(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=kt.SKIP_LOD_MASK,i.reference=kt.CESIUM_3D_TILE_MASK,i.frontFunction=On.GREATER_OR_EQUAL,i.frontOperation.zPass=ft.REPLACE,i.backFunction=On.GREATER_OR_EQUAL,i.backOperation.zPass=ft.REPLACE,n.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,t.renderState=Oe.fromCache(n),t}var Gw=dk;var qAn=_(T(),1),Ew=`precision highp float;
czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
czm_modelVertexOutput vsOutput;
vsOutput.positionMC = positionMC;
vsOutput.pointSize = 1.0;
return vsOutput;
}
void main()
{
ProcessedAttributes attributes;
initializeAttributes(attributes);
#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
#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);
cpuStylingStage(attributes.positionMC, feature);
#endif
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
mat4 modelView = czm_modelView3D;
mat3 normal = czm_normal3D;
#else
mat4 modelView = czm_modelView;
mat3 normal = czm_normal;
#endif
#ifdef HAS_INSTANCING
#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
vec4 positionClip = geometryStage(attributes, modelView, normal);
#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
gl_Position = positionClip;
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
v_pointCloudShow = show;
#endif
}
`;var e9n=_(T(),1),Xw=`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);
#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);
#else
vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
metadataPickingStage(metadata, metadataClass, metadataValues);
vec4 color = metadataValues;
#endif
#ifdef HAS_CLIPPING_PLANES
modelClippingPlanesStage(color);
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
modelClippingPolygonsStage();
#endif
#ifndef METADATA_PICKING_ENABLED
#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
silhouetteStage(color);
#endif
#ifdef HAS_ATMOSPHERE
atmosphereStage(color, attributes);
#endif
#endif
out_FragColor = color;
}
`;function _ce(){}_ce.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=OYe(e,n,t),o=DYe(e,i,t),r=e.model;return c(r.classificationType)?new Rw({primitiveRenderResources:e,command:o}):new Gw({primitiveRenderResources:e,command:o})};function OYe(e,t,n){t.addVertexLines(Ew),t.addFragmentLines(Xw);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function DYe(e,t,n){let i=BYe(e),o=new ni({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,l=n.mode===se.SCENE3D,d,u;if(!l&&!n.scene3DOnly&&r._projectTo2D)d=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),u=e.runtimePrimitive.boundingSphere2D;else{let S=l?a._computedModelMatrix:a._computedModelMatrix2D;d=M.multiplyTransformation(S,e.runtimeNode.computedTransform,new M),u=ue.transform(e.boundingSphere,d)}let f=He(Oe.fromCache(e.renderStateOptions),!0);f.cull.face=qt.getCullFace(d,e.primitiveType),f=Oe.fromCache(f);let p=c(r.classificationType),y=p?!1:Sn.castShadows(r.shadows),h=p?!1:Sn.receiveShadows(r.shadows),g=p?void 0:e.pickId;return new et({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:f,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:g,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:y,receiveShadows:h})}function BYe(e){let t=e.wireframeIndexBuffer;if(c(t))return t;let n=e.indices;if(c(n)){if(!c(n.buffer))throw new L("Indices must be provided as a Buffer");return n.buffer}}var Iw=_ce;function Zd(e){e=e??z.EMPTY_OBJECT;let t=e.modelComponents;C.typeOf.object("options.model",e.model),C.typeOf.object("options.modelComponents",t),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=qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},YYe(this)}Object.defineProperties(Zd.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 YYe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Tce(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let V=0;V<s;V++){let Z=r[V],R=new hW({articulation:Z,sceneGraph:e}),E=R.name;a[E]=R}let l=t.nodes,d=l.length;e._runtimeNodes=new Array(d);let f=n.nodes.length,p=M.IDENTITY;for(let V=0;V<f;V++){let Z=n.nodes[V],R=Sce(e,Z,p);e._rootNodes.push(R)}let y=t.skins,h=e._runtimeSkins,g=y.length;for(let V=0;V<g;V++){let Z=y[V];h.push(new pw({skin:Z,sceneGraph:e}))}let x=e._skinnedNodes,S=x.length;for(let V=0;V<S;V++){let Z=x[V],R=e._runtimeNodes[Z],I=l[Z].skin.index;R._runtimeSkin=h[I],R.updateJointMatrices()}e.applyArticulations()}function Tce(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 HYe=new m;function zYe(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,HYe);if(!m.equals(i,m.ZERO))e._computedModelMatrix2D=wt.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=wt.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Sce(e,t,n){let i=[],o=qt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let f=t.children[u],p=M.multiplyTransformation(n,o,new M),y=Sce(e,f,p);i.push(y)}let s=new EW({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new hw({primitive:t.primitives[u],node:t,model:e._model}));let l=t.index;e._runtimeNodes[l]=s,c(t.skin)&&e._skinnedNodes.push(l);let d=t.name;if(c(d)){let u=e._model,f=new TW(u,s);u._nodesByName[d]=f}return l}var KYe=new m,JYe=new m,QYe=new m,jYe=new m;Zd.prototype.buildDrawCommands=function(e){let t=this._model,n=new yw(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,KYe),l=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,JYe);for(o=0;o<this._runtimeNodes.length;o++){let d=this._runtimeNodes[o];if(!c(d))continue;d.configurePipeline();let u=d.pipelineStages,f=new Cw(n,d);for(r=0;r<u.length;r++)u[r].process(f,d.node,e);let p=d.computedTransform;for(r=0;r<d.runtimePrimitives.length;r++){let y=d.runtimePrimitives[r];y.configurePipeline(e);let h=y.pipelineStages,g=new Lw(f,y);for(s=0;s<h.length;s++)h[s].process(g,y.primitive,e);y.boundingSphere=ue.clone(g.boundingSphere,new ue);let x=M.multiplyByPoint(p,g.positionMin,QYe),S=M.multiplyByPoint(p,g.positionMax,jYe);m.minimumByComponent(a,x,a),m.minimumByComponent(a,S,a),m.maximumByComponent(l,S,l),m.maximumByComponent(l,x,l);let V=Iw.buildModelDrawCommand(g,e);y.drawCommand=V}}this._boundingSphere=ue.fromCornerPoints(a,l,new ue),this._boundingSphere=ue.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ue.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ue.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Zd.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;c(n.color)&&t.push(Ey),!c(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(mW),n.isClippingEnabled()&&t.push(yW),n.isClippingPolygonsEnabled()&&t.push(_W),n.hasSilhouette(e)&&t.push(_w),c(n.splitDirection)&&n.splitDirection!==Ar.NONE&&t.push(Sw),mr.is3DTiles(n.type)&&t.push(aW),i&&t.push(dW))};Zd.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!c(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==se.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};Zd.prototype.updateModelMatrix=function(e,t){Tce(this,e),t.mode!==se.SCENE3D&&zYe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Zd.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 Cce(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let l=0;l<r;l++){let d=t.getChild(l);Cce(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let l=0;l<a;l++){let d=s[l];i(d,o)}}function uk(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],l=e._runtimeNodes[a];Cce(e,l,t,n,i)}}var qYe={backFaceCulling:void 0};Zd.prototype.updateBackFaceCulling=function(e){let t=qYe;t.backFaceCulling=e,uk(this,!1,$Ye,t)};function $Ye(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var eHe={shadowMode:void 0};Zd.prototype.updateShadows=function(e){let t=eHe;t.shadowMode=e,uk(this,!1,tHe,t)};function tHe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var nHe={debugShowBoundingVolume:void 0};Zd.prototype.updateShowBoundingVolume=function(e){let t=nHe;t.debugShowBoundingVolume=e,uk(this,!1,iHe,t)};function iHe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Vce=[],oHe={frameState:void 0,hasSilhouette:void 0};Zd.prototype.pushDrawCommands=function(e){let t=Vce;t.length=0;let n=oHe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,uk(this,!0,rHe,n),e.commandList.push.apply(e.commandList,t)};function rHe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Vce,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Zd.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];c(r)&&r.setArticulationStage(o,t)};Zd.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var Ww=Zd;var j9n=_(T(),1);function wy(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Zt}Object.defineProperties(wy.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}}});wy.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()};wy.prototype.addBuffer=function(e,t){if(C.typeOf.object("buffer",e),C.typeOf.bool("hasCpuCopy",t),!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};wy.prototype.addTexture=function(e){C.typeOf.object("texture",e),this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};wy.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};wy.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};wy.prototype.addBatchTexture=function(e){C.typeOf.object("batchTexture",e),this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var ww=wy;var FMn=_(T(),1);var Gce=_(oN(),1);var dMn=_(T(),1);var Lce={},X_=Uint32Array.BYTES_PER_ELEMENT;Lce.parse=function(e,t){t=t??0,C.defined("arrayBuffer",e);let n=new Uint8Array(e),i=new DataView(e);t+=X_;let o=i.getUint32(t,!0);if(o!==1)throw new le(`Only Point Cloud tile version 1 is supported.  Version ${o} is not.`);t+=X_,t+=X_;let r=i.getUint32(t,!0);if(r===0)throw new le("Feature table must have a byte length greater than zero");t+=X_;let s=i.getUint32(t,!0);t+=X_;let a=i.getUint32(t,!0);t+=X_;let l=i.getUint32(t,!0);t+=X_;let d=er(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let f,p;a>0&&(f=er(n,t,a),t+=a,l>0&&(p=new Uint8Array(e,t,l),t+=l));let y=new of(d,u),h=y.getGlobalProperty("POINTS_LENGTH");if(y.featuresLength=h,!c(h))throw new le("Feature table global property: POINTS_LENGTH must be defined");let g=y.getGlobalProperty("RTC_CENTER",q.FLOAT,3);c(g)&&(g=m.unpack(g));let x=sHe(y,f);if(x.rtcCenter=g,x.pointsLength=h,!x.hasPositions){let S=aHe(y);x.positions=S,x.hasPositions=x.hasPositions||c(S)}if(!x.hasPositions)throw new le("Either POSITION or POSITION_QUANTIZED must be defined.");if(!x.hasNormals){let S=lHe(y);x.normals=S,x.hasNormals=x.hasNormals||c(S)}if(!x.hasColors){let S=cHe(y);x.colors=S,x.hasColors=x.hasColors||c(S),x.hasConstantColor=c(x.constantColor),x.isTranslucent=c(S)&&S.isTranslucent}if(!x.hasBatchIds){let S=dHe(y);x.batchIds=S,x.hasBatchIds=x.hasBatchIds||c(S)}if(x.hasBatchIds){let S=y.getGlobalProperty("BATCH_LENGTH");if(!c(S))throw new le("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");x.batchLength=S}return c(p)&&(p=new Uint8Array(p),x.batchTableJson=f,x.batchTableBinary=p),x};function sHe(e,t){let n=e.json,i,o,r,s=c(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=c(t)&&c(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;c(a)&&(r=a.properties);let l,d,u,f,p;if(c(s)){o=s.properties;let h=s.byteOffset,g=s.byteLength;if(!c(o)||!c(h)||!c(g))throw new le("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(h,h+g),l=c(o.POSITION),d=c(o.RGB)||c(o.RGBA),u=c(o.NORMAL),f=c(o.BATCH_ID),p=c(o.RGBA)}let y;return c(i)&&(y={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:St(o,r),dequantizeInShader:!0}),{draco:y,hasPositions:l,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:f}}function aHe(e){let t=e.json,n;if(c(t.POSITION))return n=e.getPropertyArray("POSITION",q.FLOAT,3),{name:pt.POSITION,semantic:pt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:q.FLOAT,type:rn.VEC3};if(c(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",q.FLOAT,3);if(!c(i))throw new le("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",q.FLOAT,3);if(!c(r))throw new le("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:pt.POSITION,semantic:pt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:q.FLOAT,type:rn.VEC3,quantizedRange:o,quantizedVolumeOffset:m.unpack(r),quantizedVolumeScale:m.unpack(i),quantizedComponentDatatype:q.UNSIGNED_SHORT,quantizedType:rn.VEC3}}}function cHe(e){let t=e.json,n;if(c(t.RGBA))return n=e.getPropertyArray("RGBA",q.UNSIGNED_BYTE,4),{name:pt.COLOR,semantic:pt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(c(t.RGB))return n=e.getPropertyArray("RGB",q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(c(t.RGB565))return n=e.getPropertyArray("RGB565",q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n,componentDatatype:q.FLOAT,type:rn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(c(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",q.UNSIGNED_BYTE,4),o=i[3],r=Y.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:pt.COLOR,semantic:pt.COLOR,setIndex:0,constantColor:r,componentDatatype:q.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:s}}}function lHe(e){let t=e.json,n;if(c(t.NORMAL))return n=e.getPropertyArray("NORMAL",q.FLOAT,3),{name:pt.NORMAL,semantic:pt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:q.FLOAT,type:rn.VEC3};if(c(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",q.UNSIGNED_BYTE,2),{name:pt.NORMAL,semantic:pt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:rn.VEC2,quantizedComponentDatatype:q.UNSIGNED_BYTE,componentDatatype:q.FLOAT,type:rn.VEC3}}function dHe(e){let t=e.json;if(c(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",q.UNSIGNED_SHORT,1);return{name:pt.FEATURE_ID,semantic:pt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:q.fromTypedArray(n),type:rn.SCALAR}}}var I_=Lce;var uHe=Cn.Components,mHe=Cn.Scene,fHe=Cn.Node,hHe=Cn.Primitive,pHe=Cn.Attribute,Zce=Cn.Quantization,bHe=Cn.FeatureIdAttribute,yHe=Cn.Material,gHe=Cn.MetallicRoughness;function Py(e){e=e??z.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;C.typeOf.object("options.arrayBuffer",t),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=xt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}c(Object.create)&&(Py.prototype=Object.create(Ji.prototype),Py.prototype.constructor=Py);Object.defineProperties(Py.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Py.prototype.load=function(){if(c(this._promise))return this._promise;this._parsedContent=I_.parse(this._arrayBuffer,this._byteOffset),this._state=xt.PROCESSING,this._promise=Promise.resolve(this)};Py.prototype.process=function(e){if(c(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===xt.READY)return!0;if(this._state===xt.PROCESSING){if(c(this._decodePromise))return!1;this._decodePromise=xHe(this,e.context)}return!1};function xHe(e,t){let i=e._parsedContent.draco,o;if(c(i)?o=eb.decodePointCloud(i,t):o=Promise.resolve(),!!c(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return c(r)&&_He(e,i,r),IHe(e,t),e._state=xt.READY,e}).catch(function(r){e.unload(),e._state=xt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function _He(e,t,n){e._state=xt.READY;let i=e._parsedContent,o;if(c(n.POSITION)){if(o={name:"POSITION",semantic:pt.POSITION,typedArray:n.POSITION.array,componentDatatype:q.FLOAT,type:rn.VEC3,isQuantized:!1},c(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,l=a.range,d=m.fromElements(l,l,l),u=m.unpack(a.minValues),f=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=f,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=f<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT,o.quantizedType=rn.VEC3}i.positions=o}if(c(n.NORMAL)){if(o={name:"NORMAL",semantic:pt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:q.FLOAT,type:rn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},c(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=rn.VEC2}i.normals=o}if(c(n.RGBA)?i.colors={name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC4,normalized:!0,isTranslucent:!0}:c(n.RGB)&&(i.colors={name:"COLOR",semantic:pt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:q.UNSIGNED_BYTE,type:rn.VEC3,normalized:!0,isTranslucent:!1}),c(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:pt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:q.fromTypedArray(a),type:rn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let l=n[a];c(r)||(r={}),i.hasDracoBatchTable=!0;let d=l.data;r[a]={byteOffset:d.byteOffset,type:THe(d.componentsPerAttribute),componentType:SHe(d.componentDatatype),typedArray:l.array}}i.batchTableJson=r}function THe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new L("componentsPerAttribute must be a number from 1-4")}}function SHe(e){switch(e){case oe.BYTE:return"BYTE";case oe.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case oe.SHORT:return"SHORT";case oe.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case oe.INT:return"INT";case oe.UNSIGNED_INT:return"UNSIGNED_INT";case oe.DOUBLE:return"DOUBLE";case oe.FLOAT:return"FLOAT";default:throw new L("value is not a valid WebGL constant")}}function Pw(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Zce,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Zce;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=m.ZERO;let l=t.quantizedVolumeScale;o.quantizedVolumeDimensions=l,o.quantizedVolumeStepSize=m.divideByScalar(l,a,new m),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new pHe;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=Fn.decodeRGB565(i)),c(t.constantColor)){let a=new Array(4);r.constant=Y.pack(t.constantColor,a)}else{let a=_t.createVertexBuffer({typedArray:i,context:n,usage:Ne.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===pt.POSITION&&s&&(r.typedArray=i),r}var Rce,mk;function CHe(e){if(!c(mk)){Rce=new Gce.default(0),mk=new Array(e);for(let t=0;t<e;++t)mk[t]=Rce.random()}return mk}var VHe=new m,LHe=new m,ZHe=new m;function RHe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=CHe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=m.fromElements(s,s,s,VHe),d=m.fromElements(a,a,a,LHe),u,f,p;if(e.isQuantized)l=m.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)f=Math.floor(r[u]*i),p=m.unpack(t,f*3,ZHe),m.minimumByComponent(l,p,l),m.maximumByComponent(d,p,d);e.min=m.clone(l),e.max=m.clone(d)}var GHe={name:pt.COLOR,semantic:pt.COLOR,setIndex:0,constantColor:Y.DARKGRAY,componentDatatype:q.FLOAT,type:rn.VEC4,isQuantized:!1,isTranslucent:!1};function EHe(e,t,n){let i=[],o,r=t.positions;return c(r)&&(RHe(r),o=Pw(e,r,n),o.count=t.pointsLength,i.push(o)),c(t.normals)&&(o=Pw(e,t.normals,n),i.push(o)),c(t.colors)?(o=Pw(e,t.colors,n),i.push(o)):(o=Pw(e,GHe,n),i.push(o)),c(t.batchIds)&&(o=Pw(e,t.batchIds,n),i.push(o)),i}function XHe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!c(e.batchIds);return c(o)||e.hasDracoBatchTable?mb({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new Ds({schema:{},propertyTables:[]})}function IHe(e,t){let n=e._parsedContent,i=new gHe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new yHe;o.metallicRoughness=i;let r=n.colors;c(r)&&r.isTranslucent&&(o.alphaMode=Th.BLEND);let s=!c(n.normals);o.unlit=s;let a=new hHe;if(a.attributes=EHe(e,n,t),a.primitiveType=ve.POINTS,a.material=o,c(n.batchIds)){let y=new bHe;y.propertyTableId=0,y.setIndex=0,y.positionalLabel="featureId_0",a.featureIds.push(y)}let l=new fHe;l.index=0,l.primitives=[a];let d=new mHe;d.nodes=[l],d.upAxis=Po.Z,d.forwardAxis=Po.X;let u=new uHe;u.scene=d,u.nodes=[l];let f=[];u.structuralMetadata=XHe(n,f),f.length>0&&WHe(e,a,f,t),c(n.rtcCenter)&&(u.transform=M.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;c(p)&&p.isQuantized&&(u.transform=M.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function WHe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=_t.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Ne.STATIC_DRAW});l.vertexArrayDestroyable=!1,e._buffers.push(l),a.buffer=l,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Py.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 vw=Py;var nNn=_(T(),1);var wHe=new m,PHe=new m,vHe=new m,FHe=new M,AHe=new M,MHe=new M,NHe=new pe,kHe=new ue;function m1(e,t,n,i,o,r,s){if(C.typeOf.object("model",e),C.typeOf.object("ray",t),C.typeOf.object("frameState",n),!e._ready||n.mode===se.MORPHING)return;let a=Number.MAX_VALUE,l=e.sceneGraph,d=l._runtimeNodes;for(let u=0;u<d.length;u++){let f=d[u],p=f.node,y=M.clone(f.computedTransform,FHe),h=M.clone(l.computedModelMatrix,AHe),g=p.instances;c(g)&&g.transformInWorldSpace&&(h=M.multiplyTransformation(e.modelMatrix,l.components.transform,h),y=M.multiplyTransformation(l.axisCorrectionMatrix,f.computedTransform,y));let x=M.multiplyTransformation(h,y,MHe);n.mode!==se.SCENE3D&&(x=wt.basisTo2D(n.mapProjection,x,x));let S=[];if(c(g)){let Z=g.attributes[0].count,R=g.attributes[0].componentDatatype,E=12,I=f.transformsTypedArray;if(!c(I)){let v=f.instancingTransformsBuffer;c(v)&&n.context.webgl2&&(I=q.createTypedArray(R,Z*E),v.getBufferData(I))}if(c(I))for(let v=0;v<Z;v++){let P=v*E,F=new M(I[P],I[P+1],I[P+2],I[P+3],I[P+4],I[P+5],I[P+6],I[P+7],I[P+8],I[P+9],I[P+10],I[P+11],0,0,0,1);g.transformInWorldSpace?(M.multiplyTransformation(F,y,F),M.multiplyTransformation(h,F,F)):M.multiplyTransformation(F,x,F),S.push(F)}}S.length===0&&S.push(x);let V=f.runtimePrimitives.length;for(let Z=0;Z<V;Z++){let R=f.runtimePrimitives[Z],E=R.primitive;if(c(R.boundingSphere)&&!c(g)){let Q=ue.transform(R.boundingSphere,x,kHe),ie=qn.raySphere(t,Q);if(!c(ie))continue}let I=qt.getAttributeBySemantic(E,pt.POSITION),v=I.byteOffset,P=I.byteStride,F=I.count;if(!c(E.indices))continue;let N=E.indices.typedArray;if(!c(N)){let Q=E.indices.buffer,ie=E.indices.count,j=E.indices.indexDatatype;c(Q)&&n.context.webgl2&&(j===Me.UNSIGNED_BYTE?N=new Uint8Array(ie):j===Me.UNSIGNED_SHORT?N=new Uint16Array(ie):j===Me.UNSIGNED_INT&&(N=new Uint32Array(ie)),Q.getBufferData(N))}let b=I.typedArray,G=I.componentDatatype,X=I.type,W=I.quantization;c(W)&&(G=I.quantization.componentDatatype,X=I.quantization.type);let A=rn.getNumberOfComponents(X),k=q.getSizeInBytes(G),B=!c(b)&&c(P)&&P!==A*k,O=A,H=0;B&&(O=P/k,H=v/k);let U=F*O;if(!c(b)){let Q=I.buffer;c(Q)&&n.context.webgl2&&(b=q.createTypedArray(G,U),Q.getBufferData(b,B?0:v,0,U)),W&&I.normalized&&(b=Fn.dequantize(b,G,X,F))}if(!c(N)||!c(b))return;r=r??re.default,i=i??1,o=o??0;let K=N.length;for(let Q=0;Q<K;Q+=3){let ie=N[Q],j=N[Q+1],$=N[Q+2];for(let ne of S){let be=Az(b,ie,H,O,W,ne,i,o,r,wHe),Ce=Az(b,j,H,O,W,ne,i,o,r,PHe),me=Az(b,$,H,O,W,ne,i,o,r,vHe),_e=qn.rayTriangleParametric(t,be,Ce,me,e.backFaceCulling??!0);c(_e)&&_e<a&&_e>=0&&(a=_e)}}}}if(a!==Number.MAX_VALUE){if(s=bn.getPoint(t,a,s),n.mode!==se.SCENE3D){m.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,p=u.unproject(s,NHe);f.cartographicToCartesian(p,s)}return s}}function Az(e,t,n,i,o,r,s,a,l,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],c(o))if(o.octEncoded){if(d=Fn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let f=d.x;d.x=d.z,d.z=d.y,d.y=f}}else d=m.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=m.add(d,o.quantizedVolumeOffset,d);return d=M.multiplyByPoint(r,d,d),s!==1&&Lr.getPosition(d,l,s,a,d),d}function ao(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.loader",e.loader),C.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=e.type??mr.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=c(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=te.clone(te.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 iW(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=Y.clone(e.color),this._colorBlendMode=e.colorBlendMode??bc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??Y.RED;this._silhouetteColor=Y.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Xe.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ue,this._initialRadius=void 0,this._heightReference=e.heightReference??ze.NONE,this._heightDirty=this._heightReference!==ze.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;c(o)&&c(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Vh(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;c(s)&&s.owner===void 0?hs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let a=e.clippingPolygons;c(a)&&a.owner===void 0?qm.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=m.clone(e.lightColor),this._imageBasedLighting=c(e.imageBasedLighting)?e.imageBasedLighting:new $x,this._shouldDestroyImageBasedLighting=!c(e.imageBasedLighting),this._environmentMapManager=void 0;let l=new sb(e.environmentMapOptions);sb.setOwner(l,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Sn.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===mr.GLTF&&ht("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new Ct(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Ar.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??Y.BLACK,this._classificationType=e.classificationType,this._statistics=new ww,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 ye,this._readyEvent=new ye,this._texturesReadyEvent=new ye,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function Mz(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function UHe(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 sW({model:e,propertyTable:s});n.push(a)}return n}function OHe(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],c(a.instances)&&(s=qt.getFeatureIdsByLabel(a.instances.featureIds,i),c(s)&&c(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 l=a.primitives[r],d=qt.getFeatureIdsByLabel(l.featureIds,n);if(c(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function Uz(e,t){if(!c(e)&&!c(t))return!1;if(c(e)!==c(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(ao.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){C.defined("pointCloudShading",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){if(c(e)&&e.far<=e.near)throw new L("far must be greater than near");this._distanceDisplayCondition=vt.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){Uz(e,this._color)&&this.resetDrawCommands(),this._color=Y.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(!Y.equals(e,this._silhouetteColor)){let t=Uz(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=Y.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(){if(!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");let e=c(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Ice(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===mr.GLTF&&ht("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}`),C.typeOf.string("value",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}`),C.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(hs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(qm.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}},lightColor:{get:function(){return this._lightColor},set:function(e){c(e)!==c(this._lightColor)&&this.resetDrawCommands(),this._lightColor=m.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){C.typeOf.object("imageBasedLighting",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){C.typeOf.object("environmentMapManager",e),e!==this.environmentMapManager&&(sb.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}}});ao.prototype.getNode=function(e){if(!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return C.typeOf.string("name",e),this._nodesByName[e]};ao.prototype.setArticulationStage=function(e,t){if(C.typeOf.number("value",t),!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.setArticulationStage(e,t)};ao.prototype.applyArticulations=function(){if(!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.applyArticulations()};ao.prototype.getExtension=function(e){if(C.typeOf.string("extensionName",e),!this._ready)throw new L("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return this._loader.components.extensions[e]};ao.prototype.makeStyleDirty=function(){this._styleDirty=!0};ao.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var DHe=new M,BHe=new te,YHe=new M;ao.prototype.update=function(e){let t=!1;try{t=HHe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")Mz(this,n);else{let i=qt.getError("model",this._resource,n);Mz(this,i)}}if(zHe(this,e),KHe(this,e),JHe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!c(n)){if(this._loader.isUnloaded())return;let r=qt.getError("model",this._resource,new le("Failed to load model."));Mz(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;c(i)&&i.propertyTableCount>0&&UHe(this,i);let o=new Ww({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===se.MORPHING)){if(QHe(this),jHe(this),qHe(this,e),$He(this),eze(this,e),tze(this,e),nze(this,e),ize(this,e),oze(this,e),rze(this,e),sze(this,e),this._defaultTexture=e.context.defaultTexture,aze(this,e),cze(this,e),lze(this),dze(this,e),hze(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)),mze(this),pze(this,e),bze(this),yze(this,e)}};function HHe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function zHe(e,t){c(e._customShader)&&e._customShader.update(t)}function KHe(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=!c(e._imageBasedLighting.sphericalHarmonicCoefficients)||!c(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function JHe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function QHe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;c(n)&&n.propertyTableCount>0&&(e.featureTableId=OHe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function jHe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function qHe(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&&Xce(e)}function Xce(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=sf.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function $He(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 eze(e,t){e._silhouetteDirty&&(Wce(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function tze(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function nze(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 ize(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 oze(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function rze(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function sze(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 aze(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function cze(e,t){if(!M.equals(e.modelMatrix,e._modelMatrix)){if(t.mode!==se.SCENE3D&&e._projectTo2D)throw new L("Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.");e._updateModelMatrix=!0,e._modelMatrix=M.clone(e.modelMatrix,e._modelMatrix)}}var vy=new m,Nz=new pe;function lze(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;c(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!c(t)||e.heightReference===ze.NONE){if(e.heightReference!==ze.NONE)throw new L("Height reference is not supported without a scene.");e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??re.default,i=e.modelMatrix;vy.x=i[12],vy.y=i[13],vy.z=i[14];let o=n.cartesianToCartographic(vy);c(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(i,new M)),e._removeUpdateHeightCallback=t.updateHeight(o,Ece(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(c(r)){let s=Ece(e,n,o);pe.clone(o,Nz),Nz.height=r,s(Nz)}e._heightDirty=!1,e._updateModelMatrix=!0}function dze(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Ice(e,n),uze(e,n,t)}function Ice(e,t){e._clampedScale=c(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=m.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ue.transform(e._boundingSphere,t,e._boundingSphere)}function uze(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,vy),e._sceneMode!==se.SCENE3D&&Oi.computeActualEllipsoidPosition(n,vy,vy);let s=e._boundingSphere.radius,a=gze(vy,s,n),l=1/a;Math.min(l*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=c(e.maximumScale)?Math.min(e.maximumScale,i):i}function mze(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 fze=new te(1,0,0,0,0,1,0,-1,0);function hze(e,t){let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=BHe,s=DHe;if(s=M.multiply(o.uniformState.view3D,i,s),r=M.getRotation(s,r),r=te.transpose(r,r),e._iblReferenceFrameMatrix=te.multiply(fze,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=YHe;a=M.multiply(o.uniformState.view3D,i,a),a=M.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function pze(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=c(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;c(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function bze(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(c(e._credit)){let s=Ct.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=Ct.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=Ct.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function yze(e,t){let n=_ze(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&&(Tze(e,t),e._sceneGraph.pushDrawCommands(t))}var kz=new ue;function gze(e,t,n){return kz.center=e,kz.radius=t,n.camera.getPixelSize(kz,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var fk=new m;function Ece(e,t,n){return function(i){e.heightReference===ze.CLIP_TO_GROUND?n.height>=i.height&&(i.height=n.height):lC(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,fk);let o=e._clampedModelMatrix;M.clone(e.modelMatrix,o),o[12]=fk.x,o[13]=fk.y,o[14]=fk.z,e._heightDirty=!0}}var xze=new m;function _ze(e,t){let n=e.distanceDisplayCondition;if(!c(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===se.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=M.getTranslation(e.modelMatrix,xze);Oi.computeActualEllipsoidPosition(t,s,s),r=m.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Tze(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}ao.prototype.isTranslucent=function(){let e=this.color;return c(e)&&e.alpha>0&&e.alpha<1};ao.prototype.isInvisible=function(){let e=this.color;return c(e)&&e.alpha===0};function Wce(e){return e.context.stencilBuffer}ao.prototype.hasSilhouette=function(e){return Wce(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!c(this._classificationType)};ao.prototype.hasSkipLevelOfDetail=function(e){if(!mr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};ao.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return c(e)&&e.enabled&&e.length!==0};ao.prototype.pick=function(e,t,n,i,o){return m1(this,e,t,n,i,o)};ao.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return c(e)&&e.enabled&&e.length!==0};ao.prototype.isDestroyed=function(){return!1};ao.prototype.destroy=function(){let e=this._loader;c(e)&&e.destroy();let t=this._featureTables;if(c(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),c(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;c(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;c(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,he(this)};ao.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};ao.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};ao.fromGltfAsync=async function(e){if(e=e??z.EMPTY_OBJECT,!c(e.url)&&!c(e.gltf))throw new L("options.url is required.");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:c(e.classificationType)},i=e.basePath??"",o=Ge.createIfNeeded(i);c(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Ge.createIfNeeded(t);let r=new nf(n),a=c(e.content)?mr.TILE_GLTF:mr.GLTF,l=n.gltfResource,d=Fw(r,a,e);d.resource=l,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(y){throw r.destroy(),qt.getError("model",l,y)}let u=e.gltfCallback;c(u)&&(C.typeOf.func("options.gltfCallback",u),u(r.gltfJson));let f=new ao(d),p=f._resource.credits;if(c(p)){let y=p.length;for(let h=0;h<y;h++)f._resourceCredits.push(Ct.clone(p[h]))}return f};ao.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:c(e.classificationType)},n=new KI(t);try{await n.load();let i=Fw(n,mr.TILE_B3DM,e);return new ao(i)}catch(i){throw n.destroy(),i}};ao.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new vw(t);try{await n.load();let i=Fw(n,mr.TILE_PNTS,e);return new ao(i)}catch(i){throw n.destroy(),i}};ao.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 jI(t);try{await n.load();let i=Fw(n,mr.TILE_I3DM,e);return new ao(i)}catch(i){throw n.destroy(),i}};ao.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new JI(t),i=Fw(n,mr.TILE_GEOJSON,e);return new ao(i)};var Sze=new Y;ao.prototype.applyColorAndShow=function(e){let t=Y.clone(this._color,Sze),n=c(e)&&c(e.color),i=c(e)&&c(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):Y.clone(Y.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,Uz(t,this._color)&&this.resetDrawCommands()};ao.prototype.applyStyle=function(e){let t=this.type===mr.TILE_PNTS,n=c(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=c(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=c(i)&&c(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Xce(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function Fw(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 af=ao;function Or(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(Or.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return c(t)&&c(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(c(t)&&c(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}}});Or.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};Or.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};Or.prototype.getExtension=function(e){return this._model.getExtension(e)};Or.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;if(!c(n))throw new L("No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined");let i=t.featureTables[n];if(!c(i))throw new L("No feature table found for the selected feature ID set");let o=i.featuresLength;if(!c(e)||e<0||e>=o)throw new L(`featureId is required and must be between 0 and featuresLength - 1 (${o-1}).`);return i.getFeature(e)};Or.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return c(i)?n.featureTables[i].hasProperty(e,t):!1};Or.prototype.applyDebugSettings=function(e,t){t=e?t:Y.WHITE,this.featuresLength===0?this._model.color=t:c(this.batchTable)&&this.batchTable.setAllColor(t)};Or.prototype.applyStyle=function(e){this._model.style=e};Or.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,c(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),c(o)&&c(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;c(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),c(s)&&c(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Al.REPEAT}),this._ready=!0)};Or.prototype.isDestroyed=function(){return!1};Or.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),he(this)};Or.fromGltf=async function(e,t,n,i){let o=new Or(e,t,n),s=Aw(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let l=await af.fromGltfAsync(s);return o._model=l,o};Or.fromB3dm=async function(e,t,n,i,o){let r=new Or(e,t,n),a=Aw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=l;let d=await af.fromB3dm(a);return r._model=d,r};Or.fromI3dm=async function(e,t,n,i,o){let r=new Or(e,t,n),a=Aw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await af.fromI3dm(a);return r._model=l,r};Or.fromPnts=async function(e,t,n,i,o){let r=new Or(e,t,n),a=Aw(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await af.fromPnts(a);return r._model=l,r};Or.fromGeoJson=async function(e,t,n,i){let o=new Or(e,t,n),s=Aw(e,t,o,{geoJson:i,resource:n}),a=await af.fromGeoJson(s);return o._model=a,o};Or.prototype.pick=function(e,t,n){if(!c(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,re.WGS84,n)};function Aw(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Xe.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 Rd=Or;var a5n=_(T(),1);function Au(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(Au.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}}});Au.fromJson=function(e,t,n,i){let o=new Au(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Au.prototype.hasProperty=function(e,t){return!1};Au.prototype.getFeature=function(e){};Au.prototype.applyDebugSettings=function(e,t){};Au.prototype.applyStyle=function(e){};Au.prototype.update=function(e,t){};Au.prototype.pick=function(e,t,n){};Au.prototype.isDestroyed=function(){return!1};Au.prototype.destroy=function(){return he(this)};var Mw=Au;var f3n=_(T(),1);var pDn=_(T(),1);var Ikn=_(T(),1);var l5n=_(T(),1),Nw=`uniform sampler2D u_atlas;
#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
#ifdef FRAGMENT_DEPTH_CHECK
in vec4 v_textureCoordinateBounds;
in vec4 v_originTextureCoordinateAndTranslate;
in vec4 v_compressed;
in mat2 v_rotationMatrix;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT1 = 2.0;
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;
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));
vec2 translation = v_originTextureCoordinateAndTranslate.zw;
if (applyTranslate)
{
translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
}
vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
if (logDepthOrDepth == 0.0)
{
return 0.0;
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
#ifdef SDF
float getDistance(vec2 position)
{
return texture(u_atlas, position).r;
}
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
{
float distance = getDistance(position);
if (outlineWidth > 0.0)
{
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
void main()
{
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
vec4 color = texture(u_atlas, v_textureCoordinates);
#ifdef SDF
float outlineWidth = v_outlineWidth;
vec4 outlineColor = v_outlineColor;
float distance = getDistance(v_textureCoordinates);
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
float smoothing = fwidth(distance);
vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
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);
color = (center + color1 + color2 + color3 + color4)/5.0;
#else
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
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
if (color.a < 0.005)
{
discard;
}
#else
#ifdef OPAQUE
if (color.a < 0.995)
{
discard;
}
#else
if (color.a >= 0.995)
{
discard;
}
#endif
#endif
#ifdef VECTOR_TILE
color *= u_highlightColor;
#endif
out_FragColor = color;
#ifdef LOG_DEPTH
czm_writeLogDepth();
#endif
#ifdef FRAGMENT_DEPTH_CHECK
float temp = v_compressed.y;
temp = temp * SHIFT_RIGHT1;
float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
bool enableDepthTest = temp2 != 0.0;
bool applyTranslate = floor(temp) != 0.0;
if (enableDepthTest) {
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);
if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
{
float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize);
if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
{
float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize);
if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
{
discard;
}
}
}
}
#endif
}
`;var u5n=_(T(),1),kw=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScale;
in vec4 positionLowAndRotation;
in vec4 compressedAttribute0;
in vec4 compressedAttribute1;
in vec4 compressedAttribute2;
in vec4 eyeOffset;
in vec4 scaleByDistance;
in vec4 pixelOffsetScaleByDistance;
in vec4 compressedAttribute3;
in vec2 sdf;
in float splitDirection;
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
in vec4 textureCoordinateBoundsOrLabelTranslate;
#endif
#ifdef VECTOR_TILE
in float a_batchId;
#endif
out vec2 v_textureCoordinates;
#ifdef FRAGMENT_DEPTH_CHECK
out vec4 v_textureCoordinateBounds;
out vec4 v_originTextureCoordinateAndTranslate;
out vec4 v_compressed;
out mat2 v_rotationMatrix;
#endif
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)
{
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 VERTEX_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;
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
void main()
{
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 FRAGMENT_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.y += (temp - floor(temp)) * SHIFT_LEFT8;
translate.y -= UPPER_BOUND;
temp = compressedAttribute1.x * SHIFT_RIGHT8;
float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
vec2 imageSize = vec2(floor(temp), temp2);
#ifdef FRAGMENT_DEPTH_CHECK
float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
float applyTranslate = 0.0;
if (labelHorizontalOrigin != 0.0)
{
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(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_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;
#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
float eyeDepth = positionEC.z;
#endif
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)
{
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;
if (scale == 0.0)
{
positionEC.xyz = vec3(0.0);
}
#endif
float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
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;
#ifdef DISABLE_DEPTH_DISTANCE
float disableDepthTestDistance = compressedAttribute3.z;
#endif
#ifdef VERTEX_DEPTH_CHECK
if (lengthSq < disableDepthTestDistance) {
float depthsilon = 10.0;
vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, 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), origin, labelTranslate, 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), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth3 = getGlobeDepth(pEC3);
if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
{
positionEC.xyz = vec3(0.0);
}
}
}
}
#endif
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 (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
{
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
}
if (disableDepthTestDistance != 0.0)
{
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)))
{
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = 1.0;
#endif
}
}
#endif
#ifdef FRAGMENT_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 enableDepthCheck = 0.0;
if (lengthSq < disableDepthTestDistance)
{
enableDepthCheck = 1.0;
}
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.x = eyeDepth;
v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
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 D5n=_(T(),1);var g5n=_(T(),1);var f5n=_(T(),1),Cze=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),is=Cze;function gb(e){C.defined("billboardCollection",e),this._billboardCollection=e,this._id=void 0,this._loadState=is.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(gb.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===is.LOADED}},hasImage:{get:function(){return this._loadState!==is.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});gb.prototype.unload=async function(){this._loadState!==is.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=is.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};gb.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(c(o)&&t.loadState===is.LOADING||t.loadState===is.LOADED){gb.clone(o,this);return}c(o)||(o=new gb(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=is.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(l){if(o._loadState=is.ERROR,o._loadError=l,this._id!==e)return;this._loadState=is.ERROR,this._loadError=l;return}if(!c(r)||r===-1){if(o._loadState=is.FAILED,o._index=-1,this._id!==e)return;this._loadState=is.FAILED,this._index=-1;return}o._index=r,o._loadState=is.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=is.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};gb.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=is.LOADING,this._loadError=void 0,this._hasSubregion=!0;let n,i=this._billboardCollection.textureAtlas;try{n=await i.addImageSubRegion(e,t)}catch(o){this._loadState=is.ERROR,this._loadError=o;return}if(!c(n)||n===-1){this._loadState=is.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=n,this._loadState=is.LOADED,this.dirty=!0};gb.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};gb.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 xb=gb;function pi(e,t){if(e=e??z.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new L("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Nt.clone(n)}if(c(i)){if(i.far<=i.near)throw new L("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Nt.clone(i)}if(c(o)){if(o.far<=o.near)throw new L("scaleByDistance.far must be greater than scaleByDistance.near.");o=Nt.clone(o)}if(c(r)){if(r.far<=r.near)throw new L("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=vt.clone(r)}this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._pixelOffset=D.clone(e.pixelOffset??D.ZERO),this._translate=new D(0,0),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._heightReference=e.heightReference??ze.NONE,this._verticalOrigin=e.verticalOrigin??Mn.CENTER,this._horizontalOrigin=e.horizontalOrigin??xi.CENTER,this._scale=e.scale??1,this._color=Y.clone(e.color??Y.WHITE),this._rotation=e.rotation??0,this._alignedAxis=m.clone(e.alignedAxis??m.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new xb(t),this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;c(s)&&(c(a)||(typeof s=="string"?a=s:c(s.src)?a=s.src:a=Hn()),this._imageTexture.loadImage(a,s)),c(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=se.SCENE3D,this._clusterShow=!0,this._outlineColor=Y.clone(e.outlineColor??Y.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Ar.NONE}var wce=pi.SHOW_INDEX=0,pk=pi.POSITION_INDEX=1,Mce=pi.PIXEL_OFFSET_INDEX=2,Vze=pi.EYE_OFFSET_INDEX=3,Lze=pi.HORIZONTAL_ORIGIN_INDEX=4,Zze=pi.VERTICAL_ORIGIN_INDEX=5,Rze=pi.SCALE_INDEX=6,Pce=pi.IMAGE_INDEX_INDEX=7,vce=pi.COLOR_INDEX=8,Gze=pi.ROTATION_INDEX=9,Eze=pi.ALIGNED_AXIS_INDEX=10,Xze=pi.SCALE_BY_DISTANCE_INDEX=11,Ize=pi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Wze=pi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,wze=pi.DISTANCE_DISPLAY_CONDITION=14,Pze=pi.DISABLE_DEPTH_DISTANCE=15;pi.TEXTURE_COORDINATE_BOUNDS=16;var Fce=pi.SDF_INDEX=17,vze=pi.SPLIT_DIRECTION_INDEX=18;pi.NUMBER_OF_PROPERTIES=19;function ir(e,t){let n=e._billboardCollection;c(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(pi.prototype,{show:{get:function(){return this._show},set:function(e){C.typeOf.bool("value",e),this._show!==e&&(this._show=e,ir(this,wce))}},position:{get:function(){return this._position},set:function(e){C.typeOf.object("value",e);let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),this._updateClamping(),ir(this,pk))}},heightReference:{get:function(){return this._heightReference},set:function(e){C.typeOf.number("value",e);let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),ir(this,pk))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){C.typeOf.object("value",e);let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),ir(this,Mce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");let t=this._scaleByDistance;Nt.equals(t,e)||(this._scaleByDistance=Nt.clone(e,t),ir(this,Xze))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");let t=this._translucencyByDistance;Nt.equals(t,e)||(this._translucencyByDistance=Nt.clone(e,t),ir(this,Ize))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;Nt.equals(t,e)||(this._pixelOffsetScaleByDistance=Nt.clone(e,t),ir(this,Wze))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){C.typeOf.object("value",e);let t=this._eyeOffset;m.equals(t,e)||(m.clone(e,t),ir(this,Vze))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){C.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,ir(this,Lze))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){C.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,ir(this,Zze))}},scale:{get:function(){return this._scale},set:function(e){C.typeOf.number("value",e),this._scale!==e&&(this._scale=e,ir(this,Rze))}},color:{get:function(){return this._color},set:function(e){C.typeOf.object("value",e);let t=this._color;Y.equals(t,e)||(Y.clone(e,t),ir(this,vce))}},rotation:{get:function(){return this._rotation},set:function(e){C.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,ir(this,Gze))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){C.typeOf.object("value",e);let t=this._alignedAxis;m.equals(t,e)||(m.clone(e,t),ir(this,Eze))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){c(e)&&C.typeOf.number("width",e),this._width!==e&&(this._width=e,ir(this,Pce))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){c(e)&&C.typeOf.number("height",e),this._height!==e&&(this._height=e,ir(this,Pce))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){C.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,ir(this,vce))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!vt.equals(e,this._distanceDisplayCondition)){if(c(e)&&(C.typeOf.object("value",e),e.far<=e.near))throw new L("far distance must be greater than near distance.");this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition),ir(this,wze)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(c(e)&&(C.typeOf.number("value",e),e<0))throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,ir(this,Pze))}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,c(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!c(e)){this._imageTexture.unload();return}let t;typeof e=="string"?t=e:e instanceof Ge?t=e._url:c(e.src)?t=e.src:t=Hn(),this._imageTexture.loadImage(t,e)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition),ir(this,pk)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,ir(this,wce))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),ir(this,Fce))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,ir(this,Fce))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,ir(this,vze))}}});pi.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};pi.prototype._updateClamping=function(){pi._updateClamping(this._billboardCollection,this)};var Uw=new pe;pi._updateClamping=function(e,t){if(!c(e)||!c(e._scene)){if(t._heightReference!==ze.NONE)throw new L("Height reference is not supported without a scene.");return}let n=e._scene,i=n.ellipsoid??re.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===ze.NONE||r)&&c(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===ze.NONE||!c(t._position))return;c(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!c(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);if(lC(t._heightReference))t._mode===se.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height;else if(t._heightReference===ze.CLIP_TO_GROUND)if(t._mode===se.SCENE3D){let f=i.cartesianToCartographic(d,Uw);s.height>=f.height&&(f.height=s.height),i.cartographicToCartesian(f,d)}else s.height>=d.x&&(d.x=s.height);t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),pe.clone(s,Uw);let l=n.getHeight(s,t._heightReference);c(l)&&(Uw.height=l),a(Uw)};pi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};pi.prototype.setImage=function(e,t){C.typeOf.string("id",e),C.defined("image",t),this._imageTexture.loadImage(e,t)};pi.prototype.setImageTexture=function(e){C.defined("billboardTexture",e),xb.clone(e,this._imageTexture)};pi.prototype.setImageSubRegion=function(e,t){C.typeOf.string("id",e),C.defined("subRegion",t),this._imageTexture.addImageSubRegion(e,t)};pi.prototype._setTranslate=function(e){if(!c(e))throw new L("value is required.");let t=this._translate;D.equals(t,e)||(D.clone(e,t),ir(this,Mce))};pi.prototype._getActualPosition=function(){return c(this._clampedPosition)?this._clampedPosition:this._actualPosition};pi.prototype._setActualPosition=function(e){c(this._clampedPosition)||m.clone(e,this._actualPosition),ir(this,pk)};var Ace=new ce;pi._computeActualPosition=function(e,t,n,i){return c(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===se.SCENE3D?t:(M.multiplyByPoint(i,t,Ace),Oi.computeActualEllipsoidPosition(n,Ace))};var Nce=new m;pi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=M.multiplyByPoint(e,t,Nce),a=Oi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(c(a))return D.add(a,i,a),a};var hk=new D(0,0);pi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;if(c(t)||(t=new D),!c(n))throw new L("Billboard must be in a collection.  Was it removed?");if(!c(e))throw new L("scene is required.");D.clone(this._pixelOffset,hk),D.add(hk,this._translate,hk);let i=n.modelMatrix,o=this._position;if(c(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==se.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,l=s.unproject(o,Uw);o=a.cartographicToCartesian(l,Nce),i=M.IDENTITY}return pi._computeScreenSpacePosition(i,o,this._eyeOffset,hk,e,t)};pi.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===xi.RIGHT?s-=i:e.horizontalOrigin===xi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?a-=o:e.verticalOrigin===Mn.CENTER&&(a-=o*.5),c(n)||(n=new je),n.x=s,n.y=a,n.width=i,n.height=o,n};pi.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&m.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Y.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&m.equals(this._eyeOffset,e._eyeOffset)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Nt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&vt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};pi.prototype._destroy=function(){c(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),c(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var co=pi;var Y5n=_(T(),1),Fze={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Lo=Object.freeze(Fze);var z5n=_(T(),1),Aze={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ys=Object.freeze(Aze);var Mze=co.SHOW_INDEX,Ow=co.POSITION_INDEX,kce=co.PIXEL_OFFSET_INDEX,Uce=co.EYE_OFFSET_INDEX,Nze=co.HORIZONTAL_ORIGIN_INDEX,kze=co.VERTICAL_ORIGIN_INDEX,Uze=co.SCALE_INDEX,W_=co.IMAGE_INDEX_INDEX,Oce=co.COLOR_INDEX,Oze=co.ROTATION_INDEX,Dze=co.ALIGNED_AXIS_INDEX,Dce=co.SCALE_BY_DISTANCE_INDEX,Bce=co.TRANSLUCENCY_BY_DISTANCE_INDEX,Yce=co.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Hce=co.DISTANCE_DISPLAY_CONDITION,Bze=co.DISABLE_DEPTH_DISTANCE,Yze=co.TEXTURE_COORDINATE_BOUNDS,zce=co.SDF_INDEX,Kce=co.SPLIT_DIRECTION_INDEX,Kz=co.NUMBER_OF_PROPERTIES,lo,Hze={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},zze={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 Nu(e){e=e??z.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;c(t)||(t=new Zx),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(Kz),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=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??Lo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW],this._highlightColor=Y.clone(Y.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};let n=this._scene;c(n)&&c(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)c(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Nu.prototype,{length:{get:function(){return Jz(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){C.defined("textureAtlas",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 Jce(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Nu.prototype.add=function(e){let t=new co(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Nu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Nu.prototype.removeAll=function(){Jce(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Jz(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];c(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Nu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Nu.prototype.contains=function(e){return c(e)&&e._billboardCollection===this};Nu.prototype.get=function(e){return C.typeOf.number("index",e),Jz(this),this._billboards[e]};var Oz;function Kze(e){let n=e.cache.billboardCollection_indexBufferBatched;if(c(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=_t.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function Jze(e){let t=e.cache.billboardCollection_indexBufferInstanced;return c(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Qze(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return c(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Nu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Kz;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function jze(e,t,n,i,o,r){let s=[{index:lo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Ow]},{index:lo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Ow]},{index:lo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[kce]},{index:lo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Bce]},{index:lo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Oce]},{index:lo.eyeOffset,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Uce]},{index:lo.scaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Dce]},{index:lo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Yce]},{index:lo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Hce]},{index:lo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Yze]},{index:lo.splitDirection,componentsPerAttribute:1,componentDatatype:q.FLOAT,usage:n[Kce]}];i&&s.push({index:lo.direction,componentsPerAttribute:2,componentDatatype:q.FLOAT,vertexBuffer:Qze(e)}),c(o)&&s.push({index:lo.a_batchId,componentsPerAttribute:1,componentDatatype:q.FLOAT,bufferUsage:Ne.STATIC_DRAW}),r&&s.push({index:lo.sdf,componentsPerAttribute:2,componentDatatype:q.FLOAT,usage:n[zce]});let a=i?t:4*t;return new Ip(e,s,a,i)}var Dz=new Bn;function Qce(e,t,n,i){let o,r=n[lo.positionHighAndScale],s=n[lo.positionLowAndRotation],a=i._getActualPosition();e._mode===se.SCENE3D&&(ue.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Bn.fromCartesian(a,Dz);let l=i.scale,d=i.rotation;d!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);let u=Dz.high,f=Dz.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,l),s(o,f.x,f.y,f.z,d)):(o=i._index*4,r(o+0,u.x,u.y,u.z,l),r(o+1,u.x,u.y,u.z,l),r(o+2,u.x,u.y,u.z,l),r(o+3,u.x,u.y,u.z,l),s(o+0,f.x,f.y,f.z,d),s(o+1,f.x,f.y,f.z,d),s(o+2,f.x,f.y,f.z,d),s(o+3,f.x,f.y,f.z,d))}var kl=new D,Mu=32768,f1=65536,Bz=4096,Zh=256,qze=128,$ze=32,eKe=8,jce=4,tKe=1/256,qce=0,$ce=2,ele=3,tle=1,Qz=new je;function nle(e,t,n,i){let o,r=n[lo.compressedAttribute0],s=i.pixelOffset,a=s.x,l=s.y,d=i._translate,u=d.x,f=d.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-l+f));let p=i.horizontalOrigin,y=i._verticalOrigin,h=i.show&&i.clusterShow;i.color.alpha===0&&(h=!1),y===Mn.BASELINE&&(y=Mn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===xi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&y===Mn.CENTER;let g=0,x=0,S=0,V=0;if(i.ready){let A=i.computeTextureCoordinates(Qz);g=A.x,x=A.y,S=A.width,V=A.height}let Z=g+S,R=x+V,E=Math.floor(w.clamp(a,-Mu,Mu)+Mu)*qze;E+=(p+1)*$ze,E+=(y+1)*eKe,E+=(h?1:0)*jce;let I=Math.floor(w.clamp(l,-Mu,Mu)+Mu)*Zh,v=Math.floor(w.clamp(u,-Mu,Mu)+Mu)*Zh,P=(w.clamp(f,-Mu,Mu)+Mu)*tKe,F=Math.floor(P),N=Math.floor((P-F)*Zh);I+=F,v+=N,kl.x=g,kl.y=x;let b=Fn.compressTextureCoordinates(kl);kl.x=Z;let G=Fn.compressTextureCoordinates(kl);kl.y=R;let X=Fn.compressTextureCoordinates(kl);kl.x=g;let W=Fn.compressTextureCoordinates(kl);e._instanced?(o=i._index,r(o,E,I,v,b)):(o=i._index*4,r(o+0,E+qce,I,v,b),r(o+1,E+$ce,I,v,G),r(o+2,E+ele,I,v,X),r(o+3,E+tle,I,v,W))}function ile(e,t,n,i){let o,r=n[lo.compressedAttribute1],s=i.alignedAxis;m.equals(s,m.ZERO)||(e._shaderAlignedAxis=!0);let a=0,l=1,d=1,u=1,f=i.translucencyByDistance;c(f)&&(a=f.near,l=f.nearValue,d=f.far,u=f.farValue,(l!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let y=w.clamp(p,0,f1),h=0;Math.abs(m.magnitudeSquared(s)-1)<w.EPSILON6&&(h=Fn.octEncodeFloat(s)),l=w.clamp(l,0,1),l=l===1?255:l*255|0,y=y*Zh+l,u=w.clamp(u,0,1),u=u===1?255:u*255|0,h=h*Zh+u,e._instanced?(o=i._index,r(o,y,h,a,d)):(o=i._index*4,r(o+0,y,h,a,d),r(o+1,y,h,a,d),r(o+2,y,h,a,d),r(o+3,y,h,a,d))}function Hz(e,t,n,i){let o,r=n[lo.compressedAttribute2],s=i.color,a=c(e._batchTable)?Y.WHITE:i.getPickId(t.context).color,l=i.sizeInMeters?1:0,d=Math.abs(m.magnitudeSquared(i.alignedAxis)-1)<w.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&l===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let f=i._labelHorizontalOrigin??-2;f+=2;let p=u*jce+f,y=Y.floatToByte(s.red),h=Y.floatToByte(s.green),g=Y.floatToByte(s.blue),x=y*f1+h*Zh+g;y=Y.floatToByte(a.red),h=Y.floatToByte(a.green),g=Y.floatToByte(a.blue);let S=y*f1+h*Zh+g,V=Y.floatToByte(s.alpha)*f1+Y.floatToByte(a.alpha)*Zh;V+=l*2+d,e._instanced?(o=i._index,r(o,x,S,V,p)):(o=i._index*4,r(o+0,x,S,V,p),r(o+1,x,S,V,p),r(o+2,x,S,V,p),r(o+3,x,S,V,p))}function zz(e,t,n,i){let o,r=n[lo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==ze.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(kl.x=0,kl.y=0,i.ready){let d=i.computeTextureCoordinates(Qz);kl.x=d.width,kl.y=d.height}let l=Fn.compressTextureCoordinates(kl);o=i._index,r(o,s.x,s.y,a,l)}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 ole(e,t,n,i){let o,r=n[lo.scaleByDistance],s=0,a=1,l=1,d=1,u=i.scaleByDistance;c(u)&&(s=u.near,a=u.nearValue,l=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,d)):(o=i._index*4,r(o+0,s,a,l,d),r(o+1,s,a,l,d),r(o+2,s,a,l,d),r(o+3,s,a,l,d))}function rle(e,t,n,i){let o,r=n[lo.pixelOffsetScaleByDistance],s=0,a=1,l=1,d=1,u=i.pixelOffsetScaleByDistance;c(u)&&(s=u.near,a=u.nearValue,l=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,d)):(o=i._index*4,r(o+0,s,a,l,d),r(o+1,s,a,l,d),r(o+2,s,a,l,d),r(o+3,s,a,l,d))}function sle(e,t,n,i){let o,r=n[lo.compressedAttribute3],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance,u=Lu(i.heightReference)&&t.context.depthTexture;c(d)||(d=u?5e3:0),d*=d,(u||d>0)&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let f,p;c(i._labelDimensions)?(p=i._labelDimensions.x,f=i._labelDimensions.y):(p=i.width??0,f=i.height??0);let y=Math.floor(w.clamp(p,0,Bz)),h=Math.floor(w.clamp(f,0,Bz)),g=y*Bz+h;e._instanced?(o=i._index,r(o,s,a,d,g)):(o=i._index*4,r(o+0,s,a,d,g),r(o+1,s,a,d,g),r(o+2,s,a,d,g),r(o+3,s,a,d,g))}function ale(e,t,n,i){if(Lu(i.heightReference)){let p=e._scene,y=t.context,h=t.globeTranslucencyState.translucent,g=c(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=y.depthTexture&&!h&&g}let o,r=n[lo.textureCoordinateBoundsOrLabelTranslate];if(mt.maximumVertexTextureImageUnits>0){let p=0,y=0;c(i._labelTranslate)&&(p=i._labelTranslate.x,y=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,y,0,0)):(o=i._index*4,r(o+0,p,y,0,0),r(o+1,p,y,0,0),r(o+2,p,y,0,0),r(o+3,p,y,0,0));return}let s=0,a=0,l=0,d=0;if(i.ready){let p=i.computeTextureCoordinates(Qz);s=p.x,a=p.y,l=p.width,d=p.height}let u=s+l,f=a+d;e._instanced?(o=i._index,r(o,s,a,u,f)):(o=i._index*4,r(o+0,s,a,u,f),r(o+1,s,a,u,f),r(o+2,s,a,u,f),r(o+3,s,a,u,f))}function nKe(e,t,n,i){if(!c(e._batchTable))return;let o=n[lo.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 cle(e,t,n,i){if(!e._sdf)return;let o,r=n[lo.sdf],s=i.outlineColor,a=i.outlineWidth,l=Y.floatToByte(s.red),d=Y.floatToByte(s.green),u=Y.floatToByte(s.blue),f=l*f1+d*Zh+u,p=a/Ys.RADIUS,y=Y.floatToByte(s.alpha)*f1+Y.floatToByte(p)*Zh;e._instanced?(o=i._index,r(o,f,y)):(o=i._index*4,r(o+0,f+qce,y),r(o+1,f+$ce,y),r(o+2,f+ele,y),r(o+3,f+tle,y))}function lle(e,t,n,i){let o=n[lo.splitDirection],r=0,s=i.splitDirection;c(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 iKe(e,t,n,i){Qce(e,t,n,i),nle(e,t,n,i),ile(e,t,n,i),Hz(e,t,n,i),zz(e,t,n,i),ole(e,t,n,i),rle(e,t,n,i),sle(e,t,n,i),ale(e,t,n,i),nKe(e,t,n,i),cle(e,t,n,i),lle(e,t,n,i)}function Yz(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l<n;++l){let d=t[l],u=d.position,f=co._computeActualPosition(d,u,i,o);c(f)&&(d._setActualPosition(f),r?a.push(f):ue.expand(s,f,s))}r&&ue.fromPoints(a,s)}function oKe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&Yz(e,i,i.length,t,r,!0)):n===se.MORPHING?Yz(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&Yz(e,o,e._billboardsToUpdateIndex,t,r,!1)}function rKe(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 sKe(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=Xe.OVERLAY,i}var aKe=[];Nu.prototype.update=function(e){if(Jz(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,lo=this._instanced?zze:Hze,Oz=this._instanced?Jze:Kze;let n=this._billboards,i=n.length,o=!0;for(let P=0;P<i;++P){let F=n[P];c(F.loadError)&&(console.error(`Error loading image for billboard: ${F.loadError}`),F.image=void 0),F.textureDirty&&this._updateBillboard(F,W_),F.show&&(o=o&&F.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!c(r.texture))return;oKe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,l=this._propertiesChanged,d=r.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let f,p=e.passes,y=p.pick;if(u||!y&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Kz;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=jze(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),f=this._vaf.writers;for(let P=0;P<i;++P){let F=this._billboards[P];F._dirty=!1,F.textureDirty=!1,iKe(this,e,f,F)}this._vaf.commit(Oz(t))}this._billboardsToUpdateIndex=0}else if(a>0){let P=aKe;P.length=0,(l[Ow]||l[Oze]||l[Uze])&&P.push(Qce),(l[W_]||l[kce]||l[Nze]||l[kze]||l[Mze])&&(P.push(nle),this._instanced&&P.push(zz)),(l[W_]||l[Dze]||l[Bce])&&(P.push(ile),P.push(Hz)),(l[W_]||l[Oce])&&P.push(Hz),(l[W_]||l[Uce])&&P.push(zz),l[Dce]&&P.push(ole),l[Yce]&&P.push(rle),(l[Hce]||l[Bze]||l[W_]||l[Ow])&&P.push(sle),(l[W_]||l[Ow])&&P.push(ale),l[zce]&&P.push(cle),l[Kce]&&P.push(lle);let F=P.length;if(f=this._vaf.writers,a/i>.1){for(let N=0;N<a;++N){let b=s[N];b._dirty=!1,b.textureDirty=!1;for(let G=0;G<F;++G)P[G](this,e,f,b)}this._vaf.commit(Oz(t))}else{for(let N=0;N<a;++N){let b=s[N];b._dirty=!1,b.textureDirty=!1;for(let G=0;G<F;++G)P[G](this,e,f,b);this._instanced?this._vaf.subCommit(b._index,1):this._vaf.subCommit(b._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,g=M.IDENTITY;e.mode===se.SCENE3D?(g=this.modelMatrix,h=ue.clone(this._baseVolumeWC,this._boundingVolume)):h=ue.clone(this._baseVolume2D,this._boundingVolume),rKe(this,e,h);let x=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,x){this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Oe.fromCache({depthTest:{enabled:!0,func:oe.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Lo.TRANSLUCENT;this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Oe.fromCache({depthTest:{enabled:!0,func:P?oe.LEQUAL:oe.LESS},depthMask:P,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let S,V,Z,R,E,I=mt.maximumVertexTextureImageUnits>0;if(x||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){S=kw,V=Nw,E=[],c(this._batchTable)&&(E.push("VECTOR_TILE"),S=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(S),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),Z=new Be({defines:E,sources:[S]}),this._instanced&&Z.defines.push("INSTANCED"),this._shaderRotation&&Z.defines.push("ROTATION"),this._shaderAlignedAxis&&Z.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Z.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Z.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Z.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Z.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Z.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-Ys.CUTOFF;this._sdf&&Z.defines.push("SDF");let F=c(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(R=new Be({defines:["OPAQUE",F],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo}),R=new Be({defines:["TRANSLUCENT",F],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo})),this._blendOption===Lo.OPAQUE&&(R=new Be({defines:[F],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo})),this._blendOption===Lo.TRANSLUCENT&&(R=new Be({defines:[F],sources:[V]}),this._shaderClampToGround&&(I?R.defines.push("VERTEX_DEPTH_CHECK"):R.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(R.defines.push("SDF"),R.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:Z,fragmentShaderSource:R,attributeLocations:lo})),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(p.render||p.pick){let P=this._colorCommands,F=this._blendOption===Lo.OPAQUE,N=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,G=b.length,X=this._uniforms,W;c(this._batchTable)?(X=this._batchTable.getUniformMapCallback()(X),W=this._batchTable.getPickId()):W="v_pickColor",P.length=G;let A=N?G*2:G;for(let k=0;k<A;++k){let B=P[k];c(B)||(B=P[k]=new et);let O=F||N&&k%2===0;B.pass=O||!N?Xe.OPAQUE:Xe.TRANSLUCENT,B.owner=this;let H=N?Math.floor(k/2):k;B.boundingVolume=h,B.modelMatrix=g,B.count=b[H].indicesCount,B.shaderProgram=O?this._sp:this._spTranslucent,B.uniformMap=X,B.vertexArray=b[H].va,B.renderState=O?this._rsOpaque:this._rsTranslucent,B.debugShowBoundingVolume=this.debugShowBoundingVolume,B.pickId=W,this._instanced&&(B.count=6,B.instanceCount=i),v.push(B)}this.debugShowTextureAtlas&&(c(this.debugCommand)||(this.debugCommand=sKe(this,e.context)),v.push(this.debugCommand))}this._allBillboardsReady=o};Nu.prototype.isDestroyed=function(){return!1};Nu.prototype.destroy=function(){return c(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(),Jce(this._billboards),he(this)};var Gd=Nu;var kkn=_(T(),1);var wkn=_(T(),1);function cKe(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 w_=cKe;function ba(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),h1(this)}var lKe=new pe;Object.defineProperties(ba.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=Y.clone(e,this._color),h1(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,h1(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=Y.clone(e,this._pointOutlineColor),h1(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,h1(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){c(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,lKe);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=Y.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&&h1(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}}});ba.defaultColor=Y.WHITE;ba.defaultPointOutlineColor=Y.BLACK;ba.defaultPointOutlineWidth=0;ba.defaultPointSize=8;function h1(e){let t=e._billboard;if(c(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(c(e._billboardImage))return;let n=e._color??ba.defaultColor,i=e._pointOutlineColor??ba.defaultPointOutlineColor,o=e._pointOutlineWidth??ba.defaultPointOutlineWidth,r=e._pointSize??ba.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,l=e._billboardOutlineWidth,d=e._billboardSize;if(Y.equals(n,s)&&Y.equals(i,a)&&o===l&&r===d)return;e._billboardColor=Y.clone(n,e._billboardColor),e._billboardOutlineColor=Y.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,f=n.toCssColorString(),p=i.toCssColorString(),y=JSON.stringify([f,r,p,o]);t.setImage(y,w_(u,f,p,o,r))}ba.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};ba.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};ba.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};ba.prototype.getPropertyInherited=function(e){return Us.getPropertyInherited(this._content,this._batchId,e)};ba.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};ba.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};ba.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};ba.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var _b=ba;var FUn=_(T(),1);var Hkn=_(T(),1);function dKe(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",""),l=document.createElement("canvas"),d=100,u=r.width+d|0,f=3*a,p=f/2;l.width=u,l.height=f;let y=l.getContext("2d");y.font=n,y.fillStyle="white",y.fillRect(0,0,l.width+1,l.height+1),i&&(y.strokeStyle="black",y.lineWidth=e.lineWidth,y.strokeText(t,d/2,p)),o&&(y.fillStyle="black",y.fillText(t,d/2,p));let h=y.getImageData(0,0,u,f).data,g=h.length,x=u*4,S,V,Z,R;for(S=0;S<g;++S)if(h[S]!==255){Z=S/x|0;break}for(S=g-1;S>=0;--S)if(h[S]!==255){R=S/x|0;break}let E=-1;for(S=0;S<u&&E===-1;++S)for(V=0;V<f;++V){let I=S*4+V*x;if(h[I]!==255||h[I+1]!==255||h[I+2]!==255||h[I+3]!==255){E=S;break}}return{width:r.width,height:R-Z,ascent:p-Z,descent:R-p,minx:E-d/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var P_;function uKe(e,t){if(!c(e))throw new L("text is required.");if(e==="")return;t=t??z.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??Y.TRANSPARENT,a=t.padding??0,l=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});c(P_)||(c(u.imageSmoothingEnabled)?P_="imageSmoothingEnabled":c(u.mozImageSmoothingEnabled)?P_="mozImageSmoothingEnabled":c(u.webkitImageSmoothingEnabled)?P_="webkitImageSmoothingEnabled":c(u.msImageSmoothingEnabled)&&(P_="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[P_]=!1,d.style.visibility="hidden",document.body.appendChild(d);let f=dKe(u,e,n,i,o);d.dimensions=f,document.body.removeChild(d),d.style.visibility="";let p=-f.minx,y=Math.ceil(f.width)+p+l,h=f.height+l,g=h-f.ascent+a,x=h-g+l;if(d.width=y,d.height=h,u.font=n,u.lineJoin="round",u.lineWidth=r,u[P_]=!1,s!==Y.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let S=t.strokeColor??Y.BLACK;u.strokeStyle=S.toCssColorString(),u.strokeText(e,p+a,x)}if(o){let S=t.fillColor??Y.WHITE;u.fillStyle=S.toCssColorString(),u.fillText(e,p+a,x)}return d}var v_=uKe;var Tle=_(fle(),1);var fUn=_(T(),1);var Qkn=_(T(),1),fKe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Yo=Object.freeze(fKe);var hle={},ple=0,hKe=256,pKe=new Y(.165,.165,.165,.8),bKe=new D(7,5),ps=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function F_(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Bw(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Yw(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function yle(e){let t=hle[e._font];if(!c(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(Yw(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Yw(n,"font-family"),size:Yw(n,"font-size").replace("px",""),style:Yw(n,"font-style"),weight:Yw(n,"font-weight"),lineHeight:i},document.body.removeChild(n),ple<hKe&&(hle[e._font]=t,ple++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function cf(e,t){if(e=e??z.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new L("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new L("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Nt.clone(n)}if(c(i)){if(i.far<=i.near)throw new L("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Nt.clone(i)}if(c(o)){if(o.far<=o.near)throw new L("scaleByDistance.far must be greater than scaleByDistance.near.");o=Nt.clone(o)}if(c(r)){if(r.far<=r.near)throw new L("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=vt.clone(r)}this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=Y.clone(e.fillColor??Y.WHITE),this._outlineColor=Y.clone(e.outlineColor??Y.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=Y.clone(e.backgroundColor??pKe),this._backgroundPadding=D.clone(e.backgroundPadding??bKe),this._style=e.style??Yo.FILL,this._verticalOrigin=e.verticalOrigin??Mn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??xi.LEFT,this._pixelOffset=D.clone(e.pixelOffset??D.ZERO),this._eyeOffset=m.clone(e.eyeOffset??m.ZERO),this._position=m.clone(e.position??m.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??ze.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,yle(this),this._updateClamping()}Object.defineProperties(cf.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new L("value is required.");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;c(r)&&(r.show=e)}let n=this._backgroundBillboard;c(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new L("value is required.");let t=this._position;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;c(s)&&(s.position=e)}let i=this._backgroundBillboard;c(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!c(e))throw new L("value is required.");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;c(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;c(n)&&(n.heightReference=e),Bw(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!c(e))throw new L("value is required.");if(this._text!==e){this._text=e;let t=cf.filterUnsupportedCharacters(e);this._renderedText=cf.enableRightToLeftDetection?SKe(t):t,F_(this)}}},font:{get:function(){return this._font},set:function(e){if(!c(e))throw new L("value is required.");this._font!==e&&(this._font=e,F_(this),yle(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._fillColor;Y.equals(t,e)||(Y.clone(e,t),F_(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),F_(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new L("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,F_(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!c(e))throw new L("value is required.");this._showBackground!==e&&(this._showBackground=e,F_(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._backgroundColor;if(!Y.equals(t,e)){Y.clone(e,t);let n=this._backgroundBillboard;c(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!c(e))throw new L("value is required.");let t=this._backgroundPadding;D.equals(t,e)||(D.clone(e,t),Bw(this))}},style:{get:function(){return this._style},set:function(e){if(!c(e))throw new L("value is required.");this._style!==e&&(this._style=e,F_(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!c(e))throw new L("value is required.");let t=this._pixelOffset;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];c(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._translucencyByDistance;if(!Nt.equals(t,e)){this._translucencyByDistance=Nt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;if(!Nt.equals(t,e)){this._pixelOffsetScaleByDistance=Nt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._scaleByDistance;if(!Nt.equals(t,e)){this._scaleByDistance=Nt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!c(e))throw new L("value is required.");let t=this._eyeOffset;if(!m.equals(t,e)){m.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!c(e))throw new L("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Bw(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!c(e))throw new L("value is required.");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];c(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;c(n)&&(n.verticalOrigin=e),Bw(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!c(e))throw new L("value is required.");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];c(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;c(n)&&(n.scale=e*this._relativeSize),Bw(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far must be greater than near");if(!vt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;c(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(c(e)&&e<0)throw new L("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;c(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!c(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=m.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;c(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];c(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;c(n)&&(n.clusterShow=e)}}}});cf.prototype._updateClamping=function(){co._updateClamping(this._labelCollection,this)};cf.prototype.computeScreenSpacePosition=function(e,t){if(!c(e))throw new L("scene is required.");c(t)||(t=new D);let i=this._labelCollection.modelMatrix,o=c(this._actualClampedPosition)?this._actualClampedPosition:this._position;return co._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};cf.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,l=e._backgroundBillboard;if(c(l))i=t.x+l._translate.x,o=t.y-l._translate.y,r=l.width*a,s=l.height*a,e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?o-=s:e.verticalOrigin===Mn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,f=e._glyphs,p=f.length;for(let y=0;y<p;++y){let h=f[y],g=h.billboard;if(!c(g))continue;let x=t.x+g._translate.x,S=t.y-g._translate.y,V=h.dimensions.width*a,Z=h.dimensions.height*a;e.verticalOrigin===Mn.BOTTOM||e.verticalOrigin===Mn.BASELINE?S-=Z:e.verticalOrigin===Mn.CENTER&&(S-=Z*.5),e._verticalOrigin===Mn.TOP?S+=Ys.PADDING*a:(e._verticalOrigin===Mn.BOTTOM||e._verticalOrigin===Mn.BASELINE)&&(S-=Ys.PADDING*a),i=Math.min(i,x),o=Math.min(o,S),d=Math.max(d,x+V),u=Math.max(u,S+Z)}r=d-i,s=u-o}return c(n)||(n=new je),n.x=i,n.y=o,n.width=r,n.height=s,n};cf.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};cf.prototype.equals=function(e){return this===e||c(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&m.equals(this._position,e._position)&&Y.equals(this._fillColor,e._fillColor)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._backgroundColor,e._backgroundColor)&&D.equals(this._backgroundPadding,e._backgroundPadding)&&D.equals(this._pixelOffset,e._pixelOffset)&&m.equals(this._eyeOffset,e._eyeOffset)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Nt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&vt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};cf.prototype.isDestroyed=function(){return!1};cf.enableRightToLeftDetection=!1;function yKe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ps.LTR,a="",l=e.length;for(let d=0;d<l;++d){let u=e.charAt(d);t.test(u)?a=ps.RTL:n.test(u)?a=ps.LTR:i.test(u)?a=ps.BRACKETS:a=ps.WEAK,d===0&&(s=a),s===a&&a!==ps.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function gKe(e){return e.split("").reverse().join("")}function Hw(e,t,n){return e.slice(0,t)+n+e.slice(t)}function xKe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var _Ke="\u05D0-\u05EA",TKe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",ble=new RegExp(`[${_Ke}${TKe}]`);function SKe(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=ble.test(o.charAt(0)),s=yKe(o,ble),a=0,l="";for(let d=0;d<s.length;++d){let u=s[d],f=u.Type===ps.BRACKETS?xKe(u.Word):gKe(u.Word);r?u.Type===ps.RTL?(l=f+l,a=0):u.Type===ps.LTR?(l=Hw(l,a,u.Word),a+=u.Word.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(u.Type===ps.WEAK&&s[d-1].Type===ps.BRACKETS?l=f+l:s[d-1].Type===ps.RTL?(l=f+l,a=0):s.length>d+1?s[d+1].Type===ps.RTL?(l=f+l,a=0):(l=Hw(l,a,u.Word),a+=u.Word.length):l=Hw(l,0,f)):u.Type===ps.RTL?l=Hw(l,a,f):u.Type===ps.LTR?(l+=u.Word,a=l.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(d>0&&s[d-1].Type===ps.RTL?s.length>d+1?s[d+1].Type===ps.RTL?l=Hw(l,a,f):(l+=u.Word,a=l.length):l+=u.Word:(l+=u.Word,a=l.length))}n+=l,i<t.length-1&&(n+=`
`)}return n}var Fy=cf;var Sle=_(gle(),1);function VKe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var LKe=1.2,xle="ID_WHITE_PIXEL",jz=new D(4,4),ZKe=new je(1,1,1,1);function RKe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=jz.x,o.height=jz.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(xle,o),n.addImageSubRegion(xle,ZKe)}let i=e.add({collection:t});return i.setImageTexture(n),i}var Tb={};function GKe(e,t,n,i,o,r){return Tb.font=t,Tb.fillColor=n,Tb.strokeColor=i,Tb.strokeWidth=o,Tb.padding=Ys.PADDING,Tb.fill=r===Yo.FILL||r===Yo.FILL_AND_OUTLINE,Tb.stroke=r===Yo.OUTLINE||r===Yo.FILL_AND_OUTLINE,Tb.backgroundColor=Y.BLACK,v_(e,Tb)}function qz(e,t){let n=t.billboard;c(n)&&(n.show=!1,c(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var EKe=new Sle.default,XKe=/\s/;function IKe(e,t){let n=t._renderedText,i=EKe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/Ys.FONT_SIZE,o<s)for(let y=o;y<s;++y)qz(e,r[y]);r.length=o;let a=t.show&&t._showBackground&&n.split(`
`).join("").length>0,l=t._backgroundBillboard,d=e._backgroundBillboardCollection;a?(c(l)||(l=RKe(d,e),t._backgroundBillboard=l),l.color=t._backgroundColor,l.show=t._show,l.position=t._position,l.eyeOffset=t._eyeOffset,l.pixelOffset=t._pixelOffset,l.horizontalOrigin=xi.LEFT,l.verticalOrigin=t._verticalOrigin,l.heightReference=t._heightReference,l.scale=t.totalScale,l.pickPrimitive=t,l.id=t._id,l.translucencyByDistance=t._translucencyByDistance,l.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,l.scaleByDistance=t._scaleByDistance,l.distanceDisplayCondition=t._distanceDisplayCondition,l.disableDepthTestDistance=t._disableDepthTestDistance,l.clusterShow=t.clusterShow):c(l)&&(d.remove(l),t._backgroundBillboard=l=void 0);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,p=e._textDimensionsCache;for(let y=0;y<o;++y){let h=i[y],g=t._verticalOrigin,x=JSON.stringify([h,t._fontFamily,t._fontStyle,t._fontWeight,+g]),S=p[x],V=f.get(x);if(!c(V)||!c(S)){V=new xb(u),f.set(x,V);let I=`${t._fontStyle} ${t._fontWeight} ${Ys.FONT_SIZE}px ${t._fontFamily}`,v=GKe(h,I,Y.WHITE,Y.WHITE,0,Yo.FILL);if(S=v.dimensions,p[x]=S,v.width>0&&v.height>0&&!XKe.test(h)){let P=(0,Tle.default)(v,{cutoff:Ys.CUTOFF,radius:Ys.RADIUS}),F=v.getContext("2d"),N=v.width,b=v.height,G=F.getImageData(0,0,N,b);for(let X=0;X<N;X++)for(let W=0;W<b;W++){let A=W*N+X,k=P[A]*255,B=A*4;G.data[B+0]=k,G.data[B+1]=k,G.data[B+2]=k,G.data[B+3]=k}F.putImageData(G,0,0),V.loadImage(x,v)}}let Z=r[y];if(c(Z)||(Z=new VKe,Z.dimensions=S,Z.billboardTexture=V,r[y]=Z),Z.billboardTexture.id!==x&&(Z.billboardTexture=V,Z.dimensions=S),!V.hasImage){qz(e,Z);continue}let R=Z.billboard,E=e._spareBillboards;c(R)||(E.length>0?R=E.pop():(R=u.add({collection:e}),R._labelDimensions=new D,R._labelTranslate=new D),Z.billboard=R),R.setImageTexture(V),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=xi.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t.totalScale,R.pickPrimitive=t,R.id=t._id,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.scaleByDistance=t._scaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition,R.disableDepthTestDistance=t._disableDepthTestDistance,R._batchIndex=t._batchIndex,R.outlineColor=t.outlineColor,t.style===Yo.FILL_AND_OUTLINE?(R.color=t._fillColor,R.outlineWidth=t.outlineWidth):t.style===Yo.FILL?(R.color=t._fillColor,R.outlineWidth=0):t.style===Yo.OUTLINE&&(R.color=Y.TRANSPARENT,R.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function _le(e,t,n){return t===xi.CENTER?-e/2:t===xi.RIGHT?-(e+n.x):n.x}var fr=new D,WKe=new D;function wKe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,l=1,d=t.length,u=e._backgroundBillboard,f=D.clone(c(u)?e._backgroundPadding:D.ZERO,WKe);f.x/=e._relativeSize,f.y/=e._relativeSize;for(let F=0;F<d;++F){if(n.charAt(F)===`
`){r.push(i),++l,i=0;continue}let b=t[F].dimensions;c(b)&&(a=Math.max(a,b.height-b.descent),s=Math.max(s,b.descent),i+=b.width-b.minx,F<d-1&&(i+=t[F+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,y=e.totalScale,h=e._horizontalOrigin,g=e._verticalOrigin,x=0,S=r[x],V=_le(S,h,f),Z=(c(e._lineHeight)?e._lineHeight:LKe*e._fontSize)/e._relativeSize,R=Z*(l-1),E=o,I=p+R;c(u)&&(E+=f.x*2,I+=f.y*2,u._labelHorizontalOrigin=h),fr.x=V*y,fr.y=0;let v=!0,P=0;for(let F=0;F<d;++F){if(n.charAt(F)===`
`){++x,P+=Z,S=r[x],V=_le(S,h,f),fr.x=V*y,v=!0;continue}let N=t[F],b=N.dimensions;if(c(b)&&(g===Mn.TOP?(fr.y=b.height-a-f.y,fr.y+=Ys.PADDING):g===Mn.CENTER?fr.y=(R+b.height-a)/2:g===Mn.BASELINE?(fr.y=R,fr.y-=Ys.PADDING):(fr.y=R+s+f.y,fr.y-=Ys.PADDING),fr.y=(fr.y-b.descent-P)*y,v&&(fr.x-=Ys.PADDING*y,v=!1),c(N.billboard)&&(N.billboard._setTranslate(fr),N.billboard._labelDimensions.x=E,N.billboard._labelDimensions.y=I,N.billboard._labelHorizontalOrigin=h),F<d-1)){let G=t[F+1];fr.x+=(b.width-b.minx+G.dimensions.minx)*y}}if(c(u)&&n.split(`
`).join("").length>0&&(h===xi.CENTER?V=-o/2-f.x:h===xi.RIGHT?V=-(o+f.x*2):V=0,fr.x=V*y,g===Mn.TOP?fr.y=p-a-s:g===Mn.CENTER?fr.y=(p-a)/2-s:g===Mn.BASELINE?fr.y=-f.y-s:fr.y=0,fr.y=fr.y*y,u.width=E,u.height=I,u._setTranslate(fr),u._labelTranslate=D.clone(fr,u._labelTranslate)),Lu(e.heightReference))for(let F=0;F<d;++F){let b=t[F].billboard;c(b)&&(b._labelTranslate=D.clone(fr,b._labelTranslate))}}function Cle(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)qz(e,n[i]);c(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,c(t._removeCallbackFunc)&&t._removeCallbackFunc(),he(t)}function Rh(e){e=e??z.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Gd({scene:this._scene,textureAtlas:new Zx({initialSize:jz})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new xb(t),this._glyphBillboardCollection=new Gd({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=Y.clone(Y.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Lo.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Rh.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 c(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}}});Rh.prototype.add=function(e){let t=new Fy(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Rh.prototype.remove=function(e){if(c(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Cle(this,e),!0}return!1};Rh.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Cle(this,e[t]);e.length=0};Rh.prototype.contains=function(e){return c(e)&&e._labelCollection===this};Rh.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._labels[e]};Rh.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&&(IKe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(wKe(s),s._repositionAllGlyphs=!1);let l=s._glyphs.length-a;this._totalGlyphCount+=l}let o=n.length>0?Lo.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)};Rh.prototype.isDestroyed=function(){return!1};Rh.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),he(this)};var Gh=Rh;var QOn=_(T(),1);var MUn=_(T(),1),zw=`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 dOn=_(T(),1);var jUn=_(T(),1);var tl={};tl.numberOfPoints=function(e,t,n){let i=m.distance(e,t);return Math.ceil(i/n)};tl.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 PKe=new pe;tl.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,PKe).height}return i};var vKe=new M,FKe=new m,Vle=new m,AKe=new cn(m.UNIT_X,0),Lle=new m,MKe=new cn(m.UNIT_X,0),NKe=new m,kKe=new m,eK=[];function Rle(e,t,n){let i=eK;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 gk=new pe,yk=new pe,Ay=new m,tK=new m,UKe=new m,$z=new Fp,Kw=new va;function OKe(e,t,n,i,o,r,s,a){let l=i.scaleToGeodeticSurface(e,tK),d=i.scaleToGeodeticSurface(t,UKe),u=tl.numberOfPoints(e,t,n),f=i.cartesianToCartographic(l,gk),p=i.cartesianToCartographic(d,yk),y=Rle(u,o,r);$z.setEndPoints(f,p);let h=$z.surfaceDistance/u,g=a;f.height=o;let x=i.cartographicToCartesian(f,Ay);m.pack(x,s,g),g+=3;for(let S=1;S<u;S++){let V=$z.interpolateUsingSurfaceDistance(S*h,yk);V.height=y[S],x=i.cartographicToCartesian(V,Ay),m.pack(x,s,g),g+=3}return g}function DKe(e,t,n,i,o,r,s,a){let l=i.cartesianToCartographic(e,gk),d=i.cartesianToCartographic(t,yk),u=tl.numberOfPointsRhumbLine(l,d,n);l.height=0,d.height=0;let f=Rle(u,o,r);Kw.ellipsoid.equals(i)||(Kw=new va(void 0,void 0,i)),Kw.setEndPoints(l,d);let p=Kw.surfaceDistance/u,y=a;l.height=o;let h=i.cartographicToCartesian(l,Ay);m.pack(h,s,y),y+=3;for(let g=1;g<u;g++){let x=Kw.interpolateUsingSurfaceDistance(g*p,yk);x.height=f[g],h=i.cartographicToCartesian(x,Ay),m.pack(h,s,y),y+=3}return y}tl.wrapLongitude=function(e,t){let n=[],i=[];if(c(e)&&e.length>0){t=t??M.IDENTITY;let o=M.inverseTransformation(t,vKe),r=M.multiplyByPoint(o,m.ZERO,FKe),s=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_Y,Vle),Vle),a=cn.fromPointNormal(r,s,AKe),l=m.normalize(M.multiplyByPointAsVector(o,m.UNIT_X,Lle),Lle),d=cn.fromPointNormal(r,l,MKe),u=1;n.push(m.clone(e[0]));let f=n[0],p=e.length;for(let y=1;y<p;++y){let h=e[y];if(cn.getPointDistance(d,f)<0||cn.getPointDistance(d,h)<0){let g=qn.lineSegmentPlane(f,h,a,NKe);if(c(g)){let x=m.multiplyByScalar(s,5e-9,kKe);cn.getPointDistance(a,f)<0&&m.negate(x,x),n.push(m.add(g,x,new m)),i.push(u+1),m.negate(x,x),n.push(m.add(g,x,new m)),u=1}}n.push(m.clone(e[y])),u++,f=h}i.push(u)}return{positions:n,lengths:i}};tl.generateArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n=t.length,i=e.ellipsoid??re.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let g=i.scaleToGeodeticSurface(t[0],tK);if(o=r?o[0]:o,o!==0){let x=i.geodeticSurfaceNormal(g,Ay);m.multiplyByScalar(x,o,x),m.add(g,x,g)}return[g.x,g.y,g.z]}let s=e.minDistance;if(!c(s)){let g=e.granularity??w.RADIANS_PER_DEGREE;s=w.chordLength(g,i.maximumRadius)}let a=0,l;for(l=0;l<n-1;l++)a+=tl.numberOfPoints(t[l],t[l+1],s);let d=(a+1)*3,u=new Array(d),f=0;for(l=0;l<n-1;l++){let g=t[l],x=t[l+1],S=r?o[l]:o,V=r?o[l+1]:o;f=OKe(g,x,s,i,S,V,u,f)}eK.length=0;let p=t[n-1],y=i.cartesianToCartographic(p,gk);y.height=r?o[n-1]:o;let h=i.cartographicToCartesian(y,Ay);return m.pack(h,u,d-3),u};var Zle=new pe,BKe=new pe;tl.generateRhumbArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n=t.length,i=e.ellipsoid??re.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let S=i.scaleToGeodeticSurface(t[0],tK);if(o=r?o[0]:o,o!==0){let V=i.geodeticSurfaceNormal(S,Ay);m.multiplyByScalar(V,o,V),m.add(S,V,S)}return[S.x,S.y,S.z]}let s=e.granularity??w.RADIANS_PER_DEGREE,a=0,l,d=i.cartesianToCartographic(t[0],Zle),u;for(l=0;l<n-1;l++)u=i.cartesianToCartographic(t[l+1],BKe),a+=tl.numberOfPointsRhumbLine(d,u,s),d=pe.clone(u,Zle);let f=(a+1)*3,p=new Array(f),y=0;for(l=0;l<n-1;l++){let S=t[l],V=t[l+1],Z=r?o[l]:o,R=r?o[l+1]:o;y=DKe(S,V,s,i,Z,R,p,y)}eK.length=0;let h=t[n-1],g=i.cartesianToCartographic(h,gk);g.height=r?o[n-1]:o;let x=i.cartographicToCartesian(g,Ay);return m.pack(x,p,f-3),p};tl.generateCartesianArc=function(e){let t=tl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};tl.generateCartesianRhumbArc=function(e){let t=tl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=m.unpack(t,o*3);return i};var vi=tl;function Ed(e,t){e=e??z.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,c(this._material)||(this._material=zi.fromType(zi.ColorType,{color:new Y(1,1,1,1)}));let n=e.positions;c(n)||(n=[]),this._positions=n,this._actualPositions=xo(n,m.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(m.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;c(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=vi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Ele),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ue.fromPoints(this._actualPositions),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ue}var Gle=Ed.POSITION_INDEX=0,YKe=Ed.SHOW_INDEX=1,HKe=Ed.WIDTH_INDEX=2,zKe=Ed.MATERIAL_INDEX=3,Jw=Ed.POSITION_SIZE_INDEX=4,KKe=Ed.DISTANCE_DISPLAY_CONDITION=5,Ele=Ed.NUMBER_OF_PROPERTIES=6;function Sb(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;c(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Ed.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new L("value is required.");e!==this._show&&(this._show=e,Sb(this,YKe))}},positions:{get:function(){return this._positions},set:function(e){if(!c(e))throw new L("value is required.");let t=xo(e,m.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(m.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Sb(this,Jw),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ue.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Sb(this,Gle),this.update()}},material:{get:function(){return this._material},set:function(e){if(!c(e))throw new L("material is required.");this._material!==e&&(this._material=e,Sb(this,zKe))}},width:{get:function(){return this._width},set:function(e){if(!c(e))throw new L("value is required.");let t=this._width;e!==t&&(this._width=e,Sb(this,HKe))}},loop:{get:function(){return this._loop},set:function(e){if(!c(e))throw new L("value is required.");if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!m.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(m.clone(t[0]))):t.length>2&&m.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Sb(this,Jw)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!c(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");vt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition),Sb(this,KKe))}}});Ed.prototype.update=function(){let e=M.IDENTITY;c(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Gle]>0||this._propertiesChanged[Jw]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=vi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)Sb(this,Jw);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){Sb(this,Jw);break}}};Ed.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Ed.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Ele-1;++t)e[t]=0};Ed.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var ku=Ed;var JKe=ku.SHOW_INDEX,QKe=ku.WIDTH_INDEX,iK=ku.POSITION_INDEX,jKe=ku.MATERIAL_INDEX,Xle=ku.POSITION_SIZE_INDEX,qKe=ku.DISTANCE_DISPLAY_CONDITION,Ale=ku.NUMBER_OF_PROPERTIES,Ul={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 lf(e){e=e??z.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(Ale),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Ne.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=Y.clone(Y.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(lf.prototype,{length:{get:function(){return oK(this),this._polylines.length}}});lf.prototype.add=function(e){let t=new ku(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};lf.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,c(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};lf.prototype.removeAll=function(){rK(this),Ole(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};lf.prototype.contains=function(e){return c(e)&&e._polylineCollection===this};lf.prototype.get=function(e){if(!c(e))throw new L("index is required.");return oK(this),this._polylines[e]};function $Ke(e,t){c(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 Ix(t,n,e._polylines.length)}var Mle=new Bn,Nle=new ce,kle=new D;lf.prototype.update=function(e){if(oK(this),this._polylines.length===0||!this.show)return;rJe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(mt.maximumVertexTextureImageUnits===0)throw new le("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");$Ke(this,t),this._createBatchTable=!1}if(this._createVertexArray||tJe(this))wle(this,t,n);else if(this._polylinesUpdated){let l=this._polylinesToUpdate;if(this._mode!==se.SCENE3D){let d=l.length;for(let u=0;u<d;++u)i=l[u],i.update()}if(o[Xle]||o[jKe])wle(this,t,n);else{let d=l.length,u=this._polylineBuckets;for(let f=0;f<d;++f){i=l[f],o=i._propertiesChanged;let p=i._bucket,y=0;for(let h in u)if(u.hasOwnProperty(h)){if(u[h]===p){o[iK]&&p.writeUpdate(y,i,this._positionBuffer,n);break}y+=u[h].lengthOfPositions}if((o[JKe]||o[QKe])&&this._batchTable.setBatchedAttribute(i._index,0,new D(i._width,i._show)),this._batchTable.attributes.length>2){if(o[iK]||o[Xle]){let h=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,g=Bn.fromCartesian(h.center,Mle),x=ce.fromElements(g.low.x,g.low.y,g.low.z,h.radius,Nle);this._batchTable.setBatchedAttribute(i._index,2,g.high),this._batchTable.setBatchedAttribute(i._index,3,x)}if(o[qKe]){let h=kle;h.x=0,h.y=Number.MAX_VALUE;let g=i.distanceDisplayCondition;c(g)&&(h.x=g.near,h.y=g.far),this._batchTable.setBatchedAttribute(i._index,4,h)}}i._clean()}}l.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let l=0;l<Ale;++l)o[l]=0;let r=M.IDENTITY;e.mode===se.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!c(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Oe.fromCache({depthMask:a,depthTest:{enabled:a}})),(!c(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Oe.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let l=this._colorCommands;eJe(this,e,l,r)}};var Qw=new ue,Ile=new ue;function eJe(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,l=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),y=d.length;for(let h=0;h<y;++h){let g=d[h],x=g.buckets,S=x.length;for(let V=0;V<S;++V){let Z=x[V],R=Z.offset,E=Z.bucket.shaderProgram,I=Z.bucket.polylines,v=I.length,P,F,N=0,b,G;for(let X=0;X<v;++X){let W=I[X],A=iJe(W._material);if(A!==P){if(c(P)&&N>0){let H=F.isTranslucent();a>=s?(b=new et({owner:e}),n.push(b)):b=n[a],++a,G=St(p(F._uniforms),e._uniformMap),b.boundingVolume=ue.clone(Qw,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=E,b.vertexArray=g.va,b.renderState=H?e._translucentRS:e._opaqueRS,b.pass=H?Xe.TRANSLUCENT:Xe.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=G,b.count=N,b.offset=R,R+=N,N=0,l=!0,r.push(b)}F=W._material,F.update(o),P=A}let k=W._locatorBuckets,B=k.length;for(let H=0;H<B;++H){let U=k[H];U.locator===Z&&(N+=U.count)}let O;t.mode===se.SCENE3D?O=W._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?O=W._boundingVolume2D:t.mode===se.SCENE2D?c(W._boundingVolume2D)&&(O=ue.clone(W._boundingVolume2D,Ile),O.center.x=0):c(W._boundingVolumeWC)&&c(W._boundingVolume2D)&&(O=ue.union(W._boundingVolumeWC,W._boundingVolume2D,Ile)),l?(l=!1,ue.clone(O,Qw)):ue.union(O,Qw,Qw)}c(P)&&N>0&&(a>=s?(b=new et({owner:e}),n.push(b)):b=n[a],++a,G=St(p(F._uniforms),e._uniformMap),b.boundingVolume=ue.clone(Qw,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=E,b.vertexArray=g.va,b.renderState=F.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=F.isTranslucent()?Xe.TRANSLUCENT:Xe.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=G,b.count=N,b.offset=R,l=!0,r.push(b)),P=void 0}}n.length=a}lf.prototype.isDestroyed=function(){return!1};lf.prototype.destroy=function(){return Ule(this),rK(this),Ole(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),he(this)};function tJe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[iK]?(i.bufferUsage!==Ne.STREAM_DRAW&&(t=!0,i.bufferUsage=Ne.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Ne.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Ne.STATIC_DRAW):i.frameCount--),t}var Wle=[0,0,0];function wle(e,t,n){e._createVertexArray=!1,rK(e),Ule(e),oJe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],l=0,d=[[]],u=0,f=e._polylineBuckets,p,y;for(p in f)f.hasOwnProperty(p)&&(y=f[p],y.updateShader(t,r,s),u+=y.lengthOfPositions);if(u>0){let h=e._mode,g=new Float32Array(6*u*3),x=new Float32Array(u*4),S,V=0,Z=0,R=0;for(p in f)if(f.hasOwnProperty(p)){y=f[p],y.write(g,x,V,Z,R,r,t,n),h===se.MORPHING&&(c(S)||(S=new Float32Array(6*u*3)),y.writeForMorph(S,V));let G=y.lengthOfPositions;V+=6*G*3,Z+=G*4,R+=G*4,l=y.updateIndices(i,a,d,l)}let E=e._positionBufferUsage.bufferUsage,I=Ne.STATIC_DRAW;e._positionBuffer=_t.createVertexBuffer({context:t,typedArray:g,usage:E});let v;c(S)&&(v=_t.createVertexBuffer({context:t,typedArray:S,usage:E})),e._texCoordExpandAndBatchIndexBuffer=_t.createVertexBuffer({context:t,typedArray:x,usage:I});let P=3*Float32Array.BYTES_PER_ELEMENT,F=4*Float32Array.BYTES_PER_ELEMENT,N=0,b=i.length;for(let G=0;G<b;++G)if(o=i[G],o.length>0){let X=new Uint16Array(o),W=_t.createIndexBuffer({context:t,typedArray:X,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT});N+=a[G];let A=6*(G*(P*w.SIXTY_FOUR_KILOBYTES)-N*P),k=P+A,B=P+k,O=P+B,H=P+O,U=P+H,K=G*(F*w.SIXTY_FOUR_KILOBYTES)-N*F,Q=[{index:Ul.position3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Ul.position3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Ul.position2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Ul.position2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Ul.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:Ul.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Ul.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:B,strideInBytes:6*P},{index:Ul.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Ul.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:H,strideInBytes:6*P},{index:Ul.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Ul.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:H,strideInBytes:6*P},{index:Ul.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Ul.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:K}],ie,j,$,ne;h===se.SCENE3D?(j=e._positionBuffer,ie="vertexBuffer",$=Wle,ne="value"):h===se.SCENE2D||h===se.COLUMBUS_VIEW?(j=Wle,ie="value",$=e._positionBuffer,ne="vertexBuffer"):(j=v,ie="vertexBuffer",$=e._positionBuffer,ne="vertexBuffer"),Q[0][ie]=j,Q[1][ie]=j,Q[2][ne]=$,Q[3][ne]=$,Q[4][ie]=j,Q[5][ie]=j,Q[6][ne]=$,Q[7][ne]=$,Q[8][ie]=j,Q[9][ie]=j,Q[10][ne]=$,Q[11][ne]=$;let be=new ni({context:t,attributes:Q,indexBuffer:W});e._vertexArrays.push({va:be,buckets:d[G]})}}}function nJe(e,t){return t instanceof Pt?t.id:t}var xk=[];function iJe(e){let t=zi._uniformList[e.type],n=t.length;xk.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];xk[i]=r,xk[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(xk,nJe)}`}function oJe(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 l=a.material,d=i[l.type];c(d)||(d=i[l.type]=new Eh(l,t,n)),d.addPolyline(a)}}}function rJe(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 oK(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 rK(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;c(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Ule(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}lf.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function Ole(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function nK(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Eh(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Eh.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Eh.prototype.updateShader=function(e,t,n){if(c(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"),Ot.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new Be({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,Ax]}),r=t.getVertexShaderCallback()(zw),s=new Be({defines:i,sources:[bd,r]});this.shaderProgram=tn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Ul})};function Dle(e){return m.dot(m.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===zt.INTERSECTING}Eh.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===se.SCENE3D||!Dle(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 Ls=new m,Uu=new m,Ou=new m,_k=new m,sJe=new ce,aJe=new D;Eh.prototype.write=function(e,t,n,i,o,r,s,a){let l=this.mode,d=a.ellipsoid.maximumRadius*w.PI,u=this.polylines,f=u.length;for(let p=0;p<f;++p){let y=u[p],h=y.width,g=y.show&&h>0,x=y._index,S=this.getSegments(y,a),V=S.positions,Z=S.lengths,R=V.length,E=y.getPickId(s).color,I=0,v=0,P;for(let B=0;B<R;++B){B===0?y._loop?P=V[R-2]:(P=_k,m.subtract(V[0],V[1],P),m.add(V[0],P,P)):P=V[B-1],m.clone(P,Uu),m.clone(V[B],Ls),B===R-1?y._loop?P=V[1]:(P=_k,m.subtract(V[R-1],V[R-2],P),m.add(V[R-1],P,P)):P=V[B+1],m.clone(P,Ou);let O=Z[I];B===v+O&&(v+=O,++I);let H=B-v===0,U=B===v+Z[I]-1;l===se.SCENE2D&&(Uu.z=0,Ls.z=0,Ou.z=0),(l===se.SCENE2D||l===se.MORPHING)&&(H||U)&&d-Math.abs(Ls.x)<1&&((Ls.x<0&&Uu.x>0||Ls.x>0&&Uu.x<0)&&m.clone(Ls,Uu),(Ls.x<0&&Ou.x>0||Ls.x>0&&Ou.x<0)&&m.clone(Ls,Ou));let K=H?2:0,Q=U?2:4;for(let ie=K;ie<Q;++ie){Bn.writeElements(Ls,e,n),Bn.writeElements(Uu,e,n+6),Bn.writeElements(Ou,e,n+12);let j=ie-2<0?-1:1;t[o]=B/(R-1),t[o+1]=2*(ie%2)-1,t[o+2]=j,t[o+3]=x,n+=6*3,o+=4}}let F=sJe;F.x=Y.floatToByte(E.red),F.y=Y.floatToByte(E.green),F.z=Y.floatToByte(E.blue),F.w=Y.floatToByte(E.alpha);let N=aJe;N.x=h,N.y=g?1:0;let b=l===se.SCENE2D?y._boundingVolume2D:y._boundingVolumeWC,G=Bn.fromCartesian(b.center,Mle),X=G.high,W=ce.fromElements(G.low.x,G.low.y,G.low.z,b.radius,Nle),A=kle;A.x=0,A.y=Number.MAX_VALUE;let k=y.distanceDisplayCondition;c(k)&&(A.x=k.near,A.y=k.far),r.setBatchedAttribute(x,0,N),r.setBatchedAttribute(x,1,F),r.attributes.length>2&&(r.setBatchedAttribute(x,2,X),r.setBatchedAttribute(x,3,W),r.setBatchedAttribute(x,4,A))}};var cJe=new m,lJe=new m,dJe=new m,Ple=new m;Eh.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,l=s._segments.lengths,d=a.length,u=0,f=0;for(let p=0;p<d;++p){let y;p===0?s._loop?y=a[d-2]:(y=Ple,m.subtract(a[0],a[1],y),m.add(a[0],y,y)):y=a[p-1],y=M.multiplyByPoint(n,y,lJe);let h=M.multiplyByPoint(n,a[p],cJe),g;p===d-1?s._loop?g=a[1]:(g=Ple,m.subtract(a[d-1],a[d-2],g),m.add(a[d-1],g,g)):g=a[p+1],g=M.multiplyByPoint(n,g,dJe);let x=l[u];p===f+x&&(f+=x,++u);let S=p-f===0,V=p===f+l[u]-1,Z=S?2:0,R=V?2:4;for(let E=Z;E<R;++E)Bn.writeElements(h,e,t),Bn.writeElements(y,e,t+6),Bn.writeElements(g,e,t+12),t+=6*3}}};var uJe=new Array(1);Eh.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new nK(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],l=0;a.length>0&&(l=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let f=0;f<u;++f){let p=d[f];p._locatorBuckets=[];let y;if(this.mode===se.SCENE3D){y=uJe;let g=p._actualPositions.length;if(g>0)y[0]=g;else continue}else y=p._segments.lengths;let h=y.length;if(h>0){let g=0;for(let x=0;x<h;++x){let S=y[x]-1;for(let V=0;V<S;++V)l+4>w.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:g}),g=0,t.push(4),a=[],e.push(a),l=0,r.count=s,s=0,i=0,r=new nK(0,0,this),n[++o]=[r]),a.push(l,l+2,l+1),a.push(l+1,l+2,l+3),g+=6,s+=6,i+=6,l+=4}p._locatorBuckets.push({locator:r,count:g}),l+4>w.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),l=0,r.count=s,i=0,s=0,r=new nK(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};Eh.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 p1={positions:void 0,lengths:void 0},vle=new Array(1),mJe=new m,fJe=new pe;Eh.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return vle[0]=n.length,p1.positions=n,p1.lengths=vle,p1;Dle(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,l=mJe;for(let d=0;d<s;++d)a=n[d],l=M.multiplyByPoint(r,a,l),o.push(t.project(i.cartesianToCartographic(l,fJe)));if(o.length>0){e._boundingVolume2D=ue.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new m(d.z,d.x,d.y)}return p1.positions=o,p1.lengths=e._segments.lengths,p1};var Fle;Eh.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*w.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=Fle,l=6*s*3;!c(a)||a.length<l?a=Fle=new Float32Array(l):a.length>l&&(a=new Float32Array(a.buffer,0,l));let d=this.getSegments(t,i),u=d.positions,f=d.lengths,p=0,y=0,h=0,g;s=u.length;for(let x=0;x<s;++x){x===0?t._loop?g=u[s-2]:(g=_k,m.subtract(u[0],u[1],g),m.add(u[0],g,g)):g=u[x-1],m.clone(g,Uu),m.clone(u[x],Ls),x===s-1?t._loop?g=u[1]:(g=_k,m.subtract(u[s-1],u[s-2],g),m.add(u[s-1],g,g)):g=u[x+1],m.clone(g,Ou);let S=f[y];x===h+S&&(h+=S,++y);let V=x-h===0,Z=x===h+f[y]-1;o===se.SCENE2D&&(Uu.z=0,Ls.z=0,Ou.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(V||Z)&&r-Math.abs(Ls.x)<1&&((Ls.x<0&&Uu.x>0||Ls.x>0&&Uu.x<0)&&m.clone(Ls,Uu),(Ls.x<0&&Ou.x>0||Ls.x>0&&Ou.x<0)&&m.clone(Ls,Ou));let R=V?2:0,E=Z?2:4;for(let I=R;I<E;++I)Bn.writeElements(Ls,a,p),Bn.writeElements(Uu,a,p+6),Bn.writeElements(Ou,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var df=lf;function My(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Gd({batchTable:e.batchTable}),this._labelCollection=new Gh({batchTable:e.batchTable}),this._polylineCollection=new df,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(My.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 hJe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+de.packedLength+re.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,de.pack(n,s,a),a+=de.packedLength,re.pack(t,s,a),s}var pJe=new gi("createVectorTilePoints",5),bJe=new m;function yJe(e,t){let n=e._positions,i=e._packedBuffer;c(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=hJe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=pJe.scheduleTask(r,o);if(c(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let l=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let f=e._batchIds,p=n.length/3;for(let y=0;y<p;++y){let h=f[y],g=m.unpack(n,y*3,bJe),x=l.add();x.position=g,x._batchIndex=h;let S=d.add();S.text=" ",S.position=g,S._batchIndex=h;let V=u.add();V.positions=[m.clone(g),m.clone(g)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}My.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 l=r[a],d=n.get(a),u=i.get(a),f=o.get(a);t[l]=new _b(e,l,d,u,f)}};My.prototype.applyDebugSettings=function(e,t){e?(Y.clone(t,this._billboardCollection._highlightColor),Y.clone(t,this._labelCollection._highlightColor),Y.clone(t,this._polylineCollection._highlightColor)):(Y.clone(Y.WHITE,this._billboardCollection._highlightColor),Y.clone(Y.WHITE,this._labelCollection._highlightColor),Y.clone(Y.WHITE,this._polylineCollection._highlightColor))};function gJe(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=_b.defaultPointSize,s.color=_b.defaultColor,s.pointOutlineColor=_b.defaultPointOutlineColor,s.pointOutlineWidth=_b.defaultPointOutlineWidth,s.labelColor=Y.WHITE,s.labelOutlineColor=Y.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Yo.FILL,s.labelText=void 0,s.backgroundColor=new Y(.165,.165,.165,.8),s.backgroundPadding=new D(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=Y.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=xi.CENTER,s.verticalOrigin=Mn.CENTER,s.labelHorizontalOrigin=xi.RIGHT,s.labelVerticalOrigin=Mn.BASELINE}}var xJe=new Y,_Je=new Y,TJe=new Y,SJe=new Y,CJe=new Y,VJe=new Y,jw=new Nt,qw=new Nt,sK=new vt;My.prototype.applyStyle=function(e,t){if(!c(e)){gJe(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(c(e.show)&&(s.show=e.show.evaluate(s)),c(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),c(e.color)&&(s.color=e.color.evaluateColor(s,xJe)),c(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,_Je)),c(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),c(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,TJe)),c(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,SJe)),c(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),c(e.font)&&(s.font=e.font.evaluate(s)),c(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),c(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,c(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,CJe)),c(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),c(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),c(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);c(a)?(jw.near=a.x,jw.nearValue=a.y,jw.far=a.z,jw.farValue=a.w,s.scaleByDistance=jw):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(c(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);c(a)?(qw.near=a.x,qw.nearValue=a.y,qw.far=a.z,qw.farValue=a.w,s.translucencyByDistance=qw):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(c(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);c(a)?(sK.near=a.x,sK.far=a.y,s.distanceDisplayCondition=sK):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;c(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),c(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),c(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,VJe)),c(e.image)?s.image=e.image.evaluate(s):s.image=void 0,c(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),c(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),c(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),c(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),c(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};My.prototype.update=function(e){if(!this._ready&&(c(this._promise)||(this._promise=yJe(this,e.mapProjection.ellipsoid)),c(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};My.prototype.isDestroyed=function(){return!1};My.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(),he(this)};var $w=My;var EDn=_(T(),1);function Cb(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??re.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??m.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Un.BOTH}Object.defineProperties(Cb.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function LJe(e){let t=new Float64Array(3+m.packedLength+re.packedLength+de.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,de.pack(e._rectangle,t,n),t}function ZJe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Xn.unpack(t,n),n+=Xn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let l=Y.unpack(t,n);n+=Y.packedLength;let d=t[n++],u=t[n++],f=t[n++],p=new Array(f);for(let y=0;y<f;++y)p[y]=t[n++];s[a]=new bh({color:l,offset:d,count:u,batchIds:p})}}var RJe=new gi("createVectorTilePolygons",5),GJe=new Y;function EJe(e){if(c(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(!c(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(de.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let y=e._batchTable,h=s.length;for(let g=0;g<h;++g){let x=y.getColor(g,GJe);s[g]=x.toRgba()}a=e._packedBuffer=LJe(e)}let l=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,f=e._polygonMaximumHeights;c(u)&&c(f)&&(u=u.slice(),f=f.slice(),l.push(u.buffer,f.buffer),d.minimumHeights=u,d.maximumHeights=f);let p=RJe.scheduleTask(d,l);if(c(p))return p.then(y=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let h=new Float64Array(y.packedBuffer),g=h[0];ZJe(e,h),e._indices=Me.getSizeInBytes(g)===2?new Uint16Array(y.indices):new Uint32Array(y.indices),e._indexOffsets=new Uint32Array(y.indexOffsets),e._indexCounts=new Uint32Array(y.indexCounts),e._batchedPositions=new Float32Array(y.positions),e._vertexBatchIds=new Uint16Array(y.batchIds),XJe(e),e._ready=!0}).catch(y=>{e.isDestroyed()||(e._error=y)})}function XJe(e){c(e._primitive)||(e._primitive=new o_({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)}Cb.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Cb.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Cb.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Cb.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Cb.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=EJe(this)),c(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)};Cb.prototype.isDestroyed=function(){return!1};Cb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};var eP=Cb;var nBn=_(T(),1);var IDn=_(T(),1),tP=`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 uf(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??re.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=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(uf.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function IJe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,de.pack(t,a,l),l+=de.packedLength,re.pack(o,a,l),l+=re.packedLength,m.pack(r,a,l),a}var WJe=new gi("createVectorTilePolylines",5),b1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function wJe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=IJe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=WJe.scheduleTask(l,a);if(c(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let f=u.indexDatatype;e._indices=f===Me.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),PJe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function PJe(e,t){if(!c(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,l=i.byteLength+n.byteLength+o.byteLength;l+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=l;let d=_t.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),u=_t.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),f=_t.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),y=_t.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),h=_t.createIndexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Me.UNSIGNED_SHORT:Me.UNSIGNED_INT}),g=[{index:b1.previousPosition,vertexBuffer:d,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:b1.currentPosition,vertexBuffer:u,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:b1.nextPosition,vertexBuffer:f,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:b1.expandAndWidth,vertexBuffer:p,componentDatatype:q.FLOAT,componentsPerAttribute:2},{index:b1.a_batchId,vertexBuffer:y,componentDatatype:q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:g,indexBuffer:h}),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 nP=new M,Ble=new m;function vJe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,nP),M.multiplyByPoint(nP,e._center,Ble),M.setTranslation(nP,Ble,nP),nP},u_highlightColor:function(){return e._highlightColor}})}function FJe(e){if(c(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Oe.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var AJe=`uniform vec4 u_highlightColor; 
void main()
{
    out_FragColor = u_highlightColor;
}
`;function MJe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(tP),o=n.getFragmentShaderCallback(!1,void 0,!1)(AJe),r=new Be({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[bd,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:b1})}function NJe(e,t){if(!c(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:Xe.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}uf.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!c(n)||!c(i))return;let r,s,a=n.length,l=0,d=0;for(r=0;r<a;++r)n[r]===t&&(l+=o[r+1]-o[r]);if(l===0)return;let u=new Float64Array(l*3);for(r=0;r<a;++r)if(n[r]===t){let f=o[r],p=o[r+1]-f;for(s=0;s<p;++s){let y=(f+s)*3;u[d++]=i[y],u[d++]=i[y+1],u[d++]=i[y+2]}}return u};uf.prototype.getPositions=function(e){return uf.getPolylinePositions(this,e)};uf.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 Us(e,r)}};uf.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function kJe(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=Y.WHITE}}var UJe=new Y,OJe=Y.WHITE,DJe=!0;uf.prototype.applyStyle=function(e,t){if(!c(e)){kJe(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=c(e.color)?e.color.evaluateColor(s,UJe):OJe,s.show=c(e.show)?e.show.evaluate(s):DJe}};uf.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=wJe(this,t)),c(this._error)){let i=this._error;throw this._error=void 0,i}return}vJe(this,t),MJe(this,t),FJe(this);let n=e.passes;(n.render||n.pick)&&NJe(this,e)};uf.prototype.isDestroyed=function(){return!1};uf.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),he(this)};var A_=uf;var UBn=_(T(),1);var oBn=_(T(),1),iP=`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()
{
float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251);
float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd));
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));
float offset;
vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
position.xyz += offset * ellipsoidNormal;
position = u_modifiedModelView * position;
right = czm_normal * right;
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 = 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 sBn=_(T(),1),oP=`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)));
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);
halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
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 Vb(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??re.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 D(ui._defaultMinTerrainHeight,ui._defaultMaxTerrainHeight),this._boundingVolume=Xn.fromRectangle(e.rectangle,ui._defaultMinTerrainHeight,ui._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=Y.clone(Y.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Vb.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function BJe(e,t,n){let i=ui.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,l=e._rectangle;Xn.fromRectangle(l,o,r,n,a)}function YJe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+de.packedLength+re.packedLength+m.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,de.pack(t,a,l),l+=de.packedLength,re.pack(o,a,l),l+=re.packedLength,m.pack(r,a,l),a}var HJe=new gi("createVectorTileClampedPolylines"),Ny={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function zJe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(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=YJe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=HJe.scheduleTask(l,a);if(c(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let f=u.indexDatatype;e._indices=f===Me.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),KJe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function KJe(e,t){if(!c(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,l=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=l.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let f=_t.createVertexBuffer({context:t,typedArray:n,usage:Ne.STATIC_DRAW}),p=_t.createVertexBuffer({context:t,typedArray:i,usage:Ne.STATIC_DRAW}),y=_t.createVertexBuffer({context:t,typedArray:o,usage:Ne.STATIC_DRAW}),h=_t.createVertexBuffer({context:t,typedArray:r,usage:Ne.STATIC_DRAW}),g=_t.createVertexBuffer({context:t,typedArray:s,usage:Ne.STATIC_DRAW}),x=_t.createVertexBuffer({context:t,typedArray:a,usage:Ne.STATIC_DRAW}),S=_t.createVertexBuffer({context:t,typedArray:l,usage:Ne.STATIC_DRAW}),V=_t.createIndexBuffer({context:t,typedArray:d,usage:Ne.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Me.UNSIGNED_SHORT:Me.UNSIGNED_INT}),Z=[{index:Ny.startEllipsoidNormal,vertexBuffer:f,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:Ny.endEllipsoidNormal,vertexBuffer:p,componentDatatype:q.FLOAT,componentsPerAttribute:3},{index:Ny.startPositionAndHeight,vertexBuffer:y,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.endPositionAndHeight,vertexBuffer:h,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.startFaceNormalAndVertexCorner,vertexBuffer:g,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.endFaceNormalAndHalfWidth,vertexBuffer:x,componentDatatype:q.FLOAT,componentsPerAttribute:4},{index:Ny.a_batchId,vertexBuffer:S,componentDatatype:q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:Z,indexBuffer:V}),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 rP=new M,Yle=new m;function JJe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,rP),M.multiplyByPoint(rP,e._center,Yle),M.setTranslation(rP,Yle,rP),rP},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Hle(e){return Oe.fromCache({cull:{enabled:!0,face:_i.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:On.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function QJe(e){c(e._rs)||(e._rs=Hle(!1),e._rs3DTiles=Hle(!0))}function jJe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(iP),o=n.getFragmentShaderCallback(!1,void 0,!0)(oP),r=new Be({defines:["VECTOR_TILE",Ot.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[bd,i]}),s=new Be({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Ny})}function qJe(e,t){let n=e._command;if(!c(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:Xe.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=et.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Xe.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Un.TERRAIN||i===Un.BOTH)&&t.commandList.push(n),(i===Un.CESIUM_3D_TILE||i===Un.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}Vb.prototype.getPositions=function(e){return A_.getPolylinePositions(this,e)};Vb.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 Us(e,r)}};Vb.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function $Je(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=Y.WHITE}}var eQe=new Y,tQe=Y.WHITE,nQe=!0;Vb.prototype.applyStyle=function(e,t){if(!c(e)){$Je(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=c(e.color)?e.color.evaluateColor(s,eQe):tQe,s.show=c(e.show)?e.show.evaluate(s):nQe}};function iQe(e){return ui.initialize().then(function(){BJe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}Vb.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=iQe(this).then(zJe(this,t))),c(this._error)){let i=this._error;throw this._error=void 0,i}return}JJe(this,t),jJe(this,t),QJe(this);let n=e.passes;(n.render||n.pick)&&qJe(this,e)};Vb.prototype.isDestroyed=function(){return!1};Vb.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),he(this)};var sP=Vb;var zBn=_(T(),1);var aK=32767,oQe=new pe,rQe=new m;function sQe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),l=e.subarray(2*r,3*r);Fn.zigZagDeltaDecode(s,a,l);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let f=s[u],p=a[u],y=l[u],h=w.lerp(t.west,t.east,f/aK),g=w.lerp(t.south,t.north,p/aK),x=w.lerp(n,i,y/aK),S=pe.fromRadians(h,g,x,oQe),V=o.cartographicToCartesian(S,rQe);m.pack(V,d,u*3)}return d}var aP=sQe;function ff(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,uQe(this,i,o)}Object.defineProperties(ff.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return c(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.trianglesLength),c(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.geometryByteLength),c(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return c(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return c(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 aQe(e){return function(t,n){c(e._polygons)&&e._polygons.updateCommands(t,n)}}function cQe(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,l=e.POINTS_LENGTH??0;if(s>0&&c(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&c(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(l>0&&c(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,l)}let d=c(n)||c(i)||c(o),u=s>0&&!c(n)||a>0&&!c(i)||l>0&&!c(o);if(d&&u)throw new le("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)){let p=0;if(!c(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!c(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!c(o)&&l>0)for(o=new Uint16Array(l),r=0;r<l;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var mf=Uint32Array.BYTES_PER_ELEMENT;function lQe(e){return new A_(e)}function dQe(e){return new sP(e)}function uQe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=mf;let r=o.getUint32(n,!0);if(r!==1)throw new le(`Only Vector tile version 1 is supported.  Version ${r} is not.`);n+=mf;let s=o.getUint32(n,!0);if(n+=mf,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=mf,a===0)throw new le("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=mf;let d=o.getUint32(n,!0);n+=mf;let u=o.getUint32(n,!0);n+=mf;let f=o.getUint32(n,!0);n+=mf;let p=o.getUint32(n,!0);n+=mf;let y=o.getUint32(n,!0);n+=mf;let h=o.getUint32(n,!0);n+=mf;let g=er(i,n,a);n+=a;let x=new Uint8Array(t,n,l);n+=l;let S,V;d>0&&(S=er(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let Z=g.POLYGONS_LENGTH??0,R=g.POLYLINES_LENGTH??0,E=g.POINTS_LENGTH??0,I=Z+R+E,v=new zp(e,I,S,V,aQe(e));if(e._batchTable=v,I===0)return;let P=new of(g,x),F=P.getGlobalProperty("REGION");if(!c(F))throw new le("Feature table global property: REGION must be defined");let N=de.unpack(F),b=F[4],G=F[5],X=e._tile.computedTransform,W=P.getGlobalProperty("RTC_CENTER",q.FLOAT,3);c(W)?(W=m.unpack(W),M.multiplyByPoint(X,W,W)):(W=de.center(N),W.height=w.lerp(b,G,.5),W=re.WGS84.cartographicToCartesian(W));let A=cQe(g,x);if(n+=(4-n%4)%4,Z>0){P.featuresLength=Z;let k=P.getPropertyArray("POLYGON_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_COUNT",q.UNSIGNED_INT,1);if(!c(k))throw new le("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=P.getPropertyArray("POLYGON_INDEX_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYGON_INDEX_COUNT",q.UNSIGNED_INT,1);if(!c(B))throw new le("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let O=k.reduce(function(j,$){return j+$*2},0),H=B.reduce(function(j,$){return j+$},0),U=new Uint32Array(t,n,H);n+=f;let K=new Uint16Array(t,n,O);n+=p;let Q,ie;c(g.POLYGON_MINIMUM_HEIGHTS)&&c(g.POLYGON_MAXIMUM_HEIGHTS)&&(Q=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",q.FLOAT,1),ie=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",q.FLOAT,1)),e._polygons=new eP({positions:K,counts:k,indexCounts:B,indices:U,minimumHeight:b,maximumHeight:G,polygonMinimumHeights:Q,polygonMaximumHeights:ie,center:W,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:A.polygons,modelMatrix:X})}if(R>0){P.featuresLength=R;let k=P.getPropertyArray("POLYLINE_COUNTS",q.UNSIGNED_INT,1)??P.getPropertyArray("POLYLINE_COUNT",q.UNSIGNED_INT,1);if(!c(k))throw new le("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let B=P.getPropertyArray("POLYLINE_WIDTHS",q.UNSIGNED_SHORT,1);if(!c(B)){B=new Uint16Array(R);for(let ie=0;ie<R;++ie)B[ie]=2}let O=k.reduce(function(ie,j){return ie+j*3},0),H=new Uint16Array(t,n,O);n+=y;let U=e._tileset,K=U.examineVectorLinesFunction;if(c(K)){let ie=aP(new Uint16Array(H),N,b,G,re.WGS84);mQe(ie,k,A.polylines,v,e.url,K)}let Q=lQe;c(U.classificationType)&&(Q=dQe),e._polylines=Q({positions:H,widths:B,counts:k,batchIds:A.polylines,minimumHeight:b,maximumHeight:G,center:W,rectangle:N,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(E>0){let k=new Uint16Array(t,n,E*3);n+=h,e._points=new $w({positions:k,batchIds:A.points,minimumHeight:b,maximumHeight:G,rectangle:N,batchTable:v})}}function cK(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._polygons)&&e._polygons.createFeatures(e,n),c(e._polylines)&&e._polylines.createFeatures(e,n),c(e._points)&&e._points.createFeatures(e,n),e._features=n}}ff.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};ff.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new L(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return c(this._features)||cK(this),this._features[e]};ff.prototype.applyDebugSettings=function(e,t){c(this._polygons)&&this._polygons.applyDebugSettings(e,t),c(this._polylines)&&this._polylines.applyDebugSettings(e,t),c(this._points)&&this._points.applyDebugSettings(e,t)};ff.prototype.applyStyle=function(e){c(this._features)||cK(this),c(this._polygons)&&this._polygons.applyStyle(e,this._features),c(this._polylines)&&this._polylines.applyStyle(e,this._features),c(this._points)&&this._points.applyStyle(e,this._features)};ff.prototype.update=function(e,t){let n=!0;c(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),c(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),c(this._points)&&(this._points.update(t),n=n&&this._points.ready),c(this._batchTable)&&n&&(c(this._features)||cK(this),this._batchTable.update(e,t),this._ready=!0)};ff.prototype.pick=function(e,t,n){};ff.prototype.getPolylinePositions=function(e){let t=this._polylines;if(c(t))return t.getPositions(e)};ff.prototype.isDestroyed=function(){return!1};ff.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(),he(this)};function mQe(e,t,n,i,o,r){let s=t.length,a=0;for(let l=0;l<s;l++){let d=t[l]*3,u=e.slice(a,a+d);a+=d,r(u,n[l],o,i)}}var cP=ff;var zle={b3dm:function(e,t,n,i,o){return Rd.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Rd.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Rd.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return NX.fromTileType(e,t,n,i,o,zle)},externalTileset:function(e,t,n,i){return Mw.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new DX(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new cP(e,t,n,i,o)},subt:function(e,t,n,i,o){return kC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return kC.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new le("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),l=new Uint8Array(i,o,a);return Rd.fromGltf(e,t,n,l)},gltf:function(e,t,n,i){return Rd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Rd.fromGeoJson(e,t,n,i)}},M_=zle;var V3n=_(T(),1),fQe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Ho=Object.freeze(fQe);var Z3n=_(T(),1),hf={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"};hf.isBinaryFormat=function(e){switch(e){case hf.BATCHED_3D_MODEL:case hf.INSTANCED_3D_MODEL:case hf.COMPOSITE:case hf.POINT_CLOUD:case hf.VECTOR:case hf.GEOMETRY:case hf.IMPLICIT_SUBTREE:case hf.VOXEL_BINARY:case hf.GLTF_BINARY:return!0;default:return!1}};var Zs=Object.freeze(hf);var G3n=_(T(),1),hQe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Du=Object.freeze(hQe);var X3n=_(T(),1),Hs={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},Lb=new Array(Hs.NUMBER_OF_PASSES);Lb[Hs.RENDER]=Object.freeze({pass:Hs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Lb[Hs.PICK]=Object.freeze({pass:Hs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Lb[Hs.SHADOW]=Object.freeze({pass:Hs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Lb[Hs.PRELOAD]=Object.freeze({pass:Hs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.PRELOAD_FLIGHT]=Object.freeze({pass:Hs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Hs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Hs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Lb[Hs.MOST_DETAILED_PICK]=Object.freeze({pass:Hs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Hs.getPassOptions=function(e){return Lb[e]};var Fo=Object.freeze(Hs);var P3n=_(T(),1);function Xh(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(Xh.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){throw new L("Empty3DTileContent cannot have content metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){throw new L("Empty3DTileContent cannot have group metadata")}}});Xh.prototype.hasProperty=function(e,t){return!1};Xh.prototype.getFeature=function(e){};Xh.prototype.applyDebugSettings=function(e,t){};Xh.prototype.applyStyle=function(e){};Xh.prototype.update=function(e,t){};Xh.prototype.pick=function(e,t,n){};Xh.prototype.isDestroyed=function(){return!1};Xh.prototype.destroy=function(){return he(this)};var y1=Xh;var H3n=_(T(),1);var N3n=_(T(),1);function Zb(e){e=e??z.EMPTY_OBJECT;let t=e.content,n=e.class;C.typeOf.object("options.content",t),C.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Zb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Zb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Zb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Zb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Zb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Zb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Zb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Zb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var lP=Zb;function lK(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){lK._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??z.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new lP({content:n,class:o})}}lK._oneTimeWarning=ht;var N_=lK;var Q3n=_(T(),1);function pQe(e,t){let n=e.metadataExtension;if(!c(n))return;let i=n.groups,o=ri(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 k_=pQe;var cYn=_(T(),1);var tYn=_(T(),1);function Rb(e){e=e??z.EMPTY_OBJECT;let t=e.tile,n=e.class;C.typeOf.object("options.tile",t),C.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Rb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Rb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Rb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Rb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Rb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Rb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Rb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Rb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var dP=Rb;function dK(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){dK._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??z.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new dP({tile:n,class:o})}}dK._oneTimeWarning=ht;var uP=dK;var IYn=_(T(),1);var pYn=_(T(),1);function bQe(e){let t=new Uint8Array(e),n=Hm(t);if(n==="glTF"&&(n="glb"),Zs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=yQe(t);if(c(i.root))return{contentType:Zs.EXTERNAL_TILESET,jsonPayload:i};if(c(i.asset))return{contentType:Zs.GLTF,jsonPayload:i};if(c(i.tileAvailability))return{contentType:Zs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(c(i.type))return{contentType:Zs.GEOJSON,jsonPayload:i};if(c(i.voxelTable))return{contentType:Zs.VOXEL_JSON,jsonPayload:i};throw new le("Invalid tile content.")}function yQe(e){let t;try{t=er(e)}catch{throw new le("Invalid tile content.")}return t}var Gb=bQe;function Bu(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=c(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}),l=ic.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=l}}Object.defineProperties(Bu.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(){throw new L("Multiple3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(){throw new L("Multiple3DTileContent cannot have group metadata")}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function uK(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Kle(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)}Bu.prototype.requestInnerContents=function(){if(!gQe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;uK(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=xQe(this,n,t,this._tile._contentState);return _Qe(this)};function gQe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];c(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!ic.serverHasOpenSlots(n,t[n]))return!1;return ic.heapHasOpenSlots(e.length)}function xQe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],l=new Jo({throttle:!0,throttleByServer:!0,type:us.TILES3D,priorityFunction:s,serverKey:a});o.request=l,e._requests[t]=l;let d=o.fetchArrayBuffer();if(c(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){Kle(e,i);return}return uK(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){Kle(e,i);return}uK(e,-1),Jle(e,t,u)}})}async function _Qe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>TQe(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(c),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function TQe(e,t,n){if(c(t))try{let i=Gb(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Zs.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Zs.GEOMETRY||i.contentType===Zs.VECTOR;let a,l=M_[i.contentType];c(i.binaryPayload)?a=await Promise.resolve(l(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(l(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let f=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=f.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=N_(o,d));let u=k_(o,d);return c(u)&&(a.group=new e_({metadata:u})),a}catch(i){Jle(e,n,i)}}function Jle(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=c(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}`))}Bu.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];c(t)&&t.cancel()}};Bu.prototype.hasProperty=function(e,t){return!1};Bu.prototype.getFeature=function(e){};Bu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Bu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Bu.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)};Bu.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 l=r[a].pick(e,t,n);if(!c(l))continue;let d=m.distance(e.origin,l);d<o&&(i=l,o=d)}if(c(i))return n};Bu.prototype.isDestroyed=function(){return!1};Bu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return he(this)};var mP=Bu;var GHn=_(T(),1);var cHn=_(T(),1);var OYn=_(T(),1);var Qle=Math.cos,jle=Math.sin,SQe=Math.sqrt,mK={};mK.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,l=e.nwCorner,d=e.boundingRectangle,u=l.latitude-e.granYCos*i+o*e.granXSin,f=Qle(u),p=jle(u),y=a.z*p,h=l.longitude+i*e.granYSin+o*e.granXCos,g=f*Qle(h),x=f*jle(h),S=a.x*g,V=a.y*x,Z=SQe(S*g+V*x+y*p);if(r.x=S/Z,r.y=V/Z,r.z=y/Z,n){let R=e.stNwCorner;c(R)?(u=R.latitude-e.stGranYCos*i+o*e.stGranXSin,h=R.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(h-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(h-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var CQe=new Ii,Yu=new m,VQe=new pe,Tk=new m,fP=new Xi;function qle(e,t,n,i,o,r,s){let a=Math.cos(t),l=i*a,d=n*a,u=Math.sin(t),f=i*u,p=n*u;fP._ellipsoid=re.default,Yu=fP.project(e,Yu),Yu=m.subtract(Yu,Tk,Yu);let y=Ii.fromRotation(t,CQe);Yu=Ii.multiplyByVector(y,Yu,Yu),Yu=m.add(Yu,Tk,Yu),e=fP.unproject(Yu,e),r-=1,s-=1;let h=e.latitude,g=h+r*p,x=h-l*s,S=h-l*s+r*p,V=Math.max(h,g,x,S),Z=Math.min(h,g,x,S),R=e.longitude,E=R+r*d,I=R+s*f,v=R+s*f+r*d,P=Math.max(R,E,I,v),F=Math.min(R,E,I,v);return{north:V,south:Z,east:P,west:F,granYCos:l,granYSin:f,granXCos:d,granXSin:p,nwCorner:e}}mK.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,l=e.west,d=e.north,u=e.south,f=!1,p=!1;d===w.PI_OVER_TWO&&(f=!0),u===-w.PI_OVER_TWO&&(p=!0);let y,h=d-u;l>a?y=w.TWO_PI-l+a:y=a-l;let g=Math.ceil(y/t)+1,x=Math.ceil(h/t)+1,S=y/(g-1),V=h/(x-1),Z=de.northwest(e,r),R=de.center(e,VQe);(n!==0||i!==0)&&(R.longitude<Z.longitude&&(R.longitude+=w.TWO_PI),fP._ellipsoid=re.default,Tk=fP.project(R,Tk));let E=V,I=S,v=0,P=0,F=de.clone(e,o),N={granYCos:E,granYSin:v,granXCos:I,granXSin:P,nwCorner:Z,boundingRectangle:F,width:g,height:x,northCap:f,southCap:p};if(n!==0){let b=qle(Z,n,S,V,R,g,x);if(d=b.north,u=b.south,a=b.east,l=b.west,d<-w.PI_OVER_TWO||d>w.PI_OVER_TWO||u<-w.PI_OVER_TWO||u>w.PI_OVER_TWO)throw new L("Rotated rectangle is invalid.  It crosses over either the north or south pole.");N.granYCos=b.granYCos,N.granYSin=b.granYSin,N.granXCos=b.granXCos,N.granXSin=b.granXSin,F.north=d,F.south=u,F.east=a,F.west=l}if(i!==0){n=n-i;let b=de.northwest(F,s),G=qle(b,n,S,V,R,g,x);N.stGranYCos=G.granYCos,N.stGranXCos=G.granXCos,N.stGranYSin=G.granYSin,N.stGranXSin=G.granXSin,N.stNwCorner=b,N.stWest=G.west,N.stSouth=G.south}return N};var Rs=mK;var LQe=new ue,ZQe=new ue,RQe=new m,GQe=new de;function $le(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,l=2,d=0,u=4;r&&(l-=1,a-=1,d+=1,u-=2),s&&(l-=1,a-=1,d+=1,u-=2),d+=l*o+2*a-u;let f=new Float64Array(d*3),p=0,y=0,h,g=RQe;if(r)Rs.computePosition(t,n,!1,y,0,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;else for(h=0;h<o;h++)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;for(h=o-1,y=1;y<i;y++)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;if(y=i-1,!s)for(h=o-2;h>=0;h--)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;for(h=0,y=i-2;y>0;y--)Rs.computePosition(t,n,!1,y,h,g),f[p++]=g.x,f[p++]=g.y,f[p++]=g.z;let x=f.length/3*2,S=Me.createTypedArray(f.length/3,x),V=0;for(let R=0;R<f.length/3-1;R++)S[V++]=R,S[V++]=R+1;S[V++]=f.length/3-1,S[V++]=0;let Z=new dt({attributes:new fn,primitiveType:ve.LINES});return Z.attributes.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f}),Z.indices=S,Z}function EQe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=$le(e,t),s=t.height,a=t.width,l=ai.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=l.length,u=new Float64Array(d*2);u.set(l);let f=ai.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(f,d),r.attributes.position.values=u;let p=t.northCap,y=t.southCap,h=4;p&&(h-=1),y&&(h-=1);let g=(u.length/3+h)*2,x=Me.createTypedArray(u.length/3,g);d=u.length/6;let S=0;for(let Z=0;Z<d-1;Z++)x[S++]=Z,x[S++]=Z+1,x[S++]=Z+d,x[S++]=Z+d+1;x[S++]=d-1,x[S++]=0,x[S++]=d+d-1,x[S++]=d,x[S++]=0,x[S++]=d;let V;if(p)V=s-1;else{let Z=a-1;x[S++]=Z,x[S++]=Z+d,V=a+s-2}if(x[S++]=V,x[S++]=V+d,!y){let Z=a+V-1;x[S++]=Z,x[S]=Z+d}return r.indices=x,r}function x1(e){e=e??z.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??w.RADIANS_PER_DEGREE,i=e.ellipsoid??re.default,o=e.rotation??0;if(!c(t))throw new L("rectangle is required.");if(de._validate(t),t.north<t.south)throw new L("options.rectangle.north must be greater than options.rectangle.south");let r=e.height??0,s=e.extrudedHeight??r;this._rectangle=de.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}x1.packedLength=de.packedLength+re.packedLength+5;x1.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,de.pack(e._rectangle,t,n),n+=de.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var ede=new de,tde=re.clone(re.UNIT_SPHERE),g1={rectangle:ede,ellipsoid:tde,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};x1.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=de.unpack(e,t,ede);t+=de.packedLength;let o=re.unpack(e,t,tde);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],d=e[t];return c(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=re.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=l,n._offsetAttribute=d===-1?void 0:d,n):(g1.granularity=r,g1.height=s,g1.rotation=a,g1.extrudedHeight=l,g1.offsetAttribute=d===-1?void 0:d,new x1(g1))};var XQe=new pe;x1.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Rs.computeOptions(t,e._granularity,e._rotation,0,GQe,XQe),o,r;if(w.equalsEpsilon(t.north,t.south,w.EPSILON10)||w.equalsEpsilon(t.east,t.west,w.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,l=!w.equalsEpsilon(s,a,0,w.EPSILON2),d;if(l){if(o=EQe(e,i),c(e._offsetAttribute)){let p=o.attributes.position.values.length/3,y=new Uint8Array(p);e._offsetAttribute===$t.TOP?y=y.fill(1,0,p/2):(d=e._offsetAttribute===$t.NONE?0:1,y=y.fill(d)),o.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}let u=ue.fromRectangle3D(t,n,s,ZQe),f=ue.fromRectangle3D(t,n,a,LQe);r=ue.union(u,f)}else{if(o=$le(e,i),o.attributes.position.values=ai.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),c(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===$t.NONE?0:1;let f=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}r=ue.fromRectangle3D(t,n,s)}return new dt({attributes:o.attributes,indices:o.indices,primitiveType:ve.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var U_=x1;function T1(e){C.typeOf.object("options",e),C.typeOf.object("options.rectangle",e.rectangle),this.rectangle=de.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new m,this.northeastCornerCartesian=new m,this.westNormal=new m,this.southNormal=new m,this.eastNormal=new m,this.northNormal=new m;let t=e.ellipsoid??re.WGS84;vQe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(T1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});T1.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Xn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var nde=new m,Sk=new m,ide=new m,IQe=new m,WQe=new m,wQe=new m,PQe=new m,Hu=new pe,ode=new cn(m.UNIT_X,0),_1=new bn;function vQe(e,t,n){n.cartographicToCartesian(de.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(de.northeast(t),e.northeastCornerCartesian),Hu.longitude=t.west,Hu.latitude=(t.south+t.north)*.5,Hu.height=0;let i=n.cartographicToCartesian(Hu,wQe),o=m.cross(i,m.UNIT_Z,IQe);m.normalize(o,e.westNormal),Hu.longitude=t.east;let r=n.cartographicToCartesian(Hu,PQe),s=m.cross(m.UNIT_Z,r,nde);m.normalize(s,e.eastNormal);let a=m.subtract(i,r,nde);m.magnitude(a)===0&&(a=m.clone(o,a));let l=m.normalize(a,WQe),d=t.south,u;if(d>0){Hu.longitude=(t.west+t.east)*.5,Hu.latitude=d;let g=n.cartographicToCartesian(Hu,_1.origin);m.clone(l,_1.direction);let x=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,ode);qn.rayPlane(_1,x,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(g,Sk)}else u=n.geodeticSurfaceNormalCartographic(de.southeast(t),Sk);let f=m.cross(u,a,ide);m.normalize(f,e.southNormal);let p=t.north,y;if(p<0){Hu.longitude=(t.west+t.east)*.5,Hu.latitude=p;let g=n.cartographicToCartesian(Hu,_1.origin);m.negate(l,_1.direction);let x=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,ode);qn.rayPlane(_1,x,e.northeastCornerCartesian),y=n.geodeticSurfaceNormal(g,Sk)}else y=n.geodeticSurfaceNormalCartographic(de.northwest(t),Sk);let h=m.cross(a,y,ide);m.normalize(h,e.northNormal)}var FQe=new m,AQe=new m,MQe=new m(0,-1,0),NQe=new m(0,0,-1),rde=new m;function kQe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!de.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,f=e.westNormal,p=e.southNormal,y=e.eastNormal,h=e.northNormal;t.mode!==se.SCENE3D&&(d=t.mapProjection.project(de.southwest(e.rectangle),FQe),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(de.northeast(e.rectangle),AQe),u.z=u.y,u.y=u.x,u.x=0,f=MQe,y=m.UNIT_Y,p=NQe,h=m.UNIT_Z);let g=m.subtract(i,d,rde),x=m.dot(g,f),S=m.dot(g,p),V=m.subtract(i,u,rde),Z=m.dot(V,y),R=m.dot(V,h);x>0?r+=x*x:Z>0&&(r+=Z*Z),S>0?r+=S*S:R>0&&(r+=R*R)}let s,a,l;if(t.mode===se.SCENE3D?(s=o.height,a=e.minimumHeight,l=e.maximumHeight):(s=i.x,a=0,l=0),s>l){let d=s-l;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}T1.prototype.distanceToCamera=function(e){C.defined("frameState",e);let t=kQe(this,e);if(e.mode===se.SCENE3D&&c(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};T1.prototype.intersectPlane=function(e){return C.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};T1.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new M.clone(M.IDENTITY),n=new U_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Rt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Xd=T1;var yzn=_(T(),1);var $Hn=_(T(),1);var vHn=_(T(),1);var hP={},UQe=new m,sde=new m,ade=new m,cde=new m,lde=new Xn;hP.validOutline=function(e){C.defined("positions",e);let n=Xn.fromPoints(e,lde).halfAxes,i=te.getColumn(n,0,sde),o=te.getColumn(n,1,ade),r=te.getColumn(n,2,cde),s=m.magnitude(i),a=m.magnitude(o),l=m.magnitude(r);return!(s===0&&(a===0||l===0)||a===0&&l===0)};hP.computeProjectTo2DArguments=function(e,t,n,i){C.defined("positions",e),C.defined("centerResult",t),C.defined("planeAxis1Result",n),C.defined("planeAxis2Result",i);let o=Xn.fromPoints(e,lde),r=o.halfAxes,s=te.getColumn(r,0,sde),a=te.getColumn(r,1,ade),l=te.getColumn(r,2,cde),d=m.magnitude(s),u=m.magnitude(a),f=m.magnitude(l),p=Math.min(d,u,f);if(d===0&&(u===0||f===0)||u===0&&f===0)return!1;let y,h;return(p===u||p===f)&&(y=s),p===d?y=a:p===f&&(h=a),(p===d||p===u)&&(h=l),m.normalize(y,n),m.normalize(h,i),m.clone(o.center,t),!0};function dde(e,t,n,i,o){let r=m.subtract(e,t,UQe),s=m.dot(n,r),a=m.dot(i,r);return D.fromElements(s,a,o)}hP.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=dde(i[r],e,t,n);return o}};hP.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return dde(i,e,t,n,o)}};var Eb=hP;function OQe(e){let t=e.length,n=new Float64Array(t*3),i=Me.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let l=e[a];n[o++]=l.x,n[o++]=l.y,n[o++]=l.z,i[r++]=a,i[r++]=(a+1)%t}let s=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:n})});return new dt({attributes:s,indices:i,primitiveType:ve.LINES})}function O_(e){e=e??z.EMPTY_OBJECT;let t=e.polygonHierarchy;C.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Dn.computeHierarchyPackedLength(t,m)+1}O_.fromPositions=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions}};return new O_(t)};O_.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),t[n]=e.packedLength,t};var DQe={polygonHierarchy:{}};O_.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=Dn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=e[t];return c(n)||(n=new O_(DQe)),n._polygonHierarchy=i,n.packedLength=o,n};O_.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=xo(n,m.equalsEpsilon,!0),n.length<3||!Eb.validOutline(n))return;let o=Dn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let l=0;l<o.length;l++){let d=new Rt({geometry:OQe(o[l])});r.push(d)}let s=An.combineInstances(r)[0],a=ue.fromPoints(t.positions);return new dt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var zu=O_;var Ck=new pe;function pP(e){C.typeOf.object("options",e),C.typeOf.string("options.token",e.token);let t=Qp.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??re.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=qQe(t,n,i,o);this._boundingPlanes=r;let s=nje(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=_K(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=m.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=_K(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=_K(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 l=t.getCenter();Ck=o.cartesianToCartographic(l,Ck),Ck.height=(i+n)/2,this.center=o.cartographicToCartesian(Ck,l),this._boundingSphere=ue.fromPoints(s)}var BQe=new m,YQe=new pe,HQe=new m,zQe=new pe,KQe=new m,JQe=new m,QQe=new m,jQe=new m;function qQe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,BQe),a=i.cartesianToCartographic(r,YQe);a.height=n;let l=i.cartographicToCartesian(a,HQe),d=cn.fromPointNormal(l,s);o[0]=d;let u=0,f,p=[],y,h;for(f=0;f<4;f++){y=e.getVertex(f),p[f]=y,h=i.cartesianToCartographic(y,zQe),h.height=t;let x=cn.getPointDistance(d,i.cartographicToCartesian(h,KQe));x<u&&(u=x)}let g=cn.clone(d);for(g.normal=m.negate(g.normal,g.normal),g.distance=g.distance*-1+u,o[1]=g,f=0;f<4;f++){y=p[f];let x=p[(f+1)%4],S=i.geodeticSurfaceNormal(y,JQe),V=m.subtract(x,y,jQe),Z=m.cross(V,S,QQe);Z=m.normalize(Z,Z),o[2+f]=cn.fromPointNormal(y,Z)}return o}var D_=new m,B_=new m,Y_=new m,fK=new m,hK=new m,pK=new m,$Qe=new m,eje=new m,tje=new m,bK=new m,yK=new m,gK=new m,ky=new m,Ih=new te;function ude(e,t,n){D_=e.normal,B_=t.normal,Y_=n.normal,fK=m.multiplyByScalar(e.normal,-e.distance,fK),hK=m.multiplyByScalar(t.normal,-t.distance,hK),pK=m.multiplyByScalar(n.normal,-n.distance,pK),bK=m.multiplyByScalar(m.cross(B_,Y_,$Qe),m.dot(fK,D_),bK),yK=m.multiplyByScalar(m.cross(Y_,D_,eje),m.dot(hK,B_),yK),gK=m.multiplyByScalar(m.cross(D_,B_,tje),m.dot(pK,Y_),gK),Ih[0]=D_.x,Ih[1]=B_.x,Ih[2]=Y_.x,Ih[3]=D_.y,Ih[4]=B_.y,Ih[5]=Y_.y,Ih[6]=D_.z,Ih[7]=B_.z,Ih[8]=Y_.z;let i=te.determinant(Ih);return ky=m.add(bK,yK,ky),ky=m.add(ky,gK,ky),new m(ky.x/i,ky.y/i,ky.z/i)}function nje(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=ude(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=ude(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var xK=new m,S1=new m;function _K(e,t){let n=[];for(let i=0;i<4;i++)xK=m.subtract(t[(i+1)%4],t[i],xK),S1=m.cross(e.normal,xK,S1),S1=m.normalize(S1,S1),n[i]=m.clone(S1);return n}Object.defineProperties(pP.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var TK=new m;pP.prototype.distanceToCamera=function(e){C.defined("frameState",e);let t=e.camera.positionWC,n=[],i=[],o;cn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):cn.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,cn.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,l;if(n.length===1)return l=this._boundingPlanes[n[0]],a=SK(cn.projectPointOntoPlane(l,t,TK),i[0],l,o),m.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=mde(t,p[0],p[1]),m.distance(a,t)}let u=Number.MAX_VALUE,f;for(r=0;r<2;r++)l=this._boundingPlanes[n[r]],a=SK(cn.projectPointOntoPlane(l,t,TK),i[r],l,this._edgeNormals[n[r]]),f=m.distanceSquared(a,t),f<u&&(u=f);return Math.sqrt(u)}else if(n.length>3)return a=SK(cn.projectPointOntoPlane(this._boundingPlanes[1],t,TK),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),m.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?m.distance(t,this._vertices[(n[1]-2+d)%4]):m.distance(t,this._vertices[4+(n[1]-2+d)%4])};var ije=new m,oje=new m;function mde(e,t,n){let i=m.subtract(n,t,ije),o=m.subtract(e,t,oje),r=m.dot(i,o);if(r<=0)return t;let s=m.dot(i,i);return r>=s?n:(r=r/s,new m((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var rje=new cn(m.UNIT_X,0);function SK(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let l=0;l<t.length;l++){let d=cn.fromPointNormal(t[l],i[l],rje);cn.getPointDistance(d,e)<0||(a=mde(e,t[l],t[(l+1)%4]),r=m.distance(e,a),r<o&&(o=r,s=a))}return c(s)?s:e}pP.prototype.intersectPlane=function(e){C.defined("plane",e);let t=0,n=0;for(let i=0;i<this._vertices.length;i++)m.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?zt.INSIDE:n===this._vertices.length?zt.OUTSIDE:zt.INTERSECTING};pP.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new M.clone(M.IDENTITY),n=new zu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=zu.createGeometry(n),o=new Rt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),r=new zu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=zu.createGeometry(r),a=new Rt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}}),l=[];for(let d=0;d<4;d++){let u=new zu({polygonHierarchy:{positions:this._planeVertices[2+d]}}),f=zu.createGeometry(u);l[d]=new Rt({geometry:f,id:"outline",modelMatrix:t,attributes:{color:Yt.fromColor(e)}})}return new In({geometryInstances:[l[0],l[1],l[2],l[3],a,o],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var bP=pP;var jzn=_(T(),1);var Nzn=_(T(),1);var wzn=_(T(),1);var sje=new m(1,1,1),Vk=Math.cos,Lk=Math.sin;function C1(e){e=e??z.EMPTY_OBJECT;let t=e.radii??sje,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??w.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??w.PI,a=Math.round(e.stackPartitions??10),l=Math.round(e.slicePartitions??8),d=Math.round(e.subdivisions??128);if(a<1)throw new L("options.stackPartitions cannot be less than 1");if(l<0)throw new L("options.slicePartitions cannot be less than 0");if(d<0)throw new L("options.subdivisions must be greater than or equal to zero.");if(c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}C1.packedLength=2*m.packedLength+8;C1.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var fde=new m,hde=new m,Xb={radii:fde,innerRadii:hde,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};C1.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=m.unpack(e,t,fde);t+=m.packedLength;let o=m.unpack(e,t,hde);t+=m.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t];return c(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=l,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=f,n._offsetAttribute=p===-1?void 0:p,n):(Xb.minimumClock=r,Xb.maximumClock=s,Xb.minimumCone=a,Xb.maximumCone=l,Xb.stackPartitions=d,Xb.slicePartitions=u,Xb.subdivisions=f,Xb.offsetAttribute=p===-1?void 0:p,new C1(Xb))};C1.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,l=re.fromCartesian3(t),d=e._slicePartitions+1,u=e._stackPartitions+1;d=Math.round(d*Math.abs(o-i)/w.TWO_PI),u=Math.round(u*Math.abs(s-r)/w.PI),d<2&&(d=2),u<2&&(u=2);let f=0,p=1,y=n.x!==t.x||n.y!==t.y||n.z!==t.z,h=!1,g=!1;y&&(p=2,r>0&&(h=!0,f+=d),s<Math.PI&&(g=!0,f+=d));let x=a*p*(u+d),S=new Float64Array(x*3),V=2*(x+f-(d+u)*p),Z=Me.createTypedArray(x,V),R,E,I,v,P=0,F=new Array(u),N=new Array(u);for(R=0;R<u;R++)v=r+R*(s-r)/(u-1),F[R]=Lk(v),N[R]=Vk(v);let b=new Array(a),G=new Array(a);for(R=0;R<a;R++)I=i+R*(o-i)/(a-1),b[R]=Lk(I),G[R]=Vk(I);for(R=0;R<u;R++)for(E=0;E<a;E++)S[P++]=t.x*F[R]*G[E],S[P++]=t.y*F[R]*b[E],S[P++]=t.z*N[R];if(y)for(R=0;R<u;R++)for(E=0;E<a;E++)S[P++]=n.x*F[R]*G[E],S[P++]=n.y*F[R]*b[E],S[P++]=n.z*N[R];for(F.length=a,N.length=a,R=0;R<a;R++)v=r+R*(s-r)/(a-1),F[R]=Lk(v),N[R]=Vk(v);for(b.length=d,G.length=d,R=0;R<d;R++)I=i+R*(o-i)/(d-1),b[R]=Lk(I),G[R]=Vk(I);for(R=0;R<a;R++)for(E=0;E<d;E++)S[P++]=t.x*F[R]*G[E],S[P++]=t.y*F[R]*b[E],S[P++]=t.z*N[R];if(y)for(R=0;R<a;R++)for(E=0;E<d;E++)S[P++]=n.x*F[R]*G[E],S[P++]=n.y*F[R]*b[E],S[P++]=n.z*N[R];for(P=0,R=0;R<u*p;R++){let A=R*a;for(E=0;E<a-1;E++)Z[P++]=A+E,Z[P++]=A+E+1}let X=u*a*p;for(R=0;R<d;R++)for(E=0;E<a-1;E++)Z[P++]=X+R+E*d,Z[P++]=X+R+(E+1)*d;if(y)for(X=u*a*p+d*a,R=0;R<d;R++)for(E=0;E<a-1;E++)Z[P++]=X+R+E*d,Z[P++]=X+R+(E+1)*d;if(y){let A=u*a*p,k=A+a*d;if(h)for(R=0;R<d;R++)Z[P++]=A+R,Z[P++]=k+R;if(g)for(A+=a*d-d,k+=a*d-d,R=0;R<d;R++)Z[P++]=A+R,Z[P++]=k+R}let W=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:S})});if(c(e._offsetAttribute)){let A=S.length,k=e._offsetAttribute===$t.NONE?0:1,B=new Uint8Array(A/3).fill(k);W.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:B})}return new dt({attributes:W,indices:Z,primitiveType:ve.LINES,boundingSphere:ue.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})};var Id=C1;function V1(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Id(i),this._workerName="createSphereOutlineGeometry"}V1.packedLength=Id.packedLength;V1.pack=function(e,t,n){return C.typeOf.object("value",e),Id.pack(e._ellipsoidGeometry,t,n)};var aje=new Id,H_={radius:void 0,radii:new m,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};V1.unpack=function(e,t,n){let i=Id.unpack(e,t,aje);return H_.stackPartitions=i._stackPartitions,H_.slicePartitions=i._slicePartitions,H_.subdivisions=i._subdivisions,c(n)?(m.clone(i._radii,H_.radii),n._ellipsoidGeometry=new Id(H_),n):(H_.radius=i._radii.x,new V1(H_))};V1.createGeometry=function(e){return Id.createGeometry(e._ellipsoidGeometry)};var Ib=V1;function L1(e,t){t===0&&(t=w.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(L1.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}}});L1.prototype.distanceToCamera=function(e){C.defined("frameState",e);let t=this._boundingSphere;return Math.max(0,m.distance(t.center,e.camera.positionWC)-t.radius)};L1.prototype.intersectPlane=function(e){return C.defined("plane",e),ue.intersectPlane(this._boundingSphere,e)};L1.prototype.update=function(e,t){m.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};L1.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new Ib({radius:this.radius}),n=M.fromTranslation(this.center,new M.clone(M.IDENTITY)),i=new Rt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Wb=L1;var uKn=_(T(),1);var cje=new m,lje=new m,dje=new m,uje=new m;function z_(e,t,n){n=m.cross(e,t,n);let i=m.magnitude(n);return m.multiplyByScalar(n,w.EPSILON7/i,n)}function CK(e,t){let n=m.normalize(e,uje),i=m.equalsEpsilon(n,m.UNIT_X,w.EPSILON6)?m.UNIT_Y:m.UNIT_X;return z_(e,i,t)}function pde(e){let t=te.getColumn(e,0,cje),n=te.getColumn(e,1,lje),i=te.getColumn(e,2,dje),o=m.equals(t,m.ZERO),r=m.equals(n,m.ZERO),s=m.equals(i,m.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=w.EPSILON7,e[4]=w.EPSILON7,e[8]=w.EPSILON7,e):(o&&!r&&!s?t=z_(n,i,t):!o&&r&&!s?n=z_(t,i,n):!o&&!r&&s?i=z_(n,t,i):o?r?s||(t=CK(i,t),n=z_(i,t,n)):(t=CK(n,t),i=z_(n,t,i)):(n=CK(t,n),i=z_(n,t,i)),te.setColumn(e,0,t,e),te.setColumn(e,1,n,e),te.setColumn(e,2,i,e),e)}function Z1(e,t){t=pde(t),this._orientedBoundingBox=new Xn(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(Z1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Z1.prototype.distanceToCamera=function(e){return C.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};Z1.prototype.intersectPlane=function(e){return C.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};Z1.prototype.update=function(e,t){m.clone(e,this._orientedBoundingBox.center),t=pde(t),te.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};Z1.prototype.createDebugVolume=function(e){C.defined("color",e);let t=new Fm({minimum:new m(-1,-1,-1),maximum:new m(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Rt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Yt.fromColor(e)}});return new In({geometryInstances:i,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})};var Ol=Z1;function or(e,t,n,i){this._tileset=e,this._header=n;let o=c(n.contents),r=o&&n.contents.length>1||ri(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=c(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=c(i)?i.computedTransform:e.modelMatrix,l=M.multiply(a,this.transform,new M),d=c(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(d,this.transform,new M),this.computedTransform=l,this.metadata=uP(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,l),this._boundingVolume2D=void 0;let u;c(s)&&c(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,l)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let f;c(n.viewerRequestVolume)&&(f=this.createBoundingVolume(n.viewerRequestVolume,l)),this._viewerRequestVolume=f,this.geometricError=n.geometricError,this._geometricError=n.geometricError,c(this._geometricError)||(this._geometricError=c(i)?i._geometricError:e._geometricError,or._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;c(n.refine)?((n.refine==="replace"||n.refine==="add")&&or._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Bo.REPLACE:Bo.ADD):c(i)?p=i.refine:p=Bo.REPLACE,this.refine=p,this.children=[],this.parent=i;let y,h=!1,g,x,S;if(t=Ge.createIfNeeded(t),r)g=Ho.UNLOADED,x=t.clone();else if(c(s)){let E=s.uri;c(s.url)&&(or._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=s.url),E===""?(or._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),y=new y1(e,this),h=!0,g=Ho.READY):(g=Ho.UNLOADED,x=t.getDerivedResource({url:E}),S=ic.getServerKey(x.getUrlComponent()))}else y=new y1(e,this),h=!0,g=Ho.READY;this._content=y,this._contentResource=x,this._contentState=g,this._expiredContent=void 0,this._serverKey=S,this.hasEmptyContent=h,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!h,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,Z,R;c(V)&&(Z=V.duration,c(V.date)&&(R=ee.fromIso8601(V.date))),this.expireDuration=Z,this.expireDate=R,this.lastStyleTime=0,this._optimChildrenWithinParent=Du.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=Y.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 ee,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}or._deprecationWarning=Cs;Object.defineProperties(or.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 c(this._color)||(this._color=new Y),Y.clone(this._color)},set:function(e){this._color=Y.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||c(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Ho.READY}},contentUnloaded:{get:function(){return this._contentState===Ho.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Ho.EXPIRED}},contentFailed:{get:function(){return this._contentState===Ho.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Uy=new m;function mje(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=m.multiplyByScalar(s.directionWC,e._centerZDepth,Uy),l=m.add(s.positionWC,a,Uy),d=m.subtract(l,r,Uy);if(m.magnitude(d)>o){let R=m.normalize(d,Uy),E=m.multiplyByScalar(R,o,Uy),I=m.add(r,E,Uy),v=m.subtract(I,s.positionWC,Uy),P=m.normalize(v,Uy);e._foveatedFactor=1-Math.abs(m.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===Bo.REPLACE,y=n.isSkippingLevelOfDetail;if(p&&!y||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&y||n._pass===Fo.PRELOAD_FLIGHT||n._pass===Fo.PRELOAD)return!1;let h=1-Math.cos(s.frustum.fov*.5),g=n.foveatedConeSize*h;if(e._foveatedFactor<=g)return!1;let x=h-g,S=w.clamp((e._foveatedFactor-g)/x,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,S),Z=e._screenSpaceError===0&&c(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=Z}var _de=new ee;or.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=c(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:l}=e,d=a.frustum,u=l.drawingBufferWidth,f=l.drawingBufferHeight*o,p;if(e.mode===se.SCENE2D||d instanceof sn){let y=d.offCenterFrustum;c(y)&&(d=y);let h=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,f);p=s/h}else{let y=Math.max(this._distanceToCamera,w.EPSILON7),h=d.sseDenominator;if(p=s*f/(y*h),i.dynamicScreenSpaceError){let g=i._dynamicScreenSpaceErrorComputedDensity,x=i.dynamicScreenSpaceErrorFactor,S=w.fog(y,g)*x;p-=S}}return p/=e.pixelRatio,p};function fje(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=c(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function hje(e,t){let n=t.parent,o=c(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}or.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=c(t)?t.computedTransform:n.modelMatrix,o=c(t)?t._visibilityPlaneMask:fs.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!==fs.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=hje(n,this),this._priorityProgressiveResolution=fje(n,this),this.priorityDeferred=mje(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};or.prototype.updateExpiration=function(){if(c(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=ee.now(_de);ee.lessThan(this.expireDate,e)&&(this._contentState=Ho.EXPIRED,this._expiredContent=this._content)}};function pje(e){if(!c(e.expireDuration))return;let t=ee.now(_de);ee.addSeconds(t,e.expireDuration,t),c(e.expireDate)?ee.lessThan(e.expireDate,t)&&ee.clone(t,e.expireDate):e.expireDate=ee.clone(t)}function bje(e){return function(){return e._priority}}or.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?yje(this):xje(this)};function yje(e){let t=e._content,n=e._tileset;if(!c(t)){let o=ri(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new mP(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(c(i))return e._contentState=Ho.LOADING,i.then(o=>{if(!e.isDestroyed()&&c(o))return e._contentState=Ho.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Ho.FAILED,o})}async function gje(e,t,n,i,o){let r=e._contentState;e._contentState=Ho.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Ho.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await _je(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Ho.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Ho.FAILED,a}}function xje(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Jo({throttle:!0,throttleByServer:!0,type:us.TILES3D,priorityFunction:bje(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!c(r)){++o.statistics.numberOfAttemptedRequests;return}return gje(e,o,i,n,r)}async function _je(e,t){let n=Gb(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Zs.GEOMETRY||n.contentType===Zs.VECTOR,(n.contentType===Zs.IMPLICIT_SUBTREE||n.contentType===Zs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Zs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=M_[n.contentType];if(e.isDestroyed())return;c(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 l=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=l.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=N_(i,s));let a=k_(i,s);return c(a)&&(o.group=new e_({metadata:a})),o}or.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};or.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Ho.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 Tde=new ue;function LK(e,t){if(t.mode!==se.SCENE3D&&!c(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Tde);e._boundingVolume2D=new Wb(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Tje(e,t){if(t.mode!==se.SCENE3D&&!c(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,Tde);e._contentBoundingVolume2D=new Wb(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}or.prototype.visibility=function(e,t){let n=e.cullingVolume,i=LK(this,e),o=this._tileset,r=o.clippingPlanes;if(c(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==zt.INSIDE,a===zt.OUTSIDE)return fs.MASK_OUTSIDE}let s=o.clippingPolygons;if(c(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==zt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};or.prototype.contentVisibility=function(e){if(!c(this._contentBoundingVolume))return zt.INSIDE;if(this._visibilityPlaneMask===fs.MASK_INSIDE)return zt.INSIDE;let t=e.cullingVolume,n=Tje(this,e),i=this._tileset,o=i.clippingPlanes;if(c(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==zt.INSIDE,s===zt.OUTSIDE)return zt.OUTSIDE}let r=i.clippingPolygons;if(c(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==zt.OUTSIDE,s===zt.INSIDE)return zt.OUTSIDE}return t.computeVisibility(n)};or.prototype.distanceToTile=function(e){return LK(this,e).distanceToCamera(e)};var Sje=new m;or.prototype.distanceToTileCenter=function(e){let n=LK(this,e).boundingVolume,i=m.subtract(n.center,e.camera.positionWC,Sje);return m.dot(e.camera.directionWC,i)};or.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!c(t)||t.distanceToCamera(e)===0};var Sde=new te,Cde=new m,Cje=new te,ZK=new m,Vde=new de,Lde=new Xn,VK=new M;function Vje(e,t,n){let i=m.fromElements(e[0],e[1],e[2],ZK),o=te.fromArray(e,3,Cje);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,Sde);return o=te.multiply(r,o,o),c(n)?(n.update(i,o),n):new Ol(i,o)}function bde(e,t,n,i){let o=de.unpack(e,0,Vde),r=e[4],s=e[5],a=Xn.fromRectangle(o,r,s,re.WGS84,Lde),l=a.center,d=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,VK),VK),l=M.multiplyByPoint(t,l,l);let u=M.getMatrix3(t,Sde);return d=te.multiply(u,d,d),c(i)&&i instanceof Ol?(i.update(l,d),i):new Ol(l,d)}function Lje(e,t,n,i){if(!M.equalsEpsilon(t,n,w.EPSILON8))return i instanceof Ol?bde(e,t,n,i):bde(e,t,n,void 0);let o=de.unpack(e,0,Vde);return i instanceof Xd?(i.rectangle=de.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(re.WGS84),i):new Xd({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Zje(e,t,n){let i=m.fromElements(e[0],e[1],e[2],ZK),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,Cde),s=m.maximumComponent(r);return o*=s,c(n)?(n.update(i,o),n):new Wb(i,o)}or.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(c(i)&&(o=g_.parseBoundingVolumeSemantic("TILE",i)),c(o)&&(e=o),!c(e))throw new le("boundingVolume must be defined");if(ri(e,"3DTILES_bounding_volume_S2"))return new bP(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(c(r)){let l=Vje(r,t,n);return this._verticalExaggeration!==1&&yde(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l}if(c(s)){let l=Lje(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(l instanceof Ol?yde(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(l.minimumHeight=Lr.getHeight(l.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.maximumHeight=Lr.getHeight(l.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.computeBoundingVolumes(re.WGS84))),l}if(c(a)){let l=Zje(a,t,n);if(this._verticalExaggeration!==1){let d=Lr.getPosition(l.center,re.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,ZK),u=l.radius*this._verticalExaggeration;l.update(d,u)}return l}throw new le("boundingVolume must contain a sphere, region, or box")};var Rje=m.unpackArray(new Array(8*3).fill(0));function yde(e,t,n){let i=e.boundingVolume.computeCorners(Rje).map(r=>Lr.getPosition(r,re.WGS84,t,n,r)),o=Xn.fromPoints(i,Lde);e.update(o.center,o.halfAxes)}or.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,VK),i=!M.equals(n,this.computedTransform),o=c(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),c(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),c(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()};or.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,Cde),t=m.maximumComponent(e);if(this.geometricError=this._geometricError*t,!c(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Gje(e,t,n,i){if(!i.isRender)return;let o=c(e._contentHeader)&&c(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let l;e._finalResolution?e.hasRenderableContent?l=Y.WHITE:l=Y.DARKGRAY:l=Y.YELLOW,c(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(l)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Yt.toValue(l,d.color)}else!r&&c(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(c(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(Y.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&c(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&c(e._viewerRequestVolume)?(c(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(Y.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&c(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||c(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=Y.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Eje(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&c(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(c(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Ho.FAILED,o}}function Xje(e,t){let n=t.clippingPlanes,i=0;c(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function Ije(e,t){let n=t.clippingPolygons,i=0;c(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}or.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Xje(this,e),Ije(this,e),Gje(this,e,t,n),Eje(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],l=a.pass===Xe.TRANSLUCENT;a.depthForTranslucentClassification=l}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var gde=[];or.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(pje(this),this._selectedFrame=0,this.lastStyleTime=0,ee.now(this._loadTimestamp),this._contentState=Ho.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=gde;try{this._content.update(e,t)}catch(i){throw this._contentState=Ho.FAILED,i}gde.length=0,t.commandList=n};function xde(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function Zk(e,t,n){return Math.max(w.normalize(e,t,n)-w.EPSILON7,0)}or.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,l=s+a,d=o,u=l+d,f=r,p=Math.pow(10,u),y=u+f,h=r,g=Math.pow(10,y),x=y+h,S=Math.pow(10,x),V=Zk(this._depth,n.depth,i.depth);V=t?1-V:V;let R=!e.isSkippingLevelOfDetail&&this.refine===Bo.REPLACE?Zk(this._priorityHolder._distanceToCamera,n.distance,i.distance):Zk(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=xde(R,a,s),I=this._priorityProgressiveResolution?0:p,v=Zk(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=xde(v,d,l),F=this.priorityDeferred?g:0,N=e._pass===Fo.PRELOAD_FLIGHT?0:S;this._priority=V+E+I+P+F+N};or.prototype.isDestroyed=function(){return!1};or.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(),he(this)};var Ku=or;var CJn=_(T(),1);var dJn=_(T(),1);function wb(e){e=e??z.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class;C.typeOf.object("options.group",n),C.typeOf.object("options.class",i);let o=c(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(wb.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}}});wb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};wb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};wb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};wb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};wb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};wb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};wb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var R1=wb;var bJn=_(T(),1);function Pb(e){e=e??z.EMPTY_OBJECT;let t=e.tileset,n=e.class;C.typeOf.object("options.tileset",t),C.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Pb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Pb.prototype.hasProperty=function(e){return Nn.hasProperty(e,this._properties,this._class)};Pb.prototype.hasPropertyBySemantic=function(e){return Nn.hasPropertyBySemantic(e,this._properties,this._class)};Pb.prototype.getPropertyIds=function(e){return Nn.getPropertyIds(this._properties,this._class,e)};Pb.prototype.getProperty=function(e){return Nn.getProperty(e,this._properties,this._class)};Pb.prototype.setProperty=function(e,t){return Nn.setProperty(e,t,this._properties,this._class)};Pb.prototype.getPropertyBySemantic=function(e){return Nn.getPropertyBySemantic(e,this._properties,this._class)};Pb.prototype.setPropertyBySemantic=function(e,t){return Nn.setPropertyBySemantic(e,t,this._properties,this._class)};var yP=Pb;function Zde(e){e=e??z.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema;C.typeOf.object("options.metadataJson",t),C.typeOf.object("options.schema",n);let i=t.metadata??t.tileset,o;c(i)&&(o=new yP({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let l=a.length;for(let d=0;d<l;d++){let u=a[d];s.push(new R1({group:u,class:n.classes[u.class]}))}}else if(c(a)){r=Object.keys(a).sort();let l=r.length;for(let d=0;d<l;d++){let u=r[d];if(a.hasOwnProperty(u)){let f=a[u];s.push(new R1({id:u,group:a[u],class:n.classes[f.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(Zde.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 K_=Zde;var XJn=_(T(),1);var Rde={},Wje=new m;Rde.checkChildrenWithinParent=function(e){C.typeOf.object("tile",e);let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Ol||i instanceof Xd){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Du.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Ol||a instanceof Xd)){e._optimChildrenWithinParent=Du.SKIP_OPTIMIZATION;break}let l=a._orientedBoundingBox,d=m.subtract(l.center,o.center,Wje),u=m.magnitude(d);m.divideByScalar(d,u,d);let f=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(l.halfAxes[0]*d.x)+Math.abs(l.halfAxes[1]*d.y)+Math.abs(l.halfAxes[2]*d.z)+Math.abs(l.halfAxes[3]*d.x)+Math.abs(l.halfAxes[4]*d.y)+Math.abs(l.halfAxes[5]*d.z)+Math.abs(l.halfAxes[6]*d.x)+Math.abs(l.halfAxes[7]*d.y)+Math.abs(l.halfAxes[8]*d.z);if(f<=p+u){e._optimChildrenWithinParent=Du.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Du.USE_OPTIMIZATION};var gP=Rde;var AJn=_(T(),1);var wJn=_(T(),1);function xP(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(xP.prototype,{length:{get:function(){return this._length}}});function wje(e,t,n){this.item=e,this.previous=t,this.next=n}xP.prototype.add=function(e){let t=new wje(e,this.tail,void 0);return c(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Gde(e,t){c(t.previous)&&c(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):c(t.previous)?(t.previous.next=void 0,e.tail=t.previous):c(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}xP.prototype.remove=function(e){c(e)&&(Gde(this,e),--this._length)};xP.prototype.splice=function(e,t){if(e===t)return;Gde(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 _P=xP;function J_(){this._list=new _P,this._sentinel=this._list.add(),this._trimTiles=!1}J_.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};J_.prototype.touch=function(e){let t=e.cacheNode;c(t)&&this._list.splice(this._sentinel,t)};J_.prototype.add=function(e){c(e.cacheNode)||(e.cacheNode=this._list.add(e))};J_.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;c(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};J_.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)}};J_.prototype.trim=function(){this._trimTiles=!0};var TP=J_;var DJn=_(T(),1);function Rk(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 GK(e,t){let n;return t==="_loadTimestamp"?n=ee.toDate(e).getTime():n=e,n}Rk.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=GK(e,n),this._referenceMaximum[n]=GK(t,n)};function Pje(e,t){let n=e.tilePropertyName;if(c(n)){let i=GK(t[n],n);return c(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var RK=[new Y(.1,.1,.1,1),new Y(.153,.278,.878,1),new Y(.827,.231,.49,1),new Y(.827,.188,.22,1),new Y(1,.592,.259,1),new Y(1,.843,0,1)];Rk.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!c(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Pje(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+w.EPSILON7,l=w.clamp(i-o,0,s)/s,d=RK.length-1,u=l*d,f=Math.floor(u),p=Math.ceil(u),y=u-f,h=RK[f],g=RK[p],x=Y.clone(Y.WHITE);x.red=w.lerp(h.red,g.red,y),x.green=w.lerp(h.green,g.green,y),x.blue=w.lerp(h.blue,g.blue,y),e._debugColor=x};Rk.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(c(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=c(t)&&c(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var SP=Rk;var zJn=_(T(),1);function G1(){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}G1.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};G1.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};G1.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Rd))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};G1.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Rd))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(c(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};G1.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 pf=G1;var QJn=_(T(),1);function CP(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(CP.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});CP.prototype.makeDirty=function(){this._styleDirty=!0};CP.prototype.resetDirty=function(){this._styleDirty=!1};CP.prototype.applyStyle=function(e){if(!c(e.root)||c(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 l=a.content;a.lastStyleTime=n,l.applyStyle(this._style),i.numberOfFeaturesStyled+=l.featuresLength,++i.numberOfTilesStyled}}};var VP=CP;var rQn=_(T(),1);function vje(e,t,n){let i=ri(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;C.typeOf.object("implicitTiling",i),this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!c(o.box)&&!c(o.region)&&!ri(o,"3DTILES_bounding_volume_S2")&&!ri(o,"3DTILES_bounding_volume_cylinder"))throw new le("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Ge({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=Fje(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(He(a,!0));let l=new Ge({url:a.uri});this.contentUriTemplates.push(l)}this.contentCount=this.contentHeaders.length,this.tileHeader=Aje(t),this.subdivisionScheme=tr[i.subdivisionScheme],this.branchingFactor=tr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,c(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Fje(e){if(ri(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return c(t.contents)?t.contents:t.content}return c(e.contents)?e.contents:c(e.content)?[e.content]:[]}function Aje(e){let t=He(e,!0);return c(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 Q_=vje;var yQn=_(T(),1);var dQn=_(T(),1);var LP={};function Ede(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function EK(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Xde(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 XK(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}LP.encode2D=function(e,t){if(C.typeOf.number("x",e),C.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new L("inputs must be 16-bit unsigned integers");return(Ede(e)|Ede(t)<<1)>>>0};LP.decode2D=function(e,t){if(C.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new L("input must be a 32-bit unsigned integer");return c(t)||(t=new Array(2)),t[0]=Xde(e),t[1]=Xde(e>>1),t};LP.encode3D=function(e,t,n){if(C.typeOf.number("x",e),C.typeOf.number("y",t),C.typeOf.number("z",n),e<0||e>1023||t<0||t>1023||n<0||n>1023)throw new L("inputs must be 10-bit unsigned integers");return EK(e)|EK(t)<<1|EK(n)<<2};LP.decode3D=function(e,t){if(C.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new L("input must be a 30-bit unsigned integer");return c(t)||(t=new Array(3)),t[0]=XK(e),t[1]=XK(e>>1),t[2]=XK(e>>2),t};var Oy=LP;function zo(e){if(C.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),C.typeOf.number("options.subtreeLevels",e.subtreeLevels),C.typeOf.number("options.level",e.level),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),e.subdivisionScheme===tr.OCTREE&&C.typeOf.number("options.z",e.z),e.level<0)throw new L("level must be non-negative");if(e.x<0)throw new L("x must be non-negative");if(e.y<0)throw new L("y must be non-negative");if(e.subdivisionScheme===tr.OCTREE&&e.z<0)throw new L("z must be non-negative");let t=1<<e.level;if(e.x>=t)throw new L("x is out of range");if(e.y>=t)throw new L("y is out of range");if(e.subdivisionScheme===tr.OCTREE&&e.z>=t)throw new L("z is out of range");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===tr.OCTREE&&(this.z=e.z)}Object.defineProperties(zo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===tr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===tr.OCTREE?Oy.encode3D(this.x,this.y,this.z):Oy.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===tr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});function IK(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new L("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new L("coordinates must have same subtreeLevels")}zo.prototype.getDescendantCoordinates=function(e){C.typeOf.object("offsetCoordinates",e),IK(this,e);let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===tr.OCTREE){let o=(this.z<<e.level)+e.z;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};zo.prototype.getAncestorCoordinates=function(e){if(C.typeOf.number("offsetLevels",e),e<0)throw new L("offsetLevels must be non-negative");if(e>this.level)throw new L("ancestor cannot be above the tileset root");let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===tr.OCTREE){let r=Math.floor(this.z/t);return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};zo.prototype.getOffsetCoordinates=function(e){if(C.typeOf.object("descendantCoordinates",e),!this.isEqual(e)&&!this.isAncestor(e))throw new L("this is not an ancestor of descendant");IK(this,e);let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===tr.OCTREE){let r=e.z%n;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};zo.prototype.getChildCoordinates=function(e){C.typeOf.number("childIndex",e);let t=tr.getBranchingFactor(this.subdivisionScheme);if(e<0||t<=e)throw new L(`childIndex must be at least 0 and less than ${t}`);let n=this.level+1,i=2*this.x+e%2,o=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===tr.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new zo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};zo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};zo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};zo.prototype.isAncestor=function(e){C.typeOf.object("descendantCoordinates",e),IK(this,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===tr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};zo.prototype.isEqual=function(e){return C.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===tr.OCTREE?this.z===e.z:!0)};zo.prototype.isImplicitTilesetRoot=function(){return this.level===0};zo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};zo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};zo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===tr.OCTREE&&(e.z=this.z),e};var Ide=[0,0,0];zo.fromMortonIndex=function(e,t,n,i){let o;return e===tr.OCTREE?(o=Oy.decode3D(i,Ide),new zo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Oy.decode2D(i,Ide),new zo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};zo.fromTileIndex=function(e,t,n){let i,o,r;return e===tr.OCTREE?(i=Math.floor(w.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(w.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),zo.fromMortonIndex(e,t,i,r)};var j_=zo;var XQn=_(T(),1);var VQn=_(T(),1);function vb(){}vb.selectTiles=function(e,t){L.throwInstantiationError()};vb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};vb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};vb.selectTile=function(e,t){if(e.contentVisibility(t)===zt.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)};vb.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};vb.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};vb.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Mje(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Mje(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}vb.updateTile=function(e,t){Wde(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Uje(e),e._shouldSelect=!1,e._finalResolution=!0};function Wde(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];Wde(r,t),e._visible=r._visible;return}if(Nje(e,t)){e._visible=!1;return}let i=e.refine===Bo.REPLACE,o=e._optimChildrenWithinParent===Du.USE_OPTIMIZATION;if(i&&o&&n&&!kje(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Nje(e,t){let{parent:n,tileset:i}=e;return!c(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Bo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function kje(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 Uje(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 zs=vb;function wde(){}var ZP={stack:new Jc,stackMaximumLength:0};wde.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}=zs,s=ZP.stack;for(s.push(i);s.length>0;){ZP.stackMaximumLength=Math.max(ZP.stackMaximumLength,s.length);let a=s.pop(),l=a.refine===Bo.ADD,d=a.refine===Bo.REPLACE,u=Oje(a);u&&Dje(a,s,t),(l||d&&!u)&&(Bje(e,a),o(a,t),Yje(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return ZP.stack.trim(ZP.stackMaximumLength),n};function Oje(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Dje(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 Bje(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Yje(e,t){e.contentAvailable&&e.contentVisibility(t)!==zt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var RP=wde;var FQn=_(T(),1);function Pde(){}var GP={stack:new Jc,stackMaximumLength:0},EP={stack:new Jc,stackMaximumLength:0};Pde.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(zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;zje(n,t),GP.stack.trim(GP.stackMaximumLength),EP.stack.trim(EP.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function WK(e,t){e.contentAvailable&&zs.selectTile(e,t)}function Hje(e,t,n){let i=e.refine===Bo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:l}=zs;for(let h=0;h<r.length;++h)s(r[h],n);r.sort(zs.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,f=!1,p=-1,y=Number.MAX_VALUE;for(let h=0;h<r.length;++h){let g=r[h];if(g.isVisible?(t.push(g),g._foveatedFactor<y&&(p=h,y=g._foveatedFactor),f=!0):(d||o.loadSiblings)&&(g._foveatedFactor<y&&(p=h,y=g._foveatedFactor),a(g,n),l(g,n)),d){let x;g._inRequestVolume?g.hasRenderableContent?x=g.contentAvailable:x=Kje(g,n):x=!1,u=u&&x}}if(f||(u=!1),p!==-1&&i){let h=r[p];h._wasMinPriorityChild=!0;let g=(e._wasMinPriorityChild||e===o.root)&&y<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;g._foveatedFactor=Math.min(h._foveatedFactor,g._foveatedFactor),g._distanceToCamera=Math.min(h._distanceToCamera,g._distanceToCamera);for(let x=0;x<r.length;++x)r[x]._priorityHolder=g}return u}function zje(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=zs,a=GP.stack;for(a.push(e);a.length>0;){GP.stackMaximumLength=Math.max(GP.stackMaximumLength,a.length);let l=a.pop(),d=l.parent,u=!c(d)||d._refines;l._refines=i(l)?Hje(l,a,t)&&u:!1;let f=!l._refines&&u;l.hasRenderableContent?l.refine===Bo.ADD?(WK(l,t),o(l,t)):l.refine===Bo.REPLACE&&(o(l,t),f&&WK(l,t)):(n._emptyTiles.push(l),o(l,t),f&&WK(l,t)),r(l,t),s(l,t)}}function Kje(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=zs,s=!0,a=EP.stack;for(a.push(e);a.length>0;){EP.stackMaximumLength=Math.max(EP.stackMaximumLength,a.length);let l=a.pop(),d=l.children,u=d.length,f=!l.hasRenderableContent&&n(l);if(!f&&!l.contentAvailable&&(s=!1),i(l,t),l.isVisible||(o(l,t),r(l,t)),f)for(let p=0;p<u;++p){let y=d[p];a.push(y)}}return e.hasEmptyContent||s}var XP=Pde;var OQn=_(T(),1);function vde(){}var IP={stack:new Jc,stackMaximumLength:0},WP={stack:new Jc,stackMaximumLength:0},Fb={stack:new Jc,stackMaximumLength:0,ancestorStack:new Jc,ancestorStackMaximumLength:0},Jje=2;vde.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(zs.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;t4e(n,t),n4e(n,t),IP.stack.trim(IP.stackMaximumLength),WP.stack.trim(WP.stackMaximumLength),Fb.stack.trim(Fb.stackMaximumLength),Fb.ancestorStack.trim(Fb.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Qje(e,t){let{updateTile:n,touchTile:i,selectTile:o}=zs,r=WP.stack;for(r.push(e);r.length>0;){WP.stackMaximumLength=Math.max(WP.stackMaximumLength,r.length);let a=r.pop().children;for(let l=0;l<a.length;++l){let d=a[l];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<Jje&&r.push(d))}}}function Gk(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;c(n)?n._shouldSelect=!0:Qje(e,t)}function jje(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!c(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function qje(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||c(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function $je(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=zs;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(zs.sortChildrenByDistanceToCamera);let l=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),l=!0):i.loadSiblings&&(s(u,n),a(u,n))}return l}function e4e(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:c(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function t4e(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}=zs,l=IP.stack;for(l.push(e);l.length>0;){IP.stackMaximumLength=Math.max(IP.stackMaximumLength,l.length);let d=l.pop();jje(d,t);let u=d.parent,f=!c(u)||u._refines;d._refines=o(d)?$je(d,l,t)&&f:!1;let p=!d._refines&&f;d.hasRenderableContent?d.refine===Bo.ADD?(Gk(d,t),r(d,t)):d.refine===Bo.REPLACE&&(e4e(d,i)?(r(d,t),p&&Gk(d,t)):p?(Gk(d,t),r(d,t)):qje(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&Gk(d,t)),s(d,t),a(d,t)}}function n4e(e,t){let{selectTile:n,canTraverse:i}=zs,{stack:o,ancestorStack:r}=Fb,s;for(o.push(e);o.length>0||r.length>0;){if(Fb.stackMaximumLength=Math.max(Fb.stackMaximumLength,o.length),Fb.ancestorStackMaximumLength=Math.max(Fb.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!c(a))continue;let l=i(a);if(a._shouldSelect)if(a.refine===Bo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!l){n(a,t);continue}r.push(a),a._stackLength=o.length}if(l){let d=a.children;for(let u=0;u<d.length;++u){let f=d[u];f.isVisible&&o.push(f)}}}}var wP=vde;function rr(e){e=e??z.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 TP,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 Jc,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024,C.typeOf.number.greaterThanOrEquals("cacheBytes",this._cacheBytes,0);let t=e.maximumCacheOverflowBytes??512*1024*1024;C.typeOf.number.greaterThanOrEquals("maximumCacheOverflowBytes",t,0),this._maximumCacheOverflowBytes=t,this._styleEngine=new VP,this._styleApplied=!1,this._modelMatrix=c(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new pf,this._statisticsLast=new pf,this._statisticsPerPass=new Array(Fo.NUMBER_OF_PASSES);for(let o=0;o<Fo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new pf;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 SP(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=w.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._ellipsoid=e.ellipsoid??re.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!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??w.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??Sn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Wl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Vh(e.pointCloudShading),this._pointCloudEyeDomeLighting=new lb,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye,this.tileLoad=new ye,this.tileUnload=new ye,this.tileFailed=new ye,this.tileVisible=new ye,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,c(e.clippingPlanes)&&hs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,c(e.clippingPolygons)&&qm.setOwner(e.clippingPolygons,this,"_clippingPolygons"),c(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new $x,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new sb(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??Y.BLACK,this.splitDirection=e.splitDirection??Ar.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&&ht("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(rr.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){hs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){qm.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Cs("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){C.typeOf.bool("value",e),this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!c(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){C.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){C.defined("pointCloudShading",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 c(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}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){C.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),C.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){C.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),C.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){C.typeOf.object("imageBasedLighting",this._imageBasedLighting),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,Dde(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),C.typeOf.string("value",e),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),C.typeOf.string("value",e),this._instanceFeatureIdLabel=e}}});rr.fromIonAssetId=async function(e,t){C.defined("assetId",e);let n=await xd.fromAssetId(e);return rr.fromUrl(n,t)};rr.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await rr.loadJson(n),r=await i4e(n,o),s=new rr(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,Dde(s);let l=c(o.asset.gltfUpAxis)?Po.fromName(o.asset.gltfUpAxis):Po.Y,d=t.modelUpAxis??l,u=t.modelForwardAxis??Po.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,M.IDENTITY).boundingSphere.center,y=s._ellipsoid.cartesianToCartographic(p);return c(y)&&y.height>ui._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=wt.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};rr.loadJson=function(e){return Ge.createIfNeeded(e).fetchJson()};rr.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};rr.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!c(i))throw new le("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new le("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");c(t.extensionsRequired)&&rr.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;c(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=Fde(this,e,t.root,n);c(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let l=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===Bo.ADD;let d=l._header.children;if(c(d))for(let u=0;u<d.length;++u){let f=d[u],p=Fde(this,e,f,l);l.children.push(p),p._depth=l._depth+1,a.push(p)}this._cullWithChildrenBounds&&gP.checkChildrenWithinParent(l)}return s};function Fde(e,t,n,i){if(!(c(n.implicitTiling)||ri(n,"3DTILES_implicit_tiling")))return new Ku(e,t,n,i);let r=e.schema,s=new Q_(t,n,r),a=new j_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),l=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=He(n,!0);u.contents=[{uri:l}],delete u.content,delete u.extensions;let f=new Ku(e,t,u,i);return f.implicitTileset=s,f.implicitCoordinates=a,f}async function i4e(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(c(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ri.getSchemaLoader({resource:e});else if(c(n.schema))i=Ri.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new K_({schema:i.schema,metadataJson:n});return Ri.unload(i),o}var Ade=new m,o4e=new pe,r4e=new M,s4e=new m,a4e=new m,c4e=new m,l4e=new m;function d4e(e,t){let n,i,o,r,s,a=t.camera,l=e._root,d=l.contentBoundingVolume;if(d instanceof Xd)n=m.normalize(a.positionWC,Ade),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let g=M.inverseTransformation(l.computedTransform,r4e),x=t.mapProjection.ellipsoid,S=d.boundingVolume,V=M.multiplyByPoint(g,S.center,s4e);if(m.magnitude(V)>x.minimumRadius){let Z=pe.fromCartesian(V,x,o4e);n=m.normalize(a.positionWC,Ade),i=a.directionWC,o=a.positionCartographic.height,r=0,s=Z.height*2}else{let Z=M.multiplyByPoint(g,a.positionWC,a4e);if(n=m.UNIT_Z,i=M.multiplyByPointAsVector(g,a.directionWC,c4e),i=m.normalize(i,i),o=Z.z,d instanceof Ol){let R=te.getColumn(S.halfAxes,2,l4e),E=m.magnitude(R);r=V.z-E,s=V.z+E}else if(d instanceof Wb){let R=S.radius;r=V.z-R,s=V.z+R}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,f=r+(s-r)*u,p=s,y=w.clamp((o-f)/(p-f),0,1),h=1-Math.abs(m.dot(i,n));h=h*(1-y),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*h}function u4e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();c(o)&&(o.then(r=>{!c(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{kde(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?L4e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Nde(e,t){return e._priority-t._priority}rr.prototype.postPassesUpdate=function(e){c(this._root)&&(m4e(this,e),R4e(this,e),this._cache.unloadTiles(this,Ode),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};rr.prototype.prePassesUpdate=function(e){if(!c(this._root))return;x4e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,c(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;c(n)&&n.enabled&&n.update(e),c(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time)),this._timeSinceLoad=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&d4e(this,e),e.newFrame&&this._cache.reset()};function m4e(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!==Ho.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function f4e(e){let t=e._requestedTiles;t.sort(Nde);for(let n=0;n<t.length;++n)u4e(e,t[n])}function kde(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=c(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 h4e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Ho.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var p4e=new pe,b4e=new pe,y4e=new m;function g4e(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=pe.clone(r.positionCartographic,p4e),l=pe.fromCartesian(o.center,s,b4e);c(l)&&(a.height=l.height);let d=pe.toCartesian(a,s,y4e);m.distance(d,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{c(r.callback)&&r.callback(),r.invoked=!1}))}}function x4e(e,t){h4e(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let l=0;l<n.length;++l){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[l];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,kde(u,e,d)}}e.totalMemoryUsageInBytes<i?T4e(e):a&&n.length>0&&_4e(e)}function _4e(e){ht("increase-screenSpaceError",`The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset.
    The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError).
    Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`),e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Nde)}function T4e(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Ek=new m,S4e={maximumFractionDigits:3};function Mde(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,S4e):Math.round(t).toLocaleString()}function wK(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=m.clone(i,Ek);if(c(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(c(n)){let r=m.normalize(i,Ek);r=m.multiplyByScalar(r,.75*n,Ek),o=m.add(r,i,Ek)}return o}function PK(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: ${Mde(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${Mde(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 C4e(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(c(e.debugPickedTile)){let s=c(e.debugPickPosition)?e.debugPickPosition:wK(e.debugPickedTile),a=PK(e.debugPickedTile,e,s);a.pixelOffset=new D(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];PK(a,e,wK(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&PK(a,e,wK(a))}}e._tileDebugLabels.update(t)}function V4e(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&&(c(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:Xe.CESIUM_3D_TILE,renderState:Oe.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:l,tileVisible:d}=e,u=n.isRender,f=i.length;for(let h=0;h<s.length;++h){let g=s[h];u&&d.raiseEvent(g),g4e(e,g,t),g.update(e,t,n),l.incrementSelectionCounts(g.content),++l.selected}let p=e._emptyTiles;for(let h=0;h<p.length;++h)p[h].update(e,t,n);let y=i.length-f;if(e._backfaceCommands.trim(),a){let h=e._backfaceCommands.values,g=h.length;i.length+=g;for(let x=y-1;x>=0;--x)i[f+g+x]=i[f+x];for(let x=0;x<g;++x)i[f+x]=h[x]}y=i.length-r,l.numberOfCommands=y,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&y>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(c(e._tileDebugLabels)||(e._tileDebugLabels=new Gh),C4e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var Ude=[];function L4e(e,t){let n=t,i=Ude;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&&(Z4e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Ode(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function Z4e(e,t){e._cache.unloadTile(e,t,Ode),t.destroy()}rr.prototype.trimLoadedTiles=function(){this._cache.trim()};function R4e(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;pf.clone(n,i);let l=o!==s||r!==a;l&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,l&&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 G4e(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 E4e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&c(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 X4e(e,t,n,i){if(t.mode===se.MORPHING||!c(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,G4e(e),E4e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&f4e(e),V4e(e,t,i),pf.clone(o,n),i.isRender){let s=e._credits;if(c(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let l=s[a];t.creditDisplay.addCreditToNextFrame(l)}}return r}function Dde(e){let t=e._credits;c(t)||(t=[]),t.length=0,c(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Ct.clone(i))});let n=e.asset.extras;if(c(n)&&c(n.cesium)&&c(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Ct(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}rr.prototype.getTraversal=function(e){let{pass:t}=e;return t===Fo.MOST_DETAILED_PRELOAD||t===Fo.MOST_DETAILED_PICK?RP:this.isSkippingLevelOfDetail?wP:XP};rr.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};rr.prototype.updateForPass=function(e,t){C.typeOf.object("frameState",e),C.typeOf.object("tilesetPassState",t);let n=t.pass;if(n===Fo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Fo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Fo.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=Fo.getPassOptions(n),a=s.ignoreCommands,l=t.commandList??i,d=l.length;if(e.commandList=l,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;c(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;c(u)&&u.enabled&&u.queueCommands(e);let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=X4e(this,e,f,s)),a&&(l.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};rr.prototype.hasExtension=function(e){return c(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};rr.prototype.isDestroyed=function(){return!1};rr.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(),c(this._root)){let e=Ude;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,he(this)};rr.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};rr.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!rr.supportedExtensions[e[t]])throw new le(`Unsupported 3D Tiles Extension: ${e[t]}`)};var I4e=new bn,W4e=new m,w4e=new pe;rr.prototype.getHeight=function(e,t){C.typeOf.object("cartographic",e),C.typeOf.object("scene",t);let n=t.ellipsoid;c(n)||(n=re.WGS84);let i=I4e,o=n.cartographicToCartesian(e,i.direction);m.normalize(i.direction,i.direction),i.direction=m.normalize(o,i.direction),i.direction=m.negate(o,i.direction),i.origin=m.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,W4e);if(c(r))return n.cartesianToCartographic(r,w4e)?.height};rr.prototype.updateHeight=function(e,t,n){n=n??re.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 P4e=new Ia,v4e=new m;rr.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let l=0;l<o;++l){let d=i[l],u=qn.raySphere(e,d.contentBoundingVolume.boundingSphere,P4e);!c(u)||!c(d.content)||r.push(d)}let s=r.length;r.sort((l,d)=>{let u=ue.distanceSquaredTo(l.contentBoundingVolume.boundingSphere,e.origin),f=ue.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-f});let a;for(let l=0;l<s;++l){let u=r[l].content.pick(e,t,v4e);if(c(u))return a=m.clone(u,n),a}};var bs=rr;var F4e=new M;function Dy(e,t){if(!c(e))throw new L("scene is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(Dy.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Zt,this._onCollectionChanged(t,t.values,[],[])}Dy.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),f;u&&(f=s.computeModelMatrix(e,F4e),l=Ge.createIfNeeded(J.getValueOrUndefined(a._uri,e)));let p=c(d)?d.tilesetPrimitive:void 0;if(!u){c(p)&&(p.show=!1);continue}(!c(d)||l.url!==d.url)&&(c(p)&&i.removeAndDestroy(p),delete n[s.id],A4e(l,n,s,i)),c(p)&&(p.show=!0,c(f)&&(p.modelMatrix=f),p.maximumScreenSpaceError=J.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Dy.prototype.isDestroyed=function(){return!1};Dy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Dy.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)vK(this,e[i],t,n);return he(this)};Dy.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._tilesetHash[e.id];if(!c(n)||n.loadFail)return ut.FAILED;let i=n.tilesetPrimitive;return c(i)?i.show?(ue.clone(i.boundingSphere,t),ut.DONE):ut.FAILED:ut.PENDING};Dy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._tileset)?s.set(r.id,r):(vK(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],vK(this,r,a,l),s.remove(r.id)};function vK(e,t,n,i){let o=n[t.id];c(o)&&(c(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function A4e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await bs.fromUrl(e);if(o.id=n,i.add(o),!c(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var PP=Dy;var S4n=_(T(),1);var M4e=Y.WHITE,N4e=Y.BLACK,k4e=new D(2,2);function E1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(E1.prototype,{isConstant:{get:function(){return J.isConstant(this._evenColor)&&J.isConstant(this._oddColor)&&J.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:fe("evenColor"),oddColor:fe("oddColor"),repeat:fe("repeat")});E1.prototype.getType=function(e){return"Checkerboard"};var U4e=new ee;E1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(U4e)),c(t)||(t={}),t.lightColor=J.getValueOrClonedDefault(this._evenColor,e,M4e,t.lightColor),t.darkColor=J.getValueOrClonedDefault(this._oddColor,e,N4e,t.darkColor),t.repeat=J.getValueOrDefault(this._repeat,e,k4e),t};E1.prototype.equals=function(e){return this===e||e instanceof E1&&J.equals(this._evenColor,e._evenColor)&&J.equals(this._oddColor,e._oddColor)&&J.equals(this._repeat,e._repeat)};var X1=E1;var U4n=_(T(),1);var w4n=_(T(),1);var Bde={id:void 0};function vP(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 _c(e){this._owner=e,this._entities=new Zt,this._addedEntities=new Zt,this._removedEntities=new Zt,this._changedEntities=new Zt,this._suspendCount=0,this._collectionChanged=new ye,this._id=Hn(),this._show=!0,this._firing=!1,this._refire=!1}_c.prototype.suspendEvents=function(){this._suspendCount++};_c.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new L("resumeEvents can not be called before suspendEvents.");this._suspendCount--,vP(this)};Object.defineProperties(_c.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(!c(e))throw new L("value is required.");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}}});_c.prototype.computeAvailability=function(){let e=Ye.MAXIMUM_VALUE,t=Ye.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(c(s)){let a=s.start,l=s.stop;ee.lessThan(a,e)&&!a.equals(Ye.MINIMUM_VALUE)&&(e=a),ee.greaterThan(l,t)&&!l.equals(Ye.MAXIMUM_VALUE)&&(t=l)}}return Ye.MAXIMUM_VALUE.equals(e)&&(e=Ye.MINIMUM_VALUE),Ye.MINIMUM_VALUE.equals(t)&&(t=Ye.MAXIMUM_VALUE),new Zn({start:e,stop:t})};_c.prototype.add=function(e){if(!c(e))throw new L("entity is required.");e instanceof $o||(e=new $o(e));let t=e.id,n=this._entities;if(n.contains(t))throw new L(`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(_c.prototype._onEntityDefinitionChanged,this),vP(this),e};_c.prototype.remove=function(e){return c(e)?this.removeById(e.id):!1};_c.prototype.contains=function(e){if(!c(e))throw new L("entity is required");return this._entities.get(e.id)===e};_c.prototype.removeById=function(e){if(!c(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(_c.prototype._onEntityDefinitionChanged,this),vP(this),!0):!1};_c.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,l=i.get(a);c(l)||(s.definitionChanged.removeEventListener(_c.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),vP(this)};_c.prototype.getById=function(e){if(!c(e))throw new L("id is required.");return this._entities.get(e)};_c.prototype.getOrCreateEntity=function(e){if(!c(e))throw new L("id is required.");let t=this._entities.get(e);return c(t)||(Bde.id=e,t=new $o(Bde),this.add(t)),t};_c.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),vP(this)};var Ks=_c;var Xk={id:void 0},I1=new Array(2);function FK(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 Yde(e,t,n,i){I1[0]=n,I1[1]=i.id,t[JSON.stringify(I1)]=i.definitionChanged.addEventListener(Dr.prototype._onDefinitionChanged,e)}function Hde(e,t,n,i){I1[0]=n,I1[1]=i.id;let o=JSON.stringify(I1);t[o](),t[o]=void 0}function By(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,l,d,u=e._composite,f=new Ks(e),p=e._eventHash,y;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Dr.prototype._onCollectionChanged,e),a=d.values,y=d.id,l=a.length-1;l>-1;l--)s=a[l],Hde(e,p,y,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Dr.prototype._onCollectionChanged,e),a=d.values,y=d.id,l=a.length-1;l>-1;l--){s=a[l],Yde(e,p,y,s);let g=f.getById(s.id);c(g)||(g=u.getById(s.id),c(g)?FK(g):(Xk.id=s.id,g=new $o(Xk)),f.add(g)),g.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let h=f.values;for(r=0;r<h.length;r++)u.add(h[r]);u.resumeEvents()}function Dr(e,t){this._owner=t,this._composite=new Ks(this),this._suspendCount=0,this._collections=c(e)?e.slice():[],this._collectionsCopy=[],this._id=Hn(),this._eventHash={},By(this),this._shouldRecomposite=!1}Object.defineProperties(Dr.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}}});Dr.prototype.addCollection=function(e,t){let n=c(t);if(!c(e))throw new L("collection is required.");if(n){if(t<0)throw new L("index must be greater than or equal to zero.");if(t>this._collections.length)throw new L("index must be less than or equal to the number of collections.")}n?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),By(this)};Dr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),By(this),!0):!1};Dr.prototype.removeAllCollections=function(){this._collections.length=0,By(this)};Dr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Dr.prototype.contains=function(e){return this._composite.contains(e)};Dr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Dr.prototype.getCollection=function(e){if(!c(e))throw new L("index is required.","index");return this._collections[e]};Dr.prototype.getCollectionsLength=function(){return this._collections.length};function Ik(e,t){if(!c(t))throw new L("collection is required.");let n=e.indexOf(t);if(n===-1)throw new L("collection is not in this composite.");return n}function zde(e,t,n){let i=e._collections;if(t=w.clamp(t,0,i.length-1),n=w.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,By(e)}Dr.prototype.raiseCollection=function(e){let t=Ik(this._collections,e);zde(this,t,t+1)};Dr.prototype.lowerCollection=function(e){let t=Ik(this._collections,e);zde(this,t,t-1)};Dr.prototype.raiseCollectionToTop=function(e){let t=Ik(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),By(this))};Dr.prototype.lowerCollectionToBottom=function(e){let t=Ik(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),By(this))};Dr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Dr.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new L("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(By(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Dr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Dr.prototype.getById=function(e){return this._composite.getById(e)};Dr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,l,d,u=n.length,f=this._eventHash,p=e.id;for(s=0;s<u;s++){let h=n[s];Hde(this,f,p,h);let g=h.id;for(a=o-1;a>=0;a--)l=i[a].getById(g),c(l)&&(c(d)||(d=r.getById(g),FK(d)),d.merge(l));c(d)||r.removeById(g),d=void 0}let y=t.length;for(s=0;s<y;s++){let h=t[s];Yde(this,f,p,h);let g=h.id;for(a=o-1;a>=0;a--)l=i[a].getById(g),c(l)&&(c(d)||(d=r.getById(g),c(d)?FK(d):(Xk.id=g,d=new $o(Xk),r.add(d))),d.merge(l));d=void 0}r.resumeEvents()};Dr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,l=r.getById(a),d=l[t],u=!c(d),f=!0;for(let p=s-1;p>=0;p--){let y=o[p].getById(e.id);if(c(y)){let h=y[t];if(c(h)){if(f)if(f=!1,c(h.merge)&&c(h.clone))d=h.clone(d);else{d=h;break}d.merge(h)}}}u&&l.propertyNames.indexOf(t)===-1&&l.addProperty(t),l[t]=d};var AK=Dr;var x8n=_(T(),1);var u8n=_(T(),1);var Y4n=_(T(),1);function MK(){this._removalFunctions=[]}MK.prototype.add=function(e,t,n){if(!c(e))throw new L("event is required");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)}};MK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var hr=MK;var i8n=_(T(),1);function UK(e,t){return ee.compare(e.start,t.start)}function Br(e){if(this._intervals=[],this._changedEvent=new ye,c(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Br.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}}});Br.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Br))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(!Zn.equals(n[r],i[r],t))return!1;return!0};Br.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._intervals[e]};Br.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Br.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Br.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Br.prototype.contains=function(e){return this.indexOf(e)>=0};var NK=new Zn;Br.prototype.indexOf=function(e){if(!c(e))throw new L("date is required");let t=this._intervals;NK.start=e,NK.stop=e;let n=Wo(t,NK,UK);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&&Zn.contains(t[n-1],e)?n-1:~n)};Br.prototype.findInterval=function(e){e=e??z.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 l=r[s];if((!c(t)||l.start.equals(t))&&(!c(n)||l.stop.equals(n))&&(!c(i)||l.isStartIncluded===i)&&(!c(o)||l.isStopIncluded===o))return r[s]}};Br.prototype.addInterval=function(e,t){if(!c(e))throw new L("interval is required");if(e.isEmpty)return;let n=this._intervals;if(n.length===0||ee.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Wo(n,e,UK);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=ee.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((c(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(ee.greaterThan(e.stop,n[i-1].stop)?e=new Zn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Zn({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=ee.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Zn({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 Zn({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=ee.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(c(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Zn({start:e.start,stop:ee.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:ee.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Zn({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)};Br.prototype.removeInterval=function(e){if(!c(e))throw new L("interval is required");if(e.isEmpty)return!1;let t=this._intervals,n=Wo(t,e,UK);n<0&&(n=~n);let i=!1;for(n>0&&(ee.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(ee.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 Zn({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 Zn({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 Zn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&ee.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 Zn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Zn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(ee.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Zn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Br.prototype.intersect=function(e,t,n){if(!c(e))throw new L("other is required.");let i=new Br,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let l=s[o],d=a[r];if(ee.lessThan(l.stop,d.start))++o;else if(ee.lessThan(d.stop,l.start))++r;else{if(c(n)||c(t)&&t(l.data,d.data)||!c(t)&&d.data===l.data){let u=Zn.intersect(l,d,new Zn,n);u.isEmpty||i.addInterval(u,t)}ee.lessThan(l.stop,d.stop)||l.stop.equals(d.stop)&&!l.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};Br.fromJulianDateArray=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.julianDates))throw new L("options.iso8601Array is required.");c(t)||(t=new Br);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,l=e.trailingInterval??!1,d,u=0;a&&(++u,d=new Zn({start:Ye.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=c(o)?o(d,t.length):t.length,t.addInterval(d));for(let f=0;f<i-1;++f){let p=n[f],y=n[f+1];d=new Zn({start:p,stop:y,isStartIncluded:t.length===u?r:!0,isStopIncluded:f===i-2?s:!1}),d.data=c(o)?o(d,t.length):t.length,t.addInterval(d),p=y}return l&&(d=new Zn({start:n[i-1],stop:Ye.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=c(o)?o(d,t.length):t.length,t.addInterval(d)),t};var Tc=new eh,FP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function kK(e,t,n){c(n)||(n=new ee),ee.toGregorianDate(e,Tc);let i=Tc.millisecond+t.millisecond,o=Tc.second+t.second,r=Tc.minute+t.minute,s=Tc.hour+t.hour,a=Tc.day+t.day,l=Tc.month+t.month,d=Tc.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),FP[2]=Lm(d)?29:28;a>FP[l]||l>=13;)a>FP[l]&&(a-=FP[l],++l),l>=13&&(--l,d+=Math.floor(l/12),l=l%12,++l),FP[2]=Lm(d)?29:28;return Tc.millisecond=i,Tc.second=o,Tc.minute=r,Tc.hour=s,Tc.day=a,Tc.month=l,Tc.year=d,ee.fromGregorianDate(Tc,n)}var O4e=new ee,D4e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Kde(e,t){if(!c(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(D4e);if(!c(n))return!1;if(c(n[1])&&(t.year=Number(n[1].replace(",","."))),c(n[2])&&(t.month=Number(n[2].replace(",","."))),c(n[3])&&(t.day=Number(n[3].replace(",","."))*7),c(n[4])&&(t.day+=Number(n[4].replace(",","."))),c(n[5])&&(t.hour=Number(n[5].replace(",","."))),c(n[6])&&(t.minute=Number(n[6].replace(",","."))),c(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"),ee.toGregorianDate(ee.fromIso8601(e,O4e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var AP=new eh;Br.fromIso8601=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.iso8601))throw new L("options.iso8601 is required.");let n=e.iso8601.split("/"),i=ee.fromIso8601(n[0]),o=ee.fromIso8601(n[1]),r=[];if(!Kde(n[2],AP))r.push(i,o);else{let s=ee.clone(i);for(r.push(s);ee.compare(s,o)<0;)s=kK(s,AP),ee.compare(o,s)<=0&&ee.clone(o,s),r.push(s)}return Br.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Br.fromIso8601DateArray=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.iso8601Dates))throw new L("options.iso8601Dates is required.");return Br.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return ee.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Br.fromIso8601DurationArray=function(e,t){if(!c(e))throw new L("options is required.");if(!c(e.epoch))throw new L("options.epoch is required.");if(!c(e.iso8601Durations))throw new L("options.iso8601Durations is required.");let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,l=i.length;for(let d=0;d<l;++d)(Kde(i[d],AP)||d===0)&&(o&&c(a)?s=kK(a,AP):s=kK(n,AP),r.push(s),a=s);return Br.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Yr=Br;function B4e(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 l=i.get(a);c(l.data)&&r.indexOf(l.data)===-1&&t.add(l.data.definitionChanged,o)}}function q_(){this._eventHelper=new hr,this._definitionChanged=new ye,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(q_.prototype._intervalsChanged,this)}Object.defineProperties(q_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Y4e=new ee;q_.prototype.getValue=function(e,t){c(e)||(e=ee.now(Y4e));let n=this._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};q_.prototype.equals=function(e){return this===e||e instanceof q_&&this._intervals.equals(e._intervals,J.equals)};q_.prototype._intervalsChanged=function(){B4e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Sc=q_;function Yy(){this._definitionChanged=new ye,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Yy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Yy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Yy.prototype.getType=function(e){if(!c(e))throw new L("time is required");let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(t))return t.getType(e)};var H4e=new ee;Yy.prototype.getValue=function(e,t){c(e)||(e=ee.now(H4e));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};Yy.prototype.equals=function(e){return this===e||e instanceof Yy&&this._composite.equals(e._composite,J.equals)};Yy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var W1=Yy;var G8n=_(T(),1);function Hy(e){this._referenceFrame=e??Ui.FIXED,this._definitionChanged=new ye,this._composite=new Sc,this._composite.definitionChanged.addEventListener(Hy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Hy.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 z4e=new ee;Hy.prototype.getValue=function(e,t){return c(e)||(e=ee.now(z4e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Hy.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(i))return i.getValueInReferenceFrame(e,t,n)};Hy.prototype.equals=function(e){return this===e||e instanceof Hy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,J.equals)};Hy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ya=Hy;var G6n=_(T(),1);var V7n=_(T(),1);var X8n=_(T(),1),K4e={ROUNDED:0,MITERED:1,BEVELED:2},Fi=Object.freeze(K4e);var t7n=_(T(),1);var Y8n=_(T(),1);var ga=[new m,new m],J4e=new m,Q4e=new m,j4e=new m,q4e=new m,$4e=new m,e8e=new m,t8e=new m,n8e=new m,i8e=new m,w1=new m,Wk=new m,MP={},OK=new pe;function o8e(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];OK=t.cartesianToCartographic(o,OK),n[i]=OK.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function DK(e,t,n,i){let o=e[0],r=e[1],s=m.angleBetween(o,r),a=Math.ceil(s/i),l=new Array(a),d;if(t===n){for(d=0;d<a;d++)l[d]=t;return l.push(n),l}let f=(n-t)/a;for(d=1;d<a;d++){let p=t+d*f;l[d]=p}return l[0]=t,l.push(n),l}var wk=new m,Pk=new m;function r8e(e,t,n,i){let o=new $r(n,i),r=o.projectPointOntoPlane(m.add(n,e,wk),wk),s=o.projectPointOntoPlane(m.add(n,t,Pk),Pk),a=D.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var s8e=new m(-1,0,0),$_=new M,a8e=new M,BK=new te,c8e=te.IDENTITY.clone(),l8e=new m,d8e=new ce,Jde=new m;function Ab(e,t,n,i,o,r,s,a){let l=l8e,d=d8e;$_=wt.eastNorthUpToFixedFrame(e,o,$_),l=M.multiplyByPointAsVector($_,s8e,l),l=m.normalize(l,l);let u=r8e(l,t,e,o);BK=te.fromRotationZ(u,BK),Jde.z=r,$_=M.multiplyTransformation($_,M.fromRotationTranslation(BK,Jde,a8e),$_);let f=c8e;f[0]=s;for(let p=0;p<a;p++)for(let y=0;y<n.length;y+=3)d=m.fromArray(n,y,d),d=te.multiplyByVector(f,d,d),d=M.multiplyByPoint($_,d,d),i.push(d.x,d.y,d.z);return i}var u8e=new m;function YK(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let l=m.fromArray(e,a,u8e);i=Ab(l,t,n,i,o,r[a/3],s,1)}return i}function m8e(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 l=1;l<n;l++){a=e[l];let d=a.x-r,u=a.y-s;i[o++]=d,i[o++]=0,i[o++]=u,i[o++]=d,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Qde(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 jde=new Fe,qde=new m,$de=new te;function eue(e,t,n,i,o,r,s,a,l,d){let u=m.angleBetween(m.subtract(t,e,w1),m.subtract(n,e,Wk)),f=i===Fi.BEVELED?0:Math.ceil(u/w.toRadians(5)),p;o?p=te.fromQuaternion(Fe.fromAxisAngle(m.negate(e,w1),u/(f+1),jde),$de):p=te.fromQuaternion(Fe.fromAxisAngle(e,u/(f+1),jde),$de);let y,h;if(t=m.clone(t,qde),f>0){let g=d?2:1;for(let x=0;x<f;x++)t=te.multiplyByVector(p,t,t),y=m.subtract(t,e,w1),y=m.normalize(y,y),o||(y=m.negate(y,y)),h=r.scaleToGeodeticSurface(t,Wk),s=Ab(h,y,a,s,r,l,1,g)}else y=m.subtract(t,e,w1),y=m.normalize(y,y),o||(y=m.negate(y,y)),h=r.scaleToGeodeticSurface(t,Wk),s=Ab(h,y,a,s,r,l,1,1),n=m.clone(n,qde),y=m.subtract(n,e,w1),y=m.normalize(y,y),o||(y=m.negate(y,y)),h=r.scaleToGeodeticSurface(n,Wk),s=Ab(h,y,a,s,r,l,1,1);return s}MP.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];D.equals(r,s)||n.push(s)}return n};MP.angleIsGreaterThanPi=function(e,t,n,i){let o=new $r(n,i),r=o.projectPointOntoPlane(m.add(n,e,wk),wk),s=o.projectPointOntoPlane(m.add(n,t,Pk),Pk);return s.x*r.y-s.y*r.x>=0};var f8e=new m,h8e=new m;MP.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=o8e(e,r),a=i._granularity,l=i._cornerType,d=o?m8e(t,n):Qde(t,n),u=o?Qde(t,n):void 0,f=n.height/2,p=n.width/2,y=e.length,h=[],g=o?[]:void 0,x=J4e,S=Q4e,V=j4e,Z=q4e,R=$4e,E=e8e,I=t8e,v=n8e,P=i8e,F=e[0],N=e[1];Z=r.geodeticSurfaceNormal(F,Z),x=m.subtract(N,F,x),x=m.normalize(x,x),v=m.cross(Z,x,v),v=m.normalize(v,v);let b=s[0],G=s[1];o&&(g=Ab(F,v,u,g,r,b+f,1,1)),P=m.clone(F,P),F=N,S=m.negate(x,S);let X,W;for(let B=1;B<y-1;B++){let O=o?2:1;if(N=e[B+1],F.equals(N)){ht("Positions are too close and are considered equivalent with rounding error.");continue}x=m.subtract(N,F,x),x=m.normalize(x,x),Z=r.geodeticSurfaceNormal(F,Z);let H=m.multiplyByScalar(Z,m.dot(x,Z),f8e);m.subtract(x,H,H),m.normalize(H,H);let U=m.multiplyByScalar(Z,m.dot(S,Z),h8e);if(m.subtract(S,U,U),m.normalize(U,U),!w.equalsEpsilon(Math.abs(m.dot(H,U)),1,w.EPSILON7)){V=m.add(x,S,V),V=m.normalize(V,V),V=m.cross(V,Z,V),V=m.cross(Z,V,V),V=m.normalize(V,V);let Q=1/Math.max(.25,m.magnitude(m.cross(V,S,w1))),ie=MP.angleIsGreaterThanPi(x,S,F,r);ie?(R=m.add(F,m.multiplyByScalar(V,Q*p,V),R),E=m.add(R,m.multiplyByScalar(v,p,E),E),ga[0]=m.clone(P,ga[0]),ga[1]=m.clone(E,ga[1]),X=DK(ga,b+f,G+f,a),W=vi.generateArc({positions:ga,granularity:a,ellipsoid:r}),h=YK(W,v,d,h,r,X,1),v=m.cross(Z,x,v),v=m.normalize(v,v),I=m.add(R,m.multiplyByScalar(v,p,I),I),l===Fi.ROUNDED||l===Fi.BEVELED?eue(R,E,I,l,ie,r,h,d,G+f,o):(V=m.negate(V,V),h=Ab(F,V,d,h,r,G+f,Q,O)),P=m.clone(I,P)):(R=m.add(F,m.multiplyByScalar(V,Q*p,V),R),E=m.add(R,m.multiplyByScalar(v,-p,E),E),ga[0]=m.clone(P,ga[0]),ga[1]=m.clone(E,ga[1]),X=DK(ga,b+f,G+f,a),W=vi.generateArc({positions:ga,granularity:a,ellipsoid:r}),h=YK(W,v,d,h,r,X,1),v=m.cross(Z,x,v),v=m.normalize(v,v),I=m.add(R,m.multiplyByScalar(v,-p,I),I),l===Fi.ROUNDED||l===Fi.BEVELED?eue(R,E,I,l,ie,r,h,d,G+f,o):h=Ab(F,V,d,h,r,G+f,Q,O),P=m.clone(I,P)),S=m.negate(x,S)}else h=Ab(P,v,d,h,r,b+f,1,1),P=F;b=G,G=s[B+1],F=N}ga[0]=m.clone(P,ga[0]),ga[1]=m.clone(F,ga[1]),X=DK(ga,b+f,G+f,a),W=vi.generateArc({positions:ga,granularity:a,ellipsoid:r}),h=YK(W,v,d,h,r,X,1),o&&(g=Ab(F,v,u,g,r,G+f,1,1)),y=h.length;let A=o?y+g.length:y,k=new Float64Array(A);return k.set(h),o&&k.set(g,y),k};var bf=MP;var zK={},P1=new m,rue=new m,p8e=new m,tue=new m,nl=[new m,new m],sue=new m,aue=new m,cue=new m,b8e=new m,y8e=new m,g8e=new m,x8e=new m,_8e=new m,T8e=new m,S8e=new m,nue=new Fe,iue=new te;function vk(e,t,n,i,o){let r=m.angleBetween(m.subtract(t,e,P1),m.subtract(n,e,rue)),s=i===Fi.BEVELED?1:Math.ceil(r/w.toRadians(5))+1,a=s*3,l=new Array(a);l[a-3]=n.x,l[a-2]=n.y,l[a-1]=n.z;let d;o?d=te.fromQuaternion(Fe.fromAxisAngle(m.negate(e,P1),r/s,nue),iue):d=te.fromQuaternion(Fe.fromAxisAngle(e,r/s,nue),iue);let u=0;t=m.clone(t,P1);for(let f=0;f<s;f++)t=te.multiplyByVector(d,t,t),l[u++]=t.x,l[u++]=t.y,l[u++]=t.z;return l}function C8e(e){let t=sue,n=aue,i=cue,o=e[1];n=m.fromArray(e[1],o.length-3,n),i=m.fromArray(e[0],0,i),t=m.midpoint(n,i,t);let r=vk(t,n,i,Fi.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=m.fromArray(a,a.length-3,n),i=m.fromArray(o,0,i),t=m.midpoint(n,i,t);let l=vk(t,n,i,Fi.ROUNDED,!1);return[r,l]}function oue(e,t,n,i){let o=P1;return i?o=m.add(e,t,o):(t=m.negate(t,t),o=m.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function HK(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=m.multiplyByScalar(t,n,P1),a=m.negate(s,rue),l=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let f=m.fromArray(e,u,p8e),p=m.add(f,a,tue);o[l++]=p.x,o[l++]=p.y,o[l++]=p.z;let y=m.add(f,s,tue);r[d--]=y.z,r[d--]=y.y,r[d--]=y.x}return i.push(o,r),i}zK.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;c(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),c(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var V8e=new m,L8e=new m;zK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=sue,l=aue,d=cue,u=b8e,f=y8e,p=g8e,y=x8e,h=_8e,g=T8e,x=S8e,S=[],V=s?[]:void 0,Z=s?[]:void 0,R=n[0],E=n[1];l=m.normalize(m.subtract(E,R,l),l),a=i.geodeticSurfaceNormal(R,a),u=m.normalize(m.cross(a,l,u),u),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z)),y=m.clone(R,y),R=E,d=m.negate(l,d);let I,v=[],P,F=n.length;for(P=1;P<F-1;P++){a=i.geodeticSurfaceNormal(R,a),E=n[P+1],l=m.normalize(m.subtract(E,R,l),l);let b=m.multiplyByScalar(a,m.dot(l,a),V8e);m.subtract(l,b,b),m.normalize(b,b);let G=m.multiplyByScalar(a,m.dot(d,a),L8e);if(m.subtract(d,G,G),m.normalize(G,G),!w.equalsEpsilon(Math.abs(m.dot(b,G)),1,w.EPSILON7)){f=m.normalize(m.add(l,d,f),f),f=m.cross(f,a,f),f=m.cross(a,f,f),f=m.normalize(f,f);let W=o/Math.max(.25,m.magnitude(m.cross(f,d,P1))),A=bf.angleIsGreaterThanPi(l,d,R,i);f=m.multiplyByScalar(f,W,f),A?(h=m.add(R,f,h),x=m.add(h,m.multiplyByScalar(u,o,x),x),g=m.add(h,m.multiplyByScalar(u,o*2,g),g),nl[0]=m.clone(y,nl[0]),nl[1]=m.clone(x,nl[1]),I=vi.generateArc({positions:nl,granularity:t,ellipsoid:i}),S=HK(I,u,o,S),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z)),p=m.clone(g,p),u=m.normalize(m.cross(a,l,u),u),g=m.add(h,m.multiplyByScalar(u,o*2,g),g),y=m.add(h,m.multiplyByScalar(u,o,y),y),r===Fi.ROUNDED||r===Fi.BEVELED?v.push({leftPositions:vk(h,p,g,r,A)}):v.push({leftPositions:oue(R,m.negate(f,f),g,A)})):(g=m.add(R,f,g),x=m.add(g,m.negate(m.multiplyByScalar(u,o,x),x),x),h=m.add(g,m.negate(m.multiplyByScalar(u,o*2,h),h),h),nl[0]=m.clone(y,nl[0]),nl[1]=m.clone(x,nl[1]),I=vi.generateArc({positions:nl,granularity:t,ellipsoid:i}),S=HK(I,u,o,S),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z)),p=m.clone(h,p),u=m.normalize(m.cross(a,l,u),u),h=m.add(g,m.negate(m.multiplyByScalar(u,o*2,h),h),h),y=m.add(g,m.negate(m.multiplyByScalar(u,o,y),y),y),r===Fi.ROUNDED||r===Fi.BEVELED?v.push({rightPositions:vk(g,p,h,r,A)}):v.push({rightPositions:oue(R,f,h,A)})),d=m.negate(l,d)}R=E}a=i.geodeticSurfaceNormal(R,a),nl[0]=m.clone(y,nl[0]),nl[1]=m.clone(R,nl[1]),I=vi.generateArc({positions:nl,granularity:t,ellipsoid:i}),S=HK(I,u,o,S),s&&(V.push(u.x,u.y,u.z),Z.push(a.x,a.y,a.z));let N;return r===Fi.ROUNDED&&(N=C8e(S)),{positions:S,corners:v,lefts:V,normals:Z,endPositions:N}};var Bi=zK;var uue=new m,mue=new m,Fk=new m,Ak=new m,Z8e=new m,fue=new m,zy=new m,v1=new m;function hue(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function yf(e,t,n,i,o,r){let s=e.normals,a=e.tangents,l=e.bitangents,d=m.normalize(m.cross(n,t,zy),zy);r.normal&&Bi.addAttribute(s,t,i,o),r.tangent&&Bi.addAttribute(a,d,i,o),r.bitangent&&Bi.addAttribute(l,n,i,o)}function pue(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,l=new fn,d,u=0,f=0,p,y=0,h;for(p=0;p<i.length;p+=2)h=i[p].length-3,u+=h,y+=h*2,f+=i[p+1].length-3;for(u+=3,f+=3,p=0;p<o.length;p++){d=o[p];let ne=o[p].leftPositions;c(ne)?(h=ne.length,u+=h,y+=h):(h=o[p].rightPositions.length,f+=h,y+=h)}let g=c(r),x;g&&(x=r[0].length-3,u+=x,f+=x,x/=3,y+=x*6);let S=u+f,V=new Float64Array(S),Z=t.normal?new Float32Array(S):void 0,R=t.tangent?new Float32Array(S):void 0,E=t.bitangent?new Float32Array(S):void 0,I={normals:Z,tangents:R,bitangents:E},v=0,P=S-1,F,N,b,G,X=uue,W=mue,A,k,B=x/2,O=Me.createTypedArray(S/3,y),H=0;if(g){k=Fk,A=Ak;let ne=r[0];for(X=m.fromArray(a,0,X),W=m.fromArray(s,0,W),p=0;p<B;p++)k=m.fromArray(ne,(B-1-p)*3,k),A=m.fromArray(ne,(B+p)*3,A),Bi.addAttribute(V,A,v),Bi.addAttribute(V,k,void 0,P),yf(I,X,W,v,P,t),N=v/3,G=N+1,F=(P-2)/3,b=F-1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3}let U=0,K=0,Q=i[U++],ie=i[U++];V.set(Q,v),V.set(ie,P-ie.length+1),W=m.fromArray(s,K,W);let j,$;for(h=ie.length-3,p=0;p<h;p+=3)j=n.geodeticSurfaceNormal(m.fromArray(Q,p,zy),zy),$=n.geodeticSurfaceNormal(m.fromArray(ie,h-p,v1),v1),X=m.normalize(m.add(j,$,X),X),yf(I,X,W,v,P,t),N=v/3,G=N+1,F=(P-2)/3,b=F-1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3;for(j=n.geodeticSurfaceNormal(m.fromArray(Q,h,zy),zy),$=n.geodeticSurfaceNormal(m.fromArray(ie,h,v1),v1),X=m.normalize(m.add(j,$,X),X),K+=3,p=0;p<o.length;p++){let ne;d=o[p];let be=d.leftPositions,Ce=d.rightPositions,me,_e,Ve=fue,Ie=Fk,Ze=Ak;if(X=m.fromArray(a,K,X),c(be)){for(yf(I,X,W,void 0,P,t),P-=3,me=G,_e=b,ne=0;ne<be.length/3;ne++)Ve=m.fromArray(be,ne*3,Ve),O[H++]=me,O[H++]=_e-ne-1,O[H++]=_e-ne,Bi.addAttribute(V,Ve,void 0,P),Ie=m.fromArray(V,(_e-ne-1)*3,Ie),Ze=m.fromArray(V,me*3,Ze),W=m.normalize(m.subtract(Ie,Ze,W),W),yf(I,X,W,void 0,P,t),P-=3;Ve=m.fromArray(V,me*3,Ve),Ie=m.subtract(m.fromArray(V,_e*3,Ie),Ve,Ie),Ze=m.subtract(m.fromArray(V,(_e-ne)*3,Ze),Ve,Ze),W=m.normalize(m.add(Ie,Ze,W),W),yf(I,X,W,v,void 0,t),v+=3}else{for(yf(I,X,W,v,void 0,t),v+=3,me=b,_e=G,ne=0;ne<Ce.length/3;ne++)Ve=m.fromArray(Ce,ne*3,Ve),O[H++]=me,O[H++]=_e+ne,O[H++]=_e+ne+1,Bi.addAttribute(V,Ve,v),Ie=m.fromArray(V,me*3,Ie),Ze=m.fromArray(V,(_e+ne)*3,Ze),W=m.normalize(m.subtract(Ie,Ze,W),W),yf(I,X,W,v,void 0,t),v+=3;Ve=m.fromArray(V,me*3,Ve),Ie=m.subtract(m.fromArray(V,(_e+ne)*3,Ie),Ve,Ie),Ze=m.subtract(m.fromArray(V,_e*3,Ze),Ve,Ze),W=m.normalize(m.negate(m.add(Ze,Ie,W),W),W),yf(I,X,W,void 0,P,t),P-=3}for(Q=i[U++],ie=i[U++],Q.splice(0,3),ie.splice(ie.length-3,3),V.set(Q,v),V.set(ie,P-ie.length+1),h=ie.length-3,K+=3,W=m.fromArray(s,K,W),ne=0;ne<ie.length;ne+=3)j=n.geodeticSurfaceNormal(m.fromArray(Q,ne,zy),zy),$=n.geodeticSurfaceNormal(m.fromArray(ie,h-ne,v1),v1),X=m.normalize(m.add(j,$,X),X),yf(I,X,W,v,P,t),G=v/3,N=G-1,b=(P-2)/3,F=b+1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3;v-=3,P+=3}if(X=m.fromArray(a,a.length-3,X),yf(I,X,W,v,P,t),g){v+=3,P-=3,k=Fk,A=Ak;let ne=r[1];for(p=0;p<B;p++)k=m.fromArray(ne,(x-p-1)*3,k),A=m.fromArray(ne,p*3,A),Bi.addAttribute(V,k,void 0,P),Bi.addAttribute(V,A,v),yf(I,X,W,v,P,t),G=v/3,N=G-1,b=(P-2)/3,F=b+1,O[H++]=F,O[H++]=N,O[H++]=b,O[H++]=b,O[H++]=N,O[H++]=G,v+=3,P-=3}if(l.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:V}),t.st){let ne=new Float32Array(S/3*2),be,Ce,me=0;if(g){u/=3,f/=3;let _e=Math.PI/(x+1);Ce=1/(u-x+1),be=1/(f-x+1);let Ve,Ie=x/2;for(p=Ie+1;p<x+1;p++)Ve=w.PI_OVER_TWO+_e*p,ne[me++]=be*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve));for(p=1;p<f-x+1;p++)ne[me++]=p*be,ne[me++]=0;for(p=x;p>Ie;p--)Ve=w.PI_OVER_TWO-p*_e,ne[me++]=1-be*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve));for(p=Ie;p>0;p--)Ve=w.PI_OVER_TWO-_e*p,ne[me++]=1-Ce*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve));for(p=u-x;p>0;p--)ne[me++]=p*Ce,ne[me++]=1;for(p=1;p<Ie+1;p++)Ve=w.PI_OVER_TWO+_e*p,ne[me++]=Ce*(1+Math.cos(Ve)),ne[me++]=.5*(1+Math.sin(Ve))}else{for(u/=3,f/=3,Ce=1/(u-1),be=1/(f-1),p=0;p<f;p++)ne[me++]=p*be,ne[me++]=0;for(p=u;p>0;p--)ne[me++]=(p-1)*Ce,ne[me++]=1}l.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:ne})}return t.normal&&(l.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(l.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(l.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:l,indices:O}}function R8e(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,l=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,f=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,y=uue,h=mue,g=Fk,x=Ak,S=Z8e,V=fue,Z=l;for(d=0;d<s;d+=3){let R=Z+l;y=m.fromArray(n,d,y),h=m.fromArray(n,d+s,h),g=m.fromArray(n,(d+3)%s,g),h=m.subtract(h,y,h),g=m.subtract(g,y,g),x=m.normalize(m.cross(h,g,x),x),t.normal&&(Bi.addAttribute(u,x,R),Bi.addAttribute(u,x,R+3),Bi.addAttribute(u,x,Z),Bi.addAttribute(u,x,Z+3)),(t.tangent||t.bitangent)&&(V=m.fromArray(i,d,V),t.bitangent&&(Bi.addAttribute(p,V,R),Bi.addAttribute(p,V,R+3),Bi.addAttribute(p,V,Z),Bi.addAttribute(p,V,Z+3)),t.tangent&&(S=m.normalize(m.cross(V,x,S),S),Bi.addAttribute(f,S,R),Bi.addAttribute(f,S,R+3),Bi.addAttribute(f,S,Z),Bi.addAttribute(f,S,Z+3))),Z+=6}if(t.normal){for(u.set(i),d=0;d<s;d+=3)u[d+s]=-i[d],u[d+s+1]=-i[d+1],u[d+s+2]=-i[d+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let R=e.tangent.values;f.set(R),f.set(R,s),e.tangent.values=f}}if(t.st){let u=e.st.values,f=new Float32Array(a*6);f.set(u),f.set(u,a);let p=a*2;for(let y=0;y<2;y++){for(f[p++]=u[0],f[p++]=u[1],d=2;d<a;d+=2){let h=u[d],g=u[d+1];f[p++]=h,f[p++]=g,f[p++]=h,f[p++]=g}f[p++]=u[0],f[p++]=u[1]}e.st.values=f}return e}function KK(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 G8e(e,t){let n=new We({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Bi.computePositions(e),r=pue(o,n,i),s=e.height,a=e.extrudedHeight,l=r.attributes,d=r.indices,u=l.position.values,f=u.length,p=new Float64Array(f*6),y=new Float64Array(f);y.set(u);let h=new Float64Array(f*4);u=ai.scaleToGeodeticHeight(u,s,i),h=KK(u,0,h),y=ai.scaleToGeodeticHeight(y,a,i),h=KK(y,f*2,h),p.set(u),p.set(y,f),p.set(h,f*2),l.position.values=p,l=R8e(l,t);let g,x=f/3;if(e.shadowVolume){let F=l.normal.values;f=F.length;let N=new Float32Array(f*6);for(g=0;g<f;g++)F[g]=-F[g];N.set(F,f),N=KK(F,f*4,N),l.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(l.normal=void 0)}if(c(e.offsetAttribute)){let F=new Uint8Array(x*6);if(e.offsetAttribute===$t.TOP)F=F.fill(1,0,x).fill(1,x*2,x*4);else{let N=e.offsetAttribute===$t.NONE?0:1;F=F.fill(N)}l.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}let S=d.length,V=x+x,Z=Me.createTypedArray(p.length/3,S*2+V*3);Z.set(d);let R=S;for(g=0;g<S;g+=3){let F=d[g],N=d[g+1],b=d[g+2];Z[R++]=b+x,Z[R++]=N+x,Z[R++]=F+x}let E,I,v,P;for(g=0;g<V;g+=2)E=g+V,I=E+V,v=E+1,P=I+1,Z[R++]=E,Z[R++]=I,Z[R++]=v,Z[R++]=v,Z[R++]=I,Z[R++]=P;return{attributes:l,indices:Z}}var lue=new m,NP=new m,Qu=new pe;function due(e,t,n,i,o,r){let s=m.subtract(t,e,lue);m.normalize(s,s);let a=n.geodeticSurfaceNormal(e,NP),l=m.cross(s,a,lue);m.multiplyByScalar(l,i,l);let d=o.latitude,u=o.longitude,f=r.latitude,p=r.longitude;m.add(e,l,NP),n.cartesianToCartographic(NP,Qu);let y=Qu.latitude,h=Qu.longitude;d=Math.min(d,y),u=Math.min(u,h),f=Math.max(f,y),p=Math.max(p,h),m.subtract(e,l,NP),n.cartesianToCartographic(NP,Qu),y=Qu.latitude,h=Qu.longitude,d=Math.min(d,y),u=Math.min(u,h),f=Math.max(f,y),p=Math.max(p,h),o.latitude=d,o.longitude=u,r.latitude=f,r.longitude=p}var Ju=new m,kP=new m,Dl=new pe,Bl=new pe;function bue(e,t,n,i,o){e=hue(e,t);let r=xo(e,m.equalsEpsilon),s=r.length;if(s<2||n<=0)return new de;let a=n*.5;Dl.latitude=Number.POSITIVE_INFINITY,Dl.longitude=Number.POSITIVE_INFINITY,Bl.latitude=Number.NEGATIVE_INFINITY,Bl.longitude=Number.NEGATIVE_INFINITY;let l,d;if(i===Fi.ROUNDED){let p=r[0];m.subtract(p,r[1],Ju),m.normalize(Ju,Ju),m.multiplyByScalar(Ju,a,Ju),m.add(p,Ju,kP),t.cartesianToCartographic(kP,Qu),l=Qu.latitude,d=Qu.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,d),Bl.latitude=Math.max(Bl.latitude,l),Bl.longitude=Math.max(Bl.longitude,d)}for(let p=0;p<s-1;++p)due(r[p],r[p+1],t,a,Dl,Bl);let u=r[s-1];m.subtract(u,r[s-2],Ju),m.normalize(Ju,Ju),m.multiplyByScalar(Ju,a,Ju),m.add(u,Ju,kP),due(u,kP,t,a,Dl,Bl),i===Fi.ROUNDED&&(t.cartesianToCartographic(kP,Qu),l=Qu.latitude,d=Qu.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,d),Bl.latitude=Math.max(Bl.latitude,l),Bl.longitude=Math.max(Bl.longitude,d));let f=c(o)?o:new de;return f.north=Bl.latitude,f.south=Dl.latitude,f.east=Bl.longitude,f.west=Dl.longitude,f}function Nb(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.width;C.defined("options.positions",t),C.defined("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Fi.ROUNDED,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*m.packedLength+re.packedLength+We.packedLength+7}Nb.pack=function(e,t,n){C.defined("value",e),C.defined("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var yue=re.clone(re.UNIT_SPHERE),gue=new We,Mb={positions:void 0,ellipsoid:yue,vertexFormat:gue,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Nb.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let h=0;h<i;++h,t+=m.packedLength)o[h]=m.unpack(e,t);let r=re.unpack(e,t,yue);t+=re.packedLength;let s=We.unpack(e,t,gue);t+=We.packedLength;let a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t++]===1,y=e[t];return c(n)?(n._positions=o,n._ellipsoid=re.clone(r,n._ellipsoid),n._vertexFormat=We.clone(s,n._vertexFormat),n._width=a,n._height=l,n._extrudedHeight=d,n._cornerType=u,n._granularity=f,n._shadowVolume=p,n._offsetAttribute=y===-1?void 0:y,n):(Mb.positions=o,Mb.width=a,Mb.height=l,Mb.extrudedHeight=d,Mb.cornerType=u,Mb.granularity=f,Mb.shadowVolume=p,Mb.offsetAttribute=y===-1?void 0:y,new Nb(Mb))};Nb.computeRectangle=function(e,t){e=e??z.EMPTY_OBJECT;let n=e.positions,i=e.width;C.defined("options.positions",n),C.defined("options.width",i);let o=e.ellipsoid??re.default,r=e.cornerType??Fi.ROUNDED;return bue(n,o,i,r,t)};Nb.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=hue(t,i);let o=xo(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!w.equalsEpsilon(r,s,0,w.EPSILON2),l=e._vertexFormat,d={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)d.height=r,d.extrudedHeight=s,d.shadowVolume=e._shadowVolume,d.offsetAttribute=e._offsetAttribute,u=G8e(d,l);else{let y=Bi.computePositions(d);if(u=pue(y,l,i),u.attributes.position.values=ai.scaleToGeodeticHeight(u.attributes.position.values,r,i),c(e._offsetAttribute)){let h=e._offsetAttribute===$t.NONE?0:1,g=u.attributes.position.values.length,x=new Uint8Array(g/3).fill(h);u.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let f=u.attributes,p=ue.fromVertices(f.position.values,void 0,3);return l.position||(u.attributes.position.values=void 0),new dt({attributes:f,indices:u.indices,primitiveType:ve.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Nb.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Nb({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Nb.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=bue(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var eT=Nb;var B7n=_(T(),1);var xue=new m,_ue=new m,E8e=new m;function X8e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Tue(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new fn,a,l=0,d=0,u,f=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,l+=p,f+=p/3*4,d+=i[u+1].length-3;for(l+=3,d+=3,u=0;u<o.length;u++){a=o[u];let A=o[u].leftPositions;c(A)?(p=A.length,l+=p,f+=p/3*2):(p=o[u].rightPositions.length,d+=p,f+=p/3*2)}let y=c(r),h;y&&(h=r[0].length-3,l+=h,d+=h,h/=3,f+=h*4);let g=l+d,x=new Float64Array(g),S=0,V=g-1,Z,R,E,I,v,P,F=h/2,N=Me.createTypedArray(g/3,f+4),b=0;if(N[b++]=S/3,N[b++]=(V-2)/3,y){n.push(S/3),P=xue,v=_ue;let A=r[0];for(u=0;u<F;u++)P=m.fromArray(A,(F-1-u)*3,P),v=m.fromArray(A,(F+u)*3,v),Bi.addAttribute(x,v,S),Bi.addAttribute(x,P,void 0,V),R=S/3,I=R+1,Z=(V-2)/3,E=Z-1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3}let G=0,X=i[G++],W=i[G++];for(x.set(X,S),x.set(W,V-W.length+1),p=W.length-3,n.push(S/3,(V-2)/3),u=0;u<p;u+=3)R=S/3,I=R+1,Z=(V-2)/3,E=Z-1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3;for(u=0;u<o.length;u++){let A;a=o[u];let k=a.leftPositions,B=a.rightPositions,O,H=E8e;if(c(k)){for(V-=3,O=E,n.push(I),A=0;A<k.length/3;A++)H=m.fromArray(k,A*3,H),N[b++]=O-A-1,N[b++]=O-A,Bi.addAttribute(x,H,void 0,V),V-=3;n.push(O-Math.floor(k.length/6)),t===Fi.BEVELED&&n.push((V-2)/3+1),S+=3}else{for(S+=3,O=I,n.push(E),A=0;A<B.length/3;A++)H=m.fromArray(B,A*3,H),N[b++]=O+A,N[b++]=O+A+1,Bi.addAttribute(x,H,S),S+=3;n.push(O+Math.floor(B.length/6)),t===Fi.BEVELED&&n.push(S/3-1),V-=3}for(X=i[G++],W=i[G++],X.splice(0,3),W.splice(W.length-3,3),x.set(X,S),x.set(W,V-W.length+1),p=W.length-3,A=0;A<W.length;A+=3)I=S/3,R=I-1,E=(V-2)/3,Z=E+1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3;S-=3,V+=3,n.push(S/3,(V-2)/3)}if(y){S+=3,V-=3,P=xue,v=_ue;let A=r[1];for(u=0;u<F;u++)P=m.fromArray(A,(h-u-1)*3,P),v=m.fromArray(A,u*3,v),Bi.addAttribute(x,P,void 0,V),Bi.addAttribute(x,v,S),I=S/3,R=I-1,E=(V-2)/3,Z=E+1,N[b++]=Z,N[b++]=E,N[b++]=R,N[b++]=I,S+=3,V-=3;n.push(S/3)}else n.push(S/3,(V-2)/3);return N[b++]=S/3,N[b++]=(V-2)/3,s.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:x}),{attributes:s,indices:N,wallIndices:n}}function I8e(e){let t=e.ellipsoid,n=Bi.computePositions(e),i=Tue(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,l=i.indices,d=a.position.values,u=d.length,f=new Float64Array(u);f.set(d);let p=new Float64Array(u*2);if(d=ai.scaleToGeodeticHeight(d,r,t),f=ai.scaleToGeodeticHeight(f,s,t),p.set(d),p.set(f,u),a.position.values=p,u/=3,c(e.offsetAttribute)){let Z=new Uint8Array(u*2);if(e.offsetAttribute===$t.TOP)Z=Z.fill(1,0,u);else{let R=e.offsetAttribute===$t.NONE?0:1;Z=Z.fill(R)}a.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z})}let y,h=l.length,g=Me.createTypedArray(p.length/3,(h+o.length)*2);g.set(l);let x=h;for(y=0;y<h;y+=2){let Z=l[y],R=l[y+1];g[x++]=Z+u,g[x++]=R+u}let S,V;for(y=0;y<o.length;y++)S=o[y],V=S+u,g[x++]=S,g[x++]=V;return{attributes:a,indices:g}}function UP(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.width;C.typeOf.object("options.positions",t),C.typeOf.number("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??Fi.ROUNDED,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*m.packedLength+re.packedLength+6}UP.pack=function(e,t,n){C.typeOf.object("value",e),C.typeOf.object("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=m.packedLength)m.pack(i[r],t,n);return re.pack(e._ellipsoid,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._offsetAttribute??-1,t};var Sue=re.clone(re.UNIT_SPHERE),Ky={positions:void 0,ellipsoid:Sue,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};UP.unpack=function(e,t,n){C.typeOf.object("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=m.packedLength)o[p]=m.unpack(e,t);let r=re.unpack(e,t,Sue);t+=re.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t];return c(n)?(n._positions=o,n._ellipsoid=re.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=l,n._cornerType=d,n._granularity=u,n._offsetAttribute=f===-1?void 0:f,n):(Ky.positions=o,Ky.width=s,Ky.height=a,Ky.extrudedHeight=l,Ky.cornerType=d,Ky.granularity=u,Ky.offsetAttribute=f===-1?void 0:f,new UP(Ky))};UP.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=X8e(t,i);let o=xo(t,m.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!w.equalsEpsilon(r,s,0,w.EPSILON2),l={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)l.height=r,l.extrudedHeight=s,l.offsetAttribute=e._offsetAttribute,d=I8e(l);else{let p=Bi.computePositions(l);if(d=Tue(p,l.cornerType),d.attributes.position.values=ai.scaleToGeodeticHeight(d.attributes.position.values,r,i),c(e._offsetAttribute)){let y=d.attributes.position.values.length,h=e._offsetAttribute===$t.NONE?0:1,g=new Uint8Array(y/3).fill(h);d.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}}let u=d.attributes,f=ue.fromVertices(u.position.values,void 0,3);return new dt({attributes:u,indices:d.indices,primitiveType:ve.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var OP=UP;var i6n=_(T(),1);var W8e=new Qn(0);function il(e){oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}c(Object.create)&&(il.prototype=Object.create(oi.prototype),il.prototype.constructor=il);Object.defineProperties(il.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});il.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!c(t.height)&&!c(t.extrudedHeight)&&kc.isSupported(this._scene)};il.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||c(n)&&n!==t};il.prototype._computeCenter=L.throwInstantiationError;il.prototype._onEntityPropertyChanged=function(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(o.zIndex)&&(c(o.height)||c(o.extrudedHeight))&&ht(ht.geometryZIndex),this._zIndex=o.zIndex??W8e,c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(c(r)||c(s)){let a=new Om(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Jx(this._scene,a,r,s)}};il.prototype.destroy=function(){c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),oi.prototype.destroy.call(this)};il.getGeometryHeight=function(e,t){if(C.defined("heightReference",t),!c(e)){t!==ze.NONE&&ht(ht.geometryHeightReference);return}return Lu(t)?0:e};il.getGeometryExtrudedHeight=function(e,t){if(C.defined("extrudedHeightReference",t),!c(e)){t!==ze.NONE&&ht(ht.geometryExtrudedHeightReference);return}return Lu(t)?il.CLAMP_TO_GROUND:e};il.CLAMP_TO_GROUND="clamp";il.computeGeometryOffsetAttribute=function(e,t,n,i){(!c(e)||!c(t))&&(t=ze.NONE),(!c(n)||!c(i))&&(i=ze.NONE);let o=0;if(t!==ze.NONE&&o++,i===ze.RELATIVE_TO_GROUND&&o++,o===2)return $t.ALL;if(o===1)return $t.TOP};var Yn=il;var Cue=new Y,Vue=m.ZERO,Lue=new m,Zue=new de;function w8e(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 gf(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new w8e(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}c(Object.create)&&(gf.prototype=Object.create(Yn.prototype),gf.prototype.constructor=gf);gf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new Tn(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 Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Cue)),c(o)||(o=Y.WHITE),i.color=Yt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vue,Lue))),new Rt({id:t,geometry:new eT(this._options),attributes:i})};gf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Cue),o={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return c(this._options.offsetAttribute)&&(o.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vue,Lue))),new Rt({id:t,geometry:new OP(this._options),attributes:o})};gf.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!c(n)||n.length===0))return m.clone(n[Math.floor(n.length/2)],t)};gf.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.width)||oi.prototype._isHidden.call(this,e,t)};gf.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 Ut)};gf.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ye.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ye.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),s.cornerType=J.getValueOrUndefined(t.cornerType,Ye.MINIMUM_VALUE),s.offsetAttribute=Yn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Yn.getGeometryHeight(n,i),o=Yn.getGeometryExtrudedHeight(o,r),o===Yn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(eT.computeRectangle(s,Zue)).minimumTerrainHeight),s.extrudedHeight=o};gf.DynamicGeometryUpdater=F1;function F1(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(F1.prototype=Object.create(ii.prototype),F1.prototype.constructor=F1);F1.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.positions)||!c(i.width)||ii.prototype._isHidden.call(this,e,t,n)};F1.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,ze.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);c(s)&&!c(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=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(eT.computeRectangle(i,Zue)).minimumTerrainHeight),i.extrudedHeight=s};var DP=gf;var a$n=_(T(),1);var I6n=_(T(),1);function Mk(){L.throwInstantiationError()}Object.defineProperties(Mk.prototype,{name:{get:L.throwInstantiationError},clock:{get:L.throwInstantiationError},entities:{get:L.throwInstantiationError},isLoading:{get:L.throwInstantiationError},changedEvent:{get:L.throwInstantiationError},errorEvent:{get:L.throwInstantiationError},loadingEvent:{get:L.throwInstantiationError},show:{get:L.throwInstantiationError},clustering:{get:L.throwInstantiationError}});Mk.prototype.update=function(e){L.throwInstantiationError()};Mk.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Hr=Mk;var $qn=_(T(),1);var N6n=_(T(),1);function Wh(e,t){C.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new m,this._cameraPositionInScaledSpace=new m,this._distanceToLimbInScaledSpaceSquared=0,c(t)&&(this.cameraPosition=t)}Object.defineProperties(Wh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=m.magnitudeSquared(n)-1;m.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Rue=new m;Wh.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Rue);return QK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Wh.prototype.isScaledSpacePointVisible=function(e){return QK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var P8e=new m;Wh.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return c(t)&&t<0&&n.minimumRadius>-t?(o=P8e,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),QK(e,o,i)};Wh.prototype.computeHorizonCullingPoint=function(e,t,n){return Xue(this._ellipsoid,e,t,n)};var Gue=re.clone(re.UNIT_SPHERE);Wh.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=Eue(this._ellipsoid,n,Gue);return Xue(o,e,t,i)};Wh.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return Iue(this._ellipsoid,e,t,n,i,o)};Wh.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=Eue(this._ellipsoid,o,Gue);return Iue(s,e,t,n,i,r)};var v8e=[];Wh.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){C.typeOf.object("rectangle",e);let i=de.subsample(e,t,0,v8e),o=ue.fromPoints(i);if(!(m.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var F8e=new m;function Eue(e,t,n){if(c(t)&&t<0&&e.minimumRadius>-t){let i=m.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,F8e);e=re.fromCartesian3(i,n)}return e}function Xue(e,t,n,i){C.typeOf.object("directionToPoint",t),C.defined("positions",n),c(i)||(i=new m);let o=Pue(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let l=n[s],d=Wue(e,l,o);if(d<0)return;r=Math.max(r,d)}return wue(o,r,i)}var Nk=new m;function Iue(e,t,n,i,o,r){C.typeOf.object("directionToPoint",t),C.defined("vertices",n),C.typeOf.number("stride",i),c(r)||(r=new m),i=i??3,o=o??m.ZERO;let s=Pue(e,t),a=0;for(let l=0,d=n.length;l<d;l+=i){Nk.x=n[l]+o.x,Nk.y=n[l+1]+o.y,Nk.z=n[l+2]+o.z;let u=Wue(e,Nk,s);if(u<0)return;a=Math.max(a,u)}return wue(s,a,r)}function QK(e,t,n){let i=t,o=n,r=m.subtract(e,i,Rue),s=-m.dot(r,i);return!(o<0?s>0:s>o&&s*s/m.magnitudeSquared(r)>o)}var A8e=new m,M8e=new m;function Wue(e,t,n){let i=e.transformPositionToScaledSpace(t,A8e),o=m.magnitudeSquared(i),r=Math.sqrt(o),s=m.divideByScalar(i,r,M8e);o=Math.max(1,o),r=Math.max(1,r);let a=m.dot(s,n),l=m.magnitude(m.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-l*u)}function wue(e,t,n){if(!(t<=0||t===1/0||t!==t))return m.multiplyByScalar(e,t,n)}var JK=new m;function Pue(e,t){return m.equals(t,m.ZERO)?t:(e.transformPositionToScaledSpace(t,JK),m.normalize(JK,JK))}var kb=Wh;var tqn=_(T(),1);function Er(e,t){if(e=e??z.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new L("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Nt.clone(n)}if(c(i)){if(i.far<=i.near)throw new L("scaleByDistance.far must be greater than scaleByDistance.near.");i=Nt.clone(i)}if(c(o)){if(o.far<=o.near)throw new L("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=vt.clone(o)}this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),this._actualPosition=m.clone(this._position),this._color=Y.clone(e.color??Y.WHITE),this._outlineColor=Y.clone(e.outlineColor??Y.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??Ar.NONE}var vue=Er.SHOW_INDEX=0,Mue=Er.POSITION_INDEX=1,N8e=Er.COLOR_INDEX=2,k8e=Er.OUTLINE_COLOR_INDEX=3,U8e=Er.OUTLINE_WIDTH_INDEX=4,O8e=Er.PIXEL_SIZE_INDEX=5,D8e=Er.SCALE_BY_DISTANCE_INDEX=6,B8e=Er.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Y8e=Er.DISTANCE_DISPLAY_CONDITION_INDEX=8,H8e=Er.DISABLE_DEPTH_DISTANCE_INDEX=9,z8e=Er.SPLIT_DIRECTION_INDEX=10;Er.NUMBER_OF_PROPERTIES=11;function Wd(e,t){let n=e._pointPrimitiveCollection;c(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Er.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new L("value is required.");this._show!==e&&(this._show=e,Wd(this,vue))}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new L("value is required.");let t=this._position;m.equals(t,e)||(m.clone(e,t),m.clone(e,this._actualPosition),Wd(this,Mue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._scaleByDistance;Nt.equals(t,e)||(this._scaleByDistance=Nt.clone(e,t),Wd(this,D8e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far distance must be greater than near distance.");let t=this._translucencyByDistance;Nt.equals(t,e)||(this._translucencyByDistance=Nt.clone(e,t),Wd(this,B8e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!c(e))throw new L("value is required.");this._pixelSize!==e&&(this._pixelSize=e,Wd(this,O8e))}},color:{get:function(){return this._color},set:function(e){if(!c(e))throw new L("value is required.");let t=this._color;Y.equals(t,e)||(Y.clone(e,t),Wd(this,N8e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new L("value is required.");let t=this._outlineColor;Y.equals(t,e)||(Y.clone(e,t),Wd(this,k8e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new L("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Wd(this,U8e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new L("far must be greater than near");vt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=vt.clone(e,this._distanceDisplayCondition),Wd(this,Y8e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!c(e)||e<0)throw new L("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,Wd(this,H8e)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(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,Wd(this,vue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Wd(this,z8e))}}});Er.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Er.prototype._getActualPosition=function(){return this._actualPosition};Er.prototype._setActualPosition=function(e){m.clone(e,this._actualPosition),Wd(this,Mue)};var Fue=new ce;Er._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(M.multiplyByPoint(n,e,Fue),Oi.computeActualEllipsoidPosition(t,Fue))};var Aue=new ce;Er._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,Aue),Aue);return Oi.worldToWindowCoordinates(n,o,i)};Er.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;if(c(t)||(t=new D),!c(n))throw new L("PointPrimitive must be in a collection.");if(!c(e))throw new L("scene is required.");let i=n.modelMatrix,o=Er._computeScreenSpacePosition(i,this._actualPosition,e,t);if(c(o))return o.y=e.canvas.clientHeight-o.y,o};Er.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,l=i;return c(n)||(n=new je),n.x=r,n.y=s,n.width=a,n.height=l,n};Er.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&m.equals(this._position,e._position)&&Y.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&Y.equals(this._outlineColor,e._outlineColor)&&Nt.equals(this._scaleByDistance,e._scaleByDistance)&&Nt.equals(this._translucencyByDistance,e._translucencyByDistance)&&vt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Er.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Gs=Er;var wqn=_(T(),1);var iqn=_(T(),1),Jy=`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;
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
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;
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
if (color.a < 0.005)
{
discard;
}
#else
#ifdef OPAQUE
if (color.a < 0.995)
{
discard;
}
#else
if (color.a >= 0.995)
{
discard;
}
#endif
#endif
out_FragColor = czm_gammaCorrect(color);
czm_writeLogDepth();
}
`;var rqn=_(T(),1),BP=`uniform float u_maxTotalPointSize;
in vec4 positionHighAndSize;
in vec4 positionLowAndOutline;
in vec4 compressedAttribute0;
in vec4 compressedAttribute1;
in vec4 scaleByDistance;
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection;
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()
{
vec3 positionHigh = positionHighAndSize.xyz;
vec3 positionLow = positionLowAndOutline.xyz;
float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
float totalSize = positionHighAndSize.w + outlineWidthBothSides;
float outlinePercent = outlineWidthBothSides / totalSize;
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;
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);
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);
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);
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)
{
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) {
totalSize += 3.0;
}
totalSize = min(totalSize, u_maxTotalPointSize);
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);
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) {
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)
{
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)))
{
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 K8e=Gs.SHOW_INDEX,$K=Gs.POSITION_INDEX,Nue=Gs.COLOR_INDEX,J8e=Gs.OUTLINE_COLOR_INDEX,Q8e=Gs.OUTLINE_WIDTH_INDEX,j8e=Gs.PIXEL_SIZE_INDEX,kue=Gs.SCALE_BY_DISTANCE_INDEX,Uue=Gs.TRANSLUCENCY_BY_DISTANCE_INDEX,Oue=Gs.DISTANCE_DISPLAY_CONDITION_INDEX,q8e=Gs.DISABLE_DEPTH_DISTANCE_INDEX,$8e=Gs.SPLIT_DIRECTION_INDEX,eJ=Gs.NUMBER_OF_PROPERTIES,Cc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ju(e){e=e??z.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(eJ),this._maxPixelSize=1,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Lo.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW,Ne.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ju.prototype,{length:{get:function(){return tJ(this),this._pointPrimitives.length}}});function Due(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ju.prototype.add=function(e){let t=new Gs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ju.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ju.prototype.removeAll=function(){Due(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function tJ(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}}ju.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ju.prototype.contains=function(e){return c(e)&&e._pointPrimitiveCollection===this};ju.prototype.get=function(e){if(!c(e))throw new L("index is required.");return tJ(this),this._pointPrimitives[e]};ju.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<eJ;++i){let o=n[i]===0?Ne.STATIC_DRAW:Ne.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function e7e(e,t,n){return new Ip(e,[{index:Cc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[$K]},{index:Cc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[$K]},{index:Cc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Nue]},{index:Cc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Uue]},{index:Cc.scaleByDistance,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[kue]},{index:Cc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:n[Oue]}],t)}var jK=new Bn;function Bue(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===se.SCENE3D&&(ue.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Bn.fromCartesian(r,jK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let l=n[Cc.positionHighAndSize],d=jK.high;l(o,d.x,d.y,d.z,s);let u=n[Cc.positionLowAndOutline],f=jK.low;u(o,f.x,f.y,f.z,a)}var kk=65536,YP=256;function Yue(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,l=Y.floatToByte(r.red),d=Y.floatToByte(r.green),u=Y.floatToByte(r.blue),f=l*kk+d*YP+u;l=Y.floatToByte(a.red),d=Y.floatToByte(a.green),u=Y.floatToByte(a.blue);let p=l*kk+d*YP+u;l=Y.floatToByte(s.red),d=Y.floatToByte(s.green),u=Y.floatToByte(s.blue);let y=l*kk+d*YP+u,h=Y.floatToByte(r.alpha)*kk+Y.floatToByte(a.alpha)*YP+Y.floatToByte(s.alpha),g=n[Cc.compressedAttribute0];g(o,f,p,y,h)}function Hue(e,t,n,i){let o=i._index,r=0,s=1,a=1,l=1,d=i.translucencyByDistance;c(d)&&(r=d.near,s=d.nearValue,a=d.far,l=d.farValue,(s!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=w.clamp(s,0,1),s=s===1?255:s*255|0;let f=(u?1:0)*YP+s;l=w.clamp(l,0,1),l=l===1?255:l*255|0;let p=l,y=n[Cc.compressedAttribute1];y(o,f,p,r,a)}function zue(e,t,n,i){let o=i._index,r=n[Cc.scaleByDistance],s=0,a=1,l=1,d=1,u=i.scaleByDistance;c(u)&&(s=u.near,a=u.nearValue,l=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,l,d)}function Kue(e,t,n,i){let o=i._index,r=n[Cc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,f=i.splitDirection;c(f)&&(u=f),r(o,s,a,d,u)}function t7e(e,t,n,i){Bue(e,t,n,i),Yue(e,t,n,i),Hue(e,t,n,i),zue(e,t,n,i),Kue(e,t,n,i)}function qK(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l<n;++l){let d=t[l],u=d.position,f=Gs._computeActualPosition(u,i,o);c(f)&&(d._setActualPosition(f),r?a.push(f):ue.expand(s,f,s))}r&&ue.fromPoints(a,s)}function n7e(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&qK(e,i,i.length,t,r,!0)):n===se.MORPHING?qK(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&qK(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function i7e(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var o7e=[];ju.prototype.update=function(e){if(tJ(this),!this.show)return;this._maxTotalPointSize=mt.maximumAliasedPointSize,n7e(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,l=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let E=0;E<eJ;++E)r[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=e7e(l,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E<n;++E){let I=this._pointPrimitives[E];I._dirty=!1,t7e(this,l,a,I)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let E=o7e;E.length=0,(r[$K]||r[Q8e]||r[j8e])&&E.push(Bue),(r[Nue]||r[J8e])&&E.push(Yue),(r[K8e]||r[Uue])&&E.push(Hue),r[kue]&&E.push(zue),(r[Oue]||r[q8e]||r[$8e])&&E.push(Kue);let I=E.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 F=0;F<I;++F)E[F](this,l,a,P)}this._vaf.commit()}else{for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let F=0;F<I;++F)E[F](this,l,a,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,p=M.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,f=ue.clone(this._baseVolumeWC,this._boundingVolume)):f=ue.clone(this._baseVolume2D,this._boundingVolume),i7e(this,e,f);let y=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,y&&(this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Oe.fromCache({depthTest:{enabled:!0,func:oe.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Oe.fromCache({depthTest:{enabled:!0,func:oe.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let h,g;(y||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(h=new Be({sources:[BP]}),this._shaderScaleByDistance&&h.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&h.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&h.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&h.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(g=new Be({defines:["OPAQUE"],sources:[Jy]}),this._sp=tn.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc}),g=new Be({defines:["TRANSLUCENT"],sources:[Jy]}),this._spTranslucent=tn.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc})),this._blendOption===Lo.OPAQUE&&(g=new Be({sources:[Jy]}),this._sp=tn.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc})),this._blendOption===Lo.TRANSLUCENT&&(g=new Be({sources:[Jy]}),this._spTranslucent=tn.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:h,fragmentShaderSource:g,attributeLocations:Cc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let x,S,V,Z,R=e.commandList;if(d.render||u){let E=this._colorCommands,I=this._blendOption===Lo.OPAQUE,v=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT;x=this._vaf.va,S=x.length,E.length=S;let P=v?S*2:S;for(Z=0;Z<P;++Z){let F=I||v&&Z%2===0;V=E[Z],c(V)||(V=E[Z]=new et),V.primitiveType=ve.POINTS,V.pass=F||!v?Xe.OPAQUE:Xe.TRANSLUCENT,V.owner=this;let N=v?Math.floor(Z/2):Z;V.boundingVolume=f,V.modelMatrix=p,V.shaderProgram=F?this._sp:this._spTranslucent,V.uniformMap=this._uniforms,V.vertexArray=x[N].va,V.renderState=F?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId="v_pickColor",R.push(V)}}};ju.prototype.isDestroyed=function(){return!1};ju.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(),Due(this._pointPrimitives),he(this)};var A1=ju;var vqn=_(T(),1),Jue=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],nJ=1,HP=8,KP=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!==nJ)throw new Error(`Got v${o} data when expected v${nJ}.`);let r=Jue[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=Jue.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(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,HP,t),this.coords=new this.ArrayType(this.data,HP+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(HP+s+a+l),this.ids=new this.IndexArrayType(this.data,HP,t),this.coords=new this.ArrayType(this.data,HP+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(nJ<<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 oJ(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,l=[0,r.length-1,0],d=[];for(;l.length;){let u=l.pop()||0,f=l.pop()||0,p=l.pop()||0;if(f-p<=a){for(let x=p;x<=f;x++){let S=s[2*x],V=s[2*x+1];S>=t&&S<=i&&V>=n&&V<=o&&d.push(r[x])}continue}let y=p+f>>1,h=s[2*y],g=s[2*y+1];h>=t&&h<=i&&g>=n&&g<=o&&d.push(r[y]),(u===0?t<=h:n<=g)&&(l.push(p),l.push(y-1),l.push(1-u)),(u===0?i>=h:o>=g)&&(l.push(y+1),l.push(f),l.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],l=[],d=i*i;for(;a.length;){let u=a.pop()||0,f=a.pop()||0,p=a.pop()||0;if(f-p<=s){for(let x=p;x<=f;x++)Que(r[2*x],r[2*x+1],t,n)<=d&&l.push(o[x]);continue}let y=p+f>>1,h=r[2*y],g=r[2*y+1];Que(h,g,t,n)<=d&&l.push(o[y]),(u===0?t-i<=h:n-i<=g)&&(a.push(p),a.push(y-1),a.push(1-u)),(u===0?t+i>=h:n+i>=g)&&(a.push(y+1),a.push(f),a.push(1-u))}return l}};function oJ(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;jue(e,t,s,i,o,r),oJ(e,t,n,i,s-1,1-r),oJ(e,t,n,s+1,o,1-r)}function jue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,f=Math.log(d),p=.5*Math.exp(2*f/3),y=.5*Math.sqrt(f*p*(d-p)/d)*(u-d/2<0?-1:1),h=Math.max(i,Math.floor(n-u*p/d+y)),g=Math.min(o,Math.floor(n+(d-u)*p/d+y));jue(e,t,n,h,g,r)}let s=t[2*n+r],a=i,l=o;for(zP(e,t,i,n),t[2*o+r]>s&&zP(e,t,i,o);a<l;){for(zP(e,t,a,l),a++,l--;t[2*a+r]<s;)a++;for(;t[2*l+r]>s;)l--}t[2*i+r]===s?zP(e,t,i,l):(l++,zP(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function zP(e,t,n,i){iJ(e,n,i),iJ(t,2*n,2*i),iJ(t,2*n+1,2*i+1)}function iJ(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Que(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function xf(e){e=e??z.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 ye,this.show=e.show??!0}function que(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var r7e=new je;function $ue(e,t,n,i,o){if(c(e._labelCollection)&&i._clusterLabels?o=Fy.getScreenSpaceBoundingBox(e,t,o):c(e._billboardCollection)&&i._clusterBillboards?o=co.getScreenSpaceBoundingBox(e,t,o):c(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Gs.getScreenSpaceBoundingBox(e,t,o)),que(o,n),i._clusterLabels&&!c(e._labelCollection)&&c(e.id)&&tme(i,e.id.id)&&c(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Fy.getScreenSpaceBoundingBox(s,t,r7e);que(a,n),o=je.union(o,a,o)}return o}function s7e(e,t){if(e.clusterShow=!0,!c(e._labelCollection)&&c(e.id)&&tme(t,e.id.id)&&c(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function eme(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 tme(e,t){return c(e)&&c(e._collectionIndicesByEntity[t])&&c(e._collectionIndicesByEntity[t].labelIndex)}function rJ(e,t,n,i,o){if(!c(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===se.SCENE3D&&!i.isPointVisible(a.position))continue;let l=o._clusterLabels&&c(a._labelCollection),d=o._clusterBillboards&&c(a.id._billboard),u=o._clusterPoints&&c(a.id._point);if(l&&(u||d))continue;let f=a.computeScreenSpacePosition(n);c(f)&&t.push({index:s,collection:e,clustered:!1,coord:f})}}var a7e=new je,c7e=new je,l7e=new je;function d7e(e){return function(t){if(c(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!c(i)&&!c(o)&&!c(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,l=e._clusterPointCollection;c(s)?s.removeAll():s=e._clusterLabelCollection=new Gh({scene:n}),c(a)?a.removeAll():a=e._clusterBillboardCollection=new Gd({scene:n}),c(l)?l.removeAll():l=e._clusterPointCollection=new A1;let d=e._pixelRange,u=e._minimumClusterSize,f=e._previousClusters,p=[],y=e._previousHeight,h=n.camera.positionCartographic.height,g=n.ellipsoid,x=n.camera.positionWC,S=new kb(g,x),V=[];e._clusterLabels&&rJ(i,V,n,S,e),e._clusterBillboards&&rJ(o,V,n,S,e),e._clusterPoints&&rJ(r,V,n,S,e);let Z,R,E,I,v,P,F,N,b,G,X,W;if(V.length>0){let A=new KP(V.length,64,Uint32Array);for(let k=0;k<V.length;++k)A.add(V[k].coord.x,V[k].coord.y);if(A.finish(),h<y)for(E=f.length,Z=0;Z<E;++Z){let k=f[Z];if(!S.isPointVisible(k.position))continue;let B=co._computeScreenSpacePosition(M.IDENTITY,k.position,m.ZERO,D.ZERO,n);if(!c(B))continue;let O=1-h/y,H=k.width=k.width*O,U=k.height=k.height*O;H=Math.max(H,k.minimumWidth),U=Math.max(U,k.minimumHeight);let K=B.x-H*.5,Q=B.y-U*.5,ie=B.x+H,j=B.y+U;for(v=A.range(K,Q,ie,j),P=v.length,G=0,b=[],R=0;R<P;++R)F=v[R],N=V[F],N.clustered||(++G,X=N.collection,W=N.index,b.push(X.get(W).id));if(G>=u)for(eme(k.position,G,b,e),p.push(k),R=0;R<P;++R)V[v[R]].clustered=!0}for(E=V.length,Z=0;Z<E;++Z){let k=V[Z];if(k.clustered)continue;k.clustered=!0,X=k.collection,W=k.index;let B=X.get(W);I=$ue(B,k.coord,d,e,a7e);let O=je.clone(I,c7e);v=A.range(I.x,I.y,I.x+I.width,I.y+I.height),P=v.length;let H=m.clone(B.position);for(G=1,b=[B.id],R=0;R<P;++R)if(F=v[R],N=V[F],!N.clustered){let U=N.collection.get(N.index),K=$ue(U,N.coord,d,e,l7e);m.add(U.position,H,H),je.union(O,K,O),++G,b.push(U.id)}if(G>=u){let U=m.multiplyByScalar(H,1/G,H);for(eme(U,G,b,e),p.push({position:U,width:O.width,height:O.height,minimumWidth:I.width,minimumHeight:I.height}),R=0;R<P;++R)V[v[R]].clustered=!0}else s7e(B,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=h}}xf.prototype._initialize=function(e){this._scene=e;let t=d7e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(xf.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&&(!c(this._billboardCollection)||this._billboardCollection.ready)&&(!c(this._labelCollection)||this._labelCollection.ready)}}});function aJ(e,t,n,i){return function(o){let r=this[e];c(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(c(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),c(r)&&c(s[i]))return r.get(s[i]);c(r)||(r=this[e]=new t({scene:this._scene}));let a,l,d=this[n];d.length>0?(a=d.shift(),l=r.get(a)):(l=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),l}}function cJ(e,t){let n=e._collectionIndicesByEntity[t];!c(n.billboardIndex)&&!c(n.labelIndex)&&!c(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}xf.prototype.getLabel=aJ("_labelCollection",Gh,"_unusedLabelIndices","labelIndex");xf.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._labelCollection)||!c(t)||!c(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,cJ(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};xf.prototype.getBillboard=aJ("_billboardCollection",Gd,"_unusedBillboardIndices","billboardIndex");xf.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._billboardCollection)||!c(t)||!c(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,cJ(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};xf.prototype.getPoint=aJ("_pointCollection",A1,"_unusedPointIndices","pointIndex");xf.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._pointCollection)||!c(t)||!c(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,cJ(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function sJ(e){if(!c(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function u7e(e){e.enabled||(c(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),c(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),c(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,sJ(e._labelCollection),sJ(e._billboardCollection),sJ(e._pointCollection))}xf.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;c(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;c(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,u7e(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=c(n)&&!n.ready||c(i)&&!i.ready),c(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),c(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),c(this._clusterPointCollection)&&this._clusterPointCollection.update(e),c(n)&&n.update(e),c(i)&&i.update(e),c(this._pointCollection)&&this._pointCollection.update(e)};xf.prototype.destroy=function(){c(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 wd=xf;function lJ(e){this._name=e,this._clock=void 0,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Ks(this),this._entityCluster=new wd}Object.defineProperties(lJ.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){Hr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}}});lJ.prototype.update=function(e){return!0};var JP=lJ;var pei=_(T(),1);var G$n=_(T(),1);var d$n=_(T(),1);var nme={};nme.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,l=o?2*a:a,d=new Float64Array(l*3),u,f=0,p=0,y=o?a*3:0,h=o?(a+i)*3:i*3;for(u=0;u<i;u++){let g=u/i*w.TWO_PI,x=Math.cos(g),S=Math.sin(g),V=x*n,Z=S*n,R=x*t,E=S*t;d[p+y]=V,d[p+y+1]=Z,d[p+y+2]=s,d[p+h]=R,d[p+h+1]=E,d[p+h+2]=r,p+=3,o&&(d[f++]=V,d[f++]=Z,d[f++]=s,d[f++]=R,d[f++]=E,d[f++]=r)}return d};var tT=nme;var dJ=new D,m7e=new m,f7e=new m,h7e=new m,p7e=new m;function Ub(e){e=e??z.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??We.DEFAULT,r=e.slices??128;if(!c(t))throw new L("options.length must be defined.");if(!c(n))throw new L("options.topRadius must be defined.");if(!c(i))throw new L("options.bottomRadius must be defined.");if(r<3)throw new L("options.slices must be greater than or equal to 3.");if(c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=We.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Ub.packedLength=We.packedLength+5;Ub.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var ime=new We,M1={vertexFormat:ime,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Ub.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=We.unpack(e,t,ime);t+=We.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=l===-1?void 0:l,n):(M1.length=o,M1.topRadius=r,M1.bottomRadius=s,M1.slices=a,M1.offsetAttribute=l===-1?void 0:l,new Ub(M1))};Ub.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,l=s+s,d=tT.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(l*2):void 0,f=o.normal?new Float32Array(l*3):void 0,p=o.tangent?new Float32Array(l*3):void 0,y=o.bitangent?new Float32Array(l*3):void 0,h,g=o.normal||o.tangent||o.bitangent;if(g){let v=o.tangent||o.bitangent,P=0,F=0,N=0,b=Math.atan2(i-n,t),G=m7e;G.z=Math.sin(b);let X=Math.cos(b),W=h7e,A=f7e;for(h=0;h<r;h++){let k=h/r*w.TWO_PI,B=X*Math.cos(k),O=X*Math.sin(k);g&&(G.x=B,G.y=O,v&&(W=m.normalize(m.cross(m.UNIT_Z,G,W),W)),o.normal&&(f[P++]=G.x,f[P++]=G.y,f[P++]=G.z,f[P++]=G.x,f[P++]=G.y,f[P++]=G.z),o.tangent&&(p[F++]=W.x,p[F++]=W.y,p[F++]=W.z,p[F++]=W.x,p[F++]=W.y,p[F++]=W.z),o.bitangent&&(A=m.normalize(m.cross(G,W,A),A),y[N++]=A.x,y[N++]=A.y,y[N++]=A.z,y[N++]=A.x,y[N++]=A.y,y[N++]=A.z))}for(h=0;h<r;h++)o.normal&&(f[P++]=0,f[P++]=0,f[P++]=-1),o.tangent&&(p[F++]=1,p[F++]=0,p[F++]=0),o.bitangent&&(y[N++]=0,y[N++]=-1,y[N++]=0);for(h=0;h<r;h++)o.normal&&(f[P++]=0,f[P++]=0,f[P++]=1),o.tangent&&(p[F++]=1,p[F++]=0,p[F++]=0),o.bitangent&&(y[N++]=0,y[N++]=1,y[N++]=0)}let x=12*r-12,S=Me.createTypedArray(l,x),V=0,Z=0;for(h=0;h<r-1;h++)S[V++]=Z,S[V++]=Z+2,S[V++]=Z+3,S[V++]=Z,S[V++]=Z+3,S[V++]=Z+1,Z+=2;for(S[V++]=s-2,S[V++]=0,S[V++]=1,S[V++]=s-2,S[V++]=1,S[V++]=s-1,h=1;h<r-1;h++)S[V++]=s+h+1,S[V++]=s+h,S[V++]=s;for(h=1;h<r-1;h++)S[V++]=a,S[V++]=a+h,S[V++]=a+h+1;let R=0;if(o.st){let v=Math.max(n,i);for(h=0;h<l;h++){let P=m.fromArray(d,h*3,p7e);u[R++]=(P.x+v)/(2*v),u[R++]=(P.y+v)/(2*v)}}let E=new fn;o.position&&(E.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(E.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(E.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(E.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(E.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:u})),dJ.x=t*.5,dJ.y=Math.max(i,n);let I=new ue(m.ZERO,D.magnitude(dJ));if(c(e._offsetAttribute)){t=d.length;let v=e._offsetAttribute===$t.NONE?0:1,P=new Uint8Array(t/3).fill(v);E.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new dt({attributes:E,indices:S,primitiveType:ve.TRIANGLES,boundingSphere:I,offsetAttribute:e._offsetAttribute})};var uJ;Ub.getUnitCylinder=function(){return c(uJ)||(uJ=Ub.createGeometry(new Ub({topRadius:1,bottomRadius:1,length:1,vertexFormat:We.POSITION_ONLY}))),uJ};var QP=Ub;var Y$n=_(T(),1);var mJ=new D;function N1(e){e=e??z.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);if(C.typeOf.number("options.positions",t),C.typeOf.number("options.topRadius",n),C.typeOf.number("options.bottomRadius",i),C.typeOf.number.greaterThanOrEquals("options.slices",o,3),c(e.offsetAttribute)&&e.offsetAttribute===$t.TOP)throw new L("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}N1.packedLength=6;N1.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),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 nT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};N1.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=l===-1?void 0:l,n):(nT.length=i,nT.topRadius=o,nT.bottomRadius=r,nT.slices=s,nT.numberOfVerticalLines=a,nT.offsetAttribute=l===-1?void 0:l,new N1(nT))};N1.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=tT.computePositions(t,n,i,o,!1),l=o*2,d;if(r>0){let g=Math.min(r,o);d=Math.round(o/g),l+=g}let u=Me.createTypedArray(s,l*2),f=0,p;for(p=0;p<o-1;p++)u[f++]=p,u[f++]=p+1,u[f++]=p+o,u[f++]=p+1+o;if(u[f++]=o-1,u[f++]=0,u[f++]=o+o-1,u[f++]=o,r>0)for(p=0;p<o;p+=d)u[f++]=p,u[f++]=p+o;let y=new fn;y.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:a}),mJ.x=t*.5,mJ.y=Math.max(i,n);let h=new ue(m.ZERO,D.magnitude(mJ));if(c(e._offsetAttribute)){t=a.length;let g=e._offsetAttribute===$t.NONE?0:1,x=new Uint8Array(t/3).fill(g);y.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}return new dt({attributes:y,indices:u,primitiveType:ve.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var jP=N1;var ome=m.ZERO,rme=new m,b7e=new m,sme=new Y;function y7e(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 Pd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new y7e(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}c(Object.create)&&(Pd.prototype=Object.create(oi.prototype),Pd.prototype.constructor=Pd);Object.defineProperties(Pd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Pd.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new Tn(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 Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,sme)),c(a)||(a=Y.WHITE),s.color=Yt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ome,rme))),new Rt({id:t,geometry:new QP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Pd.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,sme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,ome,rme))),new Rt({id:t,geometry:new jP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Pd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Pd.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.length)||!c(t.topRadius)||!c(t.bottomRadius)||oi.prototype._isHidden.call(this,e,t)};Pd.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)};Pd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ye.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ye.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ye.MINIMUM_VALUE),i.slices=J.getValueOrUndefined(t.slices,Ye.MINIMUM_VALUE),i.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Ye.MINIMUM_VALUE),i.offsetAttribute=n!==ze.NONE?$t.ALL:void 0};Pd.prototype._onEntityPropertyChanged=Bp;Pd.DynamicGeometryUpdater=k1;function k1(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(k1.prototype=Object.create(ii.prototype),k1.prototype.constructor=k1);k1.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,b7e);return!c(o)||!c(i.length)||!c(i.topRadius)||!c(i.bottomRadius)||ii.prototype._isHidden.call(this,e,t,n)};k1.prototype._setOptions=function(e,t,n){let i=J.getValueOrDefault(t.heightReference,n,ze.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!==ze.NONE?$t.ALL:void 0};var qP=Pd;var Iri=_(T(),1);var yei=_(T(),1),g7e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},zr=Object.freeze(g7e);var xei=_(T(),1),x7e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},fo=Object.freeze(x7e);var Tei=_(T(),1),_7e={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3},ol=Object.freeze(_7e);var Lei=_(T(),1),ame=_(cd(),1);function T7e(e){if(!c(e))throw new L("uri is required.");let t=new ame.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Ob=T7e;var Xei=_(T(),1);var S7e=w.factorial;function fJ(e,t,n,i,o,r){let s=0,a,l,d;if(i>0){for(l=0;l<o;l++){for(a=!1,d=0;d<r.length&&!a;d++)l===r[d]&&(a=!0);a||(r.push(l),s+=fJ(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,l=0;l<o;l++){for(a=!1,d=0;d<r.length&&!a;d++)l===r[d]&&(a=!0);a||(s*=e-n[t[l]])}return s}var Uk={type:"Hermite"};Uk.getRequiredDataPoints=function(e,t){if(t=t??0,!c(e))throw new L("degree is required.");if(e<0)throw new L("degree must be 0 or greater.");if(t<0)throw new L("inputOrder must be 0 or greater.");return Math.max(Math.floor((e+1)/(t+1)),2)};Uk.interpolateOrderZero=function(e,t,n,i,o){c(o)||(o=new Array(i));let r,s,a,l,d,u,f=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let x=new Array(f);for(p[r]=x,s=0;s<f;s++)x[s]=[]}let y=f,h=new Array(y);for(r=0;r<y;r++)h[r]=r;let g=f-1;for(l=0;l<i;l++){for(s=0;s<y;s++)u=h[s]*i+l,p[l][0].push(n[u]);for(r=1;r<y;r++){let x=!1;for(s=0;s<y-r;s++){let S=t[h[s]],V=t[h[s+r]],Z;V-S<=0?(u=h[s]*i+i*r+l,Z=n[u],p[l][r].push(Z/S7e(r))):(Z=p[l][r-1][s+1]-p[l][r-1][s],p[l][r].push(Z/(V-S))),x=x||Z!==0}x||(g=r-1)}}for(a=0,d=0;a<=d;a++)for(r=a;r<=g;r++){let x=fJ(e,h,t,a,r,[]);for(l=0;l<i;l++){let S=p[l][r][0];o[l+a*i]+=S*x}}return o};var C7e=[];Uk.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);c(s)||(s=new Array(a));for(let S=0;S<a;S++)s[S]=0;let l=t.length,d=new Array(l*(o+1)),u;for(u=0;u<l;u++)for(let S=0;S<o+1;S++)d[u*(o+1)+S]=u;let f=d.length,p=C7e,y=V7e(p,d,t,n,i,o),h=[],g=f*(f+1)/2,x=Math.min(y,r);for(let S=0;S<=x;S++)for(u=S;u<=y;u++){h.length=0;let V=fJ(e,d,t,S,u,h),Z=Math.floor(u*(1-u)/2)+f*u;for(let R=0;R<i;R++){let E=Math.floor(R*g),I=p[E+Z];s[R+S*i]+=I*V}}return s};function V7e(e,t,n,i,o,r){let s,a,l=-1,d=t.length,u=d*(d+1)/2;for(let f=0;f<o;f++){let p=Math.floor(f*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+f,e[p+s]=i[a];for(let y=1;y<d;y++){let h=0,g=Math.floor(y*(1-y)/2)+d*y,x=!1;for(s=0;s<d-y;s++){let S=n[t[s]],V=n[t[s+y]],Z,R;if(V-S<=0)a=t[s]*o*(r+1)+o*y+f,Z=i[a],R=Z/w.factorial(y),e[p+g+h]=R,h++;else{let E=Math.floor((y-1)*(2-y)/2)+d*(y-1);Z=e[p+E+s+1]-e[p+E+s],R=Z/(V-S),e[p+g+h]=R,h++}x=x||Z!==0}x&&(l=Math.max(l,y))}}return l}var $P=Uk;var wei=_(T(),1);var hJ={type:"Lagrange"};hJ.getRequiredDataPoints=function(e){return Math.max(e+1,2)};hJ.interpolateOrderZero=function(e,t,n,i,o){c(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 l=1;for(s=0;s<a;s++)if(s!==r){let d=t[r]-t[s];l*=(e-t[s])/d}for(s=0;s<i;s++)o[s]+=l*n[r*i+s]}return o};var e2=hJ;var Aei=_(T(),1);var pJ={type:"Linear"};pJ.getRequiredDataPoints=function(e){return 2};pJ.interpolateOrderZero=function(e,t,n,i,o){if(t.length!==2)throw new L("The xTable provided to the linear interpolator must have exactly two elements.");if(i<=0)throw new L("There must be at least 1 dependent variable for each independent variable.");c(o)||(o=new Array(i));let r,s,a,l=t[0],d=t[1];if(l===d)throw new L("Divide by zero error: xTable[0] and xTable[1] are equal");for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+d*s-l*a)/(d-l);return o};var Qy=pJ;var Uei=_(T(),1);function Vc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Vc.fromCartesian3=function(e,t){C.typeOf.object("cartesian3",e);let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return c(t)||(t=new Vc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Vc.clone=function(e,t){if(c(e))return c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Vc(e.clock,e.cone,e.magnitude)};Vc.normalize=function(e,t){return C.typeOf.object("spherical",e),c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Vc(e.clock,e.cone,1)};Vc.equals=function(e,t){return e===t||c(e)&&c(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Vc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Vc.prototype.equals=function(e){return Vc.equals(this,e)};Vc.prototype.clone=function(e){return Vc.clone(this,e)};Vc.prototype.equalsEpsilon=function(e,t){return Vc.equalsEpsilon(this,e,t)};Vc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var t2=Vc;var s2=_(cd(),1);var ati=_(T(),1);var $ei=_(T(),1);var Dei=_(T(),1),bJ;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?bJ=function(){return performance.now()}:bJ=function(){return Date.now()};var Ti=bJ;function yJ(e){e=e??z.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;if(c(t)?t=ee.clone(t):c(n)?t=ee.clone(n):c(i)?t=ee.addDays(i,-1,new ee):t=ee.now(),c(n)?n=ee.clone(n):n=ee.clone(t),c(i)?i=ee.clone(i):i=ee.addDays(n,1,new ee),ee.greaterThan(n,i))throw new L("startTime must come before stopTime.");this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??zr.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new ye,this.onStop=new ye,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ti(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??fo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(yJ.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){ee.equals(this._currentTime,e)||(this._clockStep===fo.SYSTEM_CLOCK&&(this._clockStep=fo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===fo.SYSTEM_CLOCK&&(this._clockStep=fo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===fo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=ee.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===fo.SYSTEM_CLOCK&&(this._clockStep=fo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});yJ.prototype.tick=function(){let e=Ti(),t=ee.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===fo.SYSTEM_CLOCK)t=ee.now(t);else{let i=this._multiplier;if(n===fo.TICK_DEPENDENT)t=ee.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=ee.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===zr.CLAMPED)ee.lessThan(t,r)?t=ee.clone(r,t):ee.greaterThan(t,s)&&(t=ee.clone(s,t),this.onStop.raiseEvent(this));else if(o===zr.LOOP_STOP)for(ee.lessThan(t,r)&&(t=ee.clone(r,t));ee.greaterThan(t,s);)t=ee.addSeconds(r,ee.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var _f=yJ;function iT(){this._definitionChanged=new ye,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(iT.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Dc("startTime"),stopTime:Dc("stopTime"),currentTime:Dc("currentTime"),clockRange:Dc("clockRange"),clockStep:Dc("clockStep"),multiplier:Dc("multiplier")});iT.prototype.clone=function(e){return c(e)||(e=new iT),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};iT.prototype.equals=function(e){return this===e||c(e)&&ee.equals(this.startTime,e.startTime)&&ee.equals(this.stopTime,e.stopTime)&&ee.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};iT.prototype.merge=function(e){if(!c(e))throw new L("source is required.");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};iT.prototype.getValue=function(e){return c(e)||(e=new _f),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 Tf=iT;var yti=_(T(),1);var L7e=Y.WHITE,Z7e=.1,R7e=new D(8,8),G7e=new D(0,0),E7e=new D(1,1);function U1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(U1.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:fe("color"),cellAlpha:fe("cellAlpha"),lineCount:fe("lineCount"),lineThickness:fe("lineThickness"),lineOffset:fe("lineOffset")});U1.prototype.getType=function(e){return"Grid"};var X7e=new ee;U1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(X7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,L7e,t.color),t.cellAlpha=J.getValueOrDefault(this._cellAlpha,e,Z7e),t.lineCount=J.getValueOrClonedDefault(this._lineCount,e,R7e,t.lineCount),t.lineThickness=J.getValueOrClonedDefault(this._lineThickness,e,E7e,t.lineThickness),t.lineOffset=J.getValueOrClonedDefault(this._lineOffset,e,G7e,t.lineOffset),t};U1.prototype.equals=function(e){return this===e||e instanceof U1&&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 O1=U1;var Lti=_(T(),1);function D1(e){this._definitionChanged=new ye,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(D1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});D1.prototype.getType=function(e){return"PolylineArrow"};var I7e=new ee;D1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(I7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,Y.WHITE,t.color),t};D1.prototype.equals=function(e){return this===e||e instanceof D1&&J.equals(this._color,e._color)};var B1=D1;var Pti=_(T(),1);var W7e=Y.WHITE,w7e=Y.TRANSPARENT,P7e=16,v7e=255;function Y1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(Y1.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:fe("color"),gapColor:fe("gapColor"),dashLength:fe("dashLength"),dashPattern:fe("dashPattern")});Y1.prototype.getType=function(e){return"PolylineDash"};var F7e=new ee;Y1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(F7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,W7e,t.color),t.gapColor=J.getValueOrClonedDefault(this._gapColor,e,w7e,t.gapColor),t.dashLength=J.getValueOrDefault(this._dashLength,e,P7e,t.dashLength),t.dashPattern=J.getValueOrDefault(this._dashPattern,e,v7e,t.dashPattern),t};Y1.prototype.equals=function(e){return this===e||e instanceof Y1&&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 H1=Y1;var Dti=_(T(),1);var A7e=Y.WHITE,M7e=.25,N7e=1;function z1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(z1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),glowPower:fe("glowPower"),taperPower:fe("taperPower")});z1.prototype.getType=function(e){return"PolylineGlow"};var k7e=new ee;z1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(k7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,A7e,t.color),t.glowPower=J.getValueOrDefault(this._glowPower,e,M7e,t.glowPower),t.taperPower=J.getValueOrDefault(this._taperPower,e,N7e,t.taperPower),t};z1.prototype.equals=function(e){return this===e||e instanceof z1&&J.equals(this._color,e._color)&&J.equals(this._glowPower,e._glowPower)&&J.equals(this._taperPower,e._taperPower)};var K1=z1;var qti=_(T(),1);var U7e=Y.WHITE,O7e=Y.BLACK,D7e=1;function J1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(J1.prototype,{isConstant:{get:function(){return J.isConstant(this._color)&&J.isConstant(this._outlineColor)&&J.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth")});J1.prototype.getType=function(e){return"PolylineOutline"};var B7e=new ee;J1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(B7e)),c(t)||(t={}),t.color=J.getValueOrClonedDefault(this._color,e,U7e,t.color),t.outlineColor=J.getValueOrClonedDefault(this._outlineColor,e,O7e,t.outlineColor),t.outlineWidth=J.getValueOrDefault(this._outlineWidth,e,D7e),t};J1.prototype.equals=function(e){return this===e||e instanceof J1&&J.equals(this._color,e._color)&&J.equals(this._outlineColor,e._outlineColor)&&J.equals(this._outlineWidth,e._outlineWidth)};var jy=J1;var ani=_(T(),1);function Db(e,t){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new hr,this._referenceFrame=t??Ui.FIXED,this.setValue(e)}Object.defineProperties(Db.prototype,{isConstant:{get:function(){let e=this._value;if(!c(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 Y7e=new ee;Db.prototype.getValue=function(e,t){return c(e)||(e=ee.now(Y7e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};Db.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._value;if(!c(i))return;let o=i.length;c(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let l=i[r].getValueInReferenceFrame(e,t,n[r]);c(l)&&(n[s]=l,s++),r++}return n.length=s,n};Db.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,Db.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Db.prototype.equals=function(e){return this===e||e instanceof Db&&this._referenceFrame===e._referenceFrame&&J.arrayEquals(this._value,e._value)};Db.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Bb=Db;var hni=_(T(),1);function qy(e){this._value=void 0,this._definitionChanged=new ye,this._eventHelper=new hr,this.setValue(e)}Object.defineProperties(qy.prototype,{isConstant:{get:function(){let e=this._value;if(!c(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 H7e=new ee;qy.prototype.getValue=function(e,t){c(e)||(e=ee.now(H7e));let n=this._value;if(!c(n))return;let i=n.length;c(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);c(a)&&(t[r]=a,r++),o++}return t.length=r,t};qy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,qy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};qy.prototype.equals=function(e){return this===e||e instanceof qy&&J.arrayEquals(this._value,e._value)};qy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Q1=qy;var Tni=_(T(),1);function oT(e){let t=e._targetProperty;if(!c(t)){let n=e._targetEntity;if(!c(n)){if(n=e._targetCollection.getById(e._targetId),!c(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(vd.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&c(t);++o)t=t[i[o]];e._targetProperty=t}return t}function vd(e,t,n){if(!c(e))throw new L("targetCollection is required.");if(!c(t)||t==="")throw new L("targetId is required.");if(!c(n)||n.length===0)throw new L("targetPropertyNames is required.");for(let i=0;i<n.length;i++){let o=n[i];if(!c(o)||o==="")throw new L("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new ye,e.collectionChanged.addEventListener(vd.prototype._onCollectionChanged,this)}Object.defineProperties(vd.prototype,{isConstant:{get:function(){return J.isConstant(oT(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=oT(this);return c(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 oT(this)}}});vd.fromString=function(e,t){if(!c(e))throw new L("targetCollection is required.");if(!c(t))throw new L("referenceString is required.");let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let l=t.charAt(a);r?(s+=l,r=!1):l==="\\"?r=!0:o&&l==="#"?(n=s,o=!1,s=""):!o&&l==="."?(i.push(s),s=""):s+=l}return i.push(s),new vd(e,n,i)};var z7e=new ee;vd.prototype.getValue=function(e,t){let n=oT(this);return c(e)||(e=ee.now(z7e)),c(n)?n.getValue(e,t):void 0};vd.prototype.getValueInReferenceFrame=function(e,t,n){let i=oT(this);return c(i)?i.getValueInReferenceFrame(e,t,n):void 0};vd.prototype.getType=function(e){let t=oT(this);return c(t)?t.getType(e):void 0};vd.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};vd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){c(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};vd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;c(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(vd.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):c(i)||(i=oT(this),c(i)&&this._definitionChanged.raiseEvent(this))};var Yb=vd;var Zni=_(T(),1);var K7e={packedLength:1,pack:function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,t[n]=e,t},unpack:function(e,t,n){if(!c(e))throw new L("array is required");return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){if(!c(e))throw new L("packedArray is required");c(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-w.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){if(!c(e))throw new L("array is required");if(!c(t))throw new L("sourceArray is required");return o=e[0],o<0?o+w.TWO_PI:o}},qu=K7e;var Kni=_(T(),1);var Fni=_(T(),1);var cme={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 lme(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 dme(e,t){return e instanceof ee?e:typeof e=="string"?ee.fromIso8601(e):ee.addSeconds(t,e,new ee)}var gJ=[],xJ=[];function Ok(e,t,n,i,o){let r=0,s,a,l,d,u,f;for(;r<i.length;){u=dme(i[r],e),l=Wo(t,u,ee.compare);let p=0,y=0;if(l<0){for(l=~l,d=l*o,a=void 0,f=t[l];r<i.length&&(u=dme(i[r],e),!(c(a)&&ee.compare(a,u)>=0||c(f)&&ee.compare(u,f)>=0));){for(gJ[p++]=u,r=r+1,s=0;s<o;s++)xJ[y++]=i[r],r=r+1;a=u}p>0&&(xJ.length=y,lme(n,d,xJ),gJ.length=p,lme(t,l,gJ))}else{for(s=0;s<o;s++)r++,n[l*o+s]=i[r];r++}}}function $u(e,t){C.defined("type",e);let n=e;n===Number&&(n=cme);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(c(t)){let a=t.length;s=new Array(a);for(let l=0;l<a;l++){let d=t[l];d===Number&&(d=cme);let u=d.packedLength;i+=u,o+=d.packedInterpolationLength??u,s[l]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Qy,this._lastInterpolationAlgorithm=Qy,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 ye,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=ol.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=ol.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties($u.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 J7e=new ee;$u.prototype.getValue=function(e,t){c(e)||(e=ee.now(J7e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Wo(n,e,ee.compare);var l=!1;if(a<0){if(a=~a,a===0){let I=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===ol.NONE||o!==0&&ee.secondsDifference(I,e)>o)return;if(this._backwardExtrapolationType===ol.HOLD)return r.unpack(s,0,t);l=this._backwardExtrapolationType===ol.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let I=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===ol.NONE||o!==0&&ee.secondsDifference(e,I)>o)return;if(this._forwardExtrapolationType===ol.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);l=this._forwardExtrapolationType===ol.LINEAR_EXTRAPOLATE}let f=this._xTable,p=this._yTable;var d,u;l?(d=Cesium.LinearApproximation,u=1):(d=this._interpolationAlgorithm,u=this._interpolationDegree),this._lastInterpolationAlgorithm!=d&&(this._lastInterpolationAlgorithm=d,this._updateTableLength=!0);let y=this._packedInterpolationLength,h=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let I=Math.min(d.getRequiredDataPoints(u,h),i);I!==this._numberOfPoints&&(this._numberOfPoints=I,f.length=I,p.length=I*y)}let g=this._numberOfPoints-1;if(g<1)return;let x=0,S=i-1;if(S-x+1>=g+1){let I=a-(g/2|0)-1;I<x&&(I=x);let v=I+g;v>S&&(v=S,I=v-g,I<x&&(I=x)),x=I,S=v}let Z=S-x+1;for(let I=0;I<Z;++I)f[I]=ee.secondsDifference(n[x+I],n[S]);if(c(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,x,S,p);else{let I=0,v=this._packedLength,P=x*v,F=(S+1)*v;for(;P<F;)p[I]=s[P],P++,I++}let R=ee.secondsDifference(e,n[S]),E;if(h===0||!c(d.interpolate))E=d.interpolateOrderZero(R,f,p,y,this._interpolationResult);else{let I=Math.floor(y/(h+1));E=d.interpolate(R,f,p,I,h,h,this._interpolationResult)}return c(r.unpackInterpolationResult)?r.unpackInterpolationResult(E,s,x,S,t):r.unpack(E,0,t)}return r.unpack(s,a*this._packedLength,t)};$u.prototype.setInterpolationOptions=function(e){if(!c(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;c(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),c(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};$u.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);C.defined("time",e),C.defined("value",t),o&&C.defined("derivatives",n);let r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let l=0;l<a;l++)i[l].pack(n[l],s,s.length)}Ok(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};$u.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);if(C.defined("times",e),C.defined("values",t),e.length!==t.length)throw new L("times and values must be the same length.");if(o&&(!c(n)||n.length!==e.length))throw new L("times and derivativeValues must be the same length.");let r=this._innerType,s=e.length,a=[];for(let l=0;l<s;l++)if(a.push(e[l]),r.pack(t[l],a,a.length),o){let d=n[l],u=i.length;for(let f=0;f<u;f++)i[f].pack(d[f],a,a.length)}Ok(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};$u.prototype.getSample=function(e){C.typeOf.number("index",e);let t=this._times,n=t.length;if(c(n))return e<0&&(e+=n),t[e]};$u.prototype.addSamplesPackedArray=function(e,t){C.defined("packedSamples",e),Ok(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};$u.prototype.removeSample=function(e){C.defined("time",e);let t=Wo(this._times,e,ee.compare);return t<0?!1:(ume(this,t,1),!0)};function ume(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)}$u.prototype.removeSamples=function(e){C.defined("timeInterval",e);let t=this._times,n=Wo(t,e.start,ee.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Wo(t,e.stop,ee.compare);i<0?i=~i:e.isStopIncluded&&++i,ume(this,n,i-n)};$u.prototype.equals=function(e){if(this===e)return!0;if(!c(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=c(t),i=e._derivativeTypes,o=c(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,l=e._times;if(s=a.length,s!==l.length)return!1;for(r=0;r<s;r++)if(!ee.equals(a[r],l[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};$u._mergeNewSamples=Ok;var Fd=$u;function em(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=m}this._numberOfDerivatives=t,this._property=new Fd(m,n),this._definitionChanged=new ye,this._referenceFrame=e??Ui.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(em.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 Q7e=new ee;em.prototype.getValue=function(e,t){return c(e)||(e=ee.now(Q7e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};em.prototype.getValueInReferenceFrame=function(e,t,n){if(C.defined("time",e),C.defined("referenceFrame",t),n=this._property.getValue(e,n),c(n))return Mm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};em.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};em.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;if(i>0&&(!c(n)||n.length!==i))throw new L("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,n)};em.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};em.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};em.prototype.removeSample=function(e){return this._property.removeSample(e)};em.prototype.removeSamples=function(e){this._property.removeSamples(e)};em.prototype.equals=function(e){return this===e||e instanceof em&&J.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var xa=em;var sii=_(T(),1);var Qni=_(T(),1),j7e={HORIZONTAL:0,VERTICAL:1},Sf=Object.freeze(j7e);var q7e=Sf.HORIZONTAL,$7e=Y.WHITE,e6e=Y.BLACK,t6e=0,n6e=1;function j1(e){e=e??z.EMPTY_OBJECT,this._definitionChanged=new ye,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(j1.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:fe("orientation"),evenColor:fe("evenColor"),oddColor:fe("oddColor"),offset:fe("offset"),repeat:fe("repeat")});j1.prototype.getType=function(e){return"Stripe"};var i6e=new ee;j1.prototype.getValue=function(e,t){return c(e)||(e=ee.now(i6e)),c(t)||(t={}),t.horizontal=J.getValueOrDefault(this._orientation,e,q7e)===Sf.HORIZONTAL,t.evenColor=J.getValueOrClonedDefault(this._evenColor,e,$7e,t.evenColor),t.oddColor=J.getValueOrClonedDefault(this._oddColor,e,e6e,t.oddColor),t.offset=J.getValueOrDefault(this._offset,e,t6e),t.repeat=J.getValueOrDefault(this._repeat,e,n6e),t};j1.prototype.equals=function(e){return this===e||e instanceof j1&&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 q1=j1;var bii=_(T(),1);function $y(e){this._definitionChanged=new ye,this._intervals=new Yr,this._intervals.changedEvent.addEventListener($y.prototype._intervalsChanged,this),this._referenceFrame=e??Ui.FIXED}Object.defineProperties($y.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 o6e=new ee;$y.prototype.getValue=function(e,t){return c(e)||(e=ee.now(o6e)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};$y.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");let i=this._intervals.findDataForIntervalContainingDate(e);if(c(i))return Mm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};$y.prototype.equals=function(e){return this===e||e instanceof $y&&this._intervals.equals(e._intervals,J.equals)&&this._referenceFrame===e._referenceFrame};$y.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Hb=$y;var Cii=_(T(),1);function rT(){this._definitionChanged=new ye,this._intervals=new Yr,this._intervals.changedEvent.addEventListener(rT.prototype._intervalsChanged,this)}Object.defineProperties(rT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var r6e=new ee;rT.prototype.getValue=function(e,t){c(e)||(e=ee.now(r6e));let n=this._intervals.findDataForIntervalContainingDate(e);return c(n)&&typeof n.clone=="function"?n.clone(t):n};rT.prototype.equals=function(e){return this===e||e instanceof rT&&this._intervals.equals(e._intervals,J.equals)};rT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var zb=rT;var Oii=_(T(),1);var Xii=_(T(),1);function $1(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new ye,this._normalize=t??!0,this.position=e}Object.defineProperties($1.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&&(c(t)&&this._subscription(),this._position=e,c(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 s6e=new m,mme=new m,fme=new ee,a6e=new ee,_J=1/60;$1.prototype.getValue=function(e,t){return this._getValue(e,t)};$1.prototype._getValue=function(e,t,n){c(e)||(e=ee.now(a6e)),c(t)||(t=new m);let i=this._position;if(J.isConstant(i))return this._normalize?void 0:m.clone(m.ZERO,t);let o=i.getValue(e,s6e),r=i.getValue(ee.addSeconds(e,_J,fme),mme);if(!c(o)||!c(r)&&(r=o,o=i.getValue(ee.addSeconds(e,-_J,fme),mme),!c(o)))return;if(m.equals(o,r))return this._normalize?void 0:m.clone(m.ZERO,t);c(n)&&o.clone(n);let s=m.subtract(r,o,t);return this._normalize?m.normalize(s,t):m.divideByScalar(s,_J,t)};$1.prototype.equals=function(e){return this===e||e instanceof $1&&J.equals(this._position,e._position)};var Kb=$1;function n2(e,t){this._velocityVectorProperty=new Kb(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new ye,this.ellipsoid=t??re.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(n2.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 hme=new m,c6e=new m,pme=new te,l6e=new ee;n2.prototype.getValue=function(e,t){c(e)||(e=ee.now(l6e));let n=this._velocityVectorProperty._getValue(e,c6e,hme);if(c(n))return wt.rotationMatrixFromPositionVelocity(hme,n,this._ellipsoid,pme),Fe.fromRotationMatrix(pme,t)};n2.prototype.equals=function(e){return this===e||e instanceof n2&&J.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var i2=n2;var Yii=_(T(),1);var Jb={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Jb.validate=function(e){return e===Jb.COMPLETE||e===Jb.BELOW_ELLIPSOID_HORIZON||e===Jb.ABOVE_ELLIPSOID_HORIZON};Jb.toString=function(e){switch(e){case Jb.COMPLETE:return"COMPLETE";case Jb.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Jb.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new L("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var eV=Jb;function eg(){}eg.packedLength=m.packedLength;eg.unpack=m.unpack;eg.pack=m.pack;var TJ;function o2(e,t){return t[0]==="#"&&(t=TJ+t),Yb.fromString(e,t)}function bme(e,t,n){if(c(n.reference))return o2(t,n.reference);if(c(n.velocityReference)){let i=o2(t,n.velocityReference);switch(e){case m:case eg:return new Kb(i,e===eg);case Fe:return new i2(i)}}throw new le(`${JSON.stringify(n)} is not valid CZML.`)}function d6e(e,t){return new Om(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Yi=new m,rl=new t2,Lc=new pe,sT=new Zn,Dk=new Fe;function u6e(e){let t=e.rgbaf;if(c(t))return t;let n=e.rgba;if(!c(n))return;let i=n.length;if(i===Y.packedLength)return[Y.byteToFloat(n[0]),Y.byteToFloat(n[1]),Y.byteToFloat(n[2]),Y.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=Y.byteToFloat(n[o+1]),t[o+2]=Y.byteToFloat(n[o+2]),t[o+3]=Y.byteToFloat(n[o+3]),t[o+4]=Y.byteToFloat(n[o+4]);return t}function yme(e,t){let n=e.uri??e;return c(t)?t.getDerivedResource({url:n}):Ge.createIfNeeded(n)}function m6e(e){let t=e.wsen;if(c(t))return t;let n=e.wsenDegrees;if(!c(n))return;let i=n.length;if(i===de.packedLength)return[w.toRadians(n[0]),w.toRadians(n[1]),w.toRadians(n[2]),w.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=w.toRadians(n[o+1]),t[o+2]=w.toRadians(n[o+2]),t[o+3]=w.toRadians(n[o+3]),t[o+4]=w.toRadians(n[o+4]);return t}function f6e(e){let t=e.length;if(rl.magnitude=1,t===2)return rl.clock=e[0],rl.cone=e[1],m.fromSpherical(rl,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],rl.clock=e[i+1],rl.cone=e[i+2],m.fromSpherical(rl,Yi),n[o+1]=Yi.x,n[o+2]=Yi.y,n[o+3]=Yi.z;return n}function h6e(e){let t=e.length;if(t===3)return rl.clock=e[0],rl.cone=e[1],rl.magnitude=e[2],m.fromSpherical(rl,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],rl.clock=e[i+1],rl.cone=e[i+2],rl.magnitude=e[i+3],m.fromSpherical(rl,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function p6e(e){let t=e.length;if(t===3)return Lc.longitude=e[0],Lc.latitude=e[1],Lc.height=e[2],re.default.cartographicToCartesian(Lc,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Lc.longitude=e[i+1],Lc.latitude=e[i+2],Lc.height=e[i+3],re.default.cartographicToCartesian(Lc,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function b6e(e){let t=e.length;if(t===3)return Lc.longitude=w.toRadians(e[0]),Lc.latitude=w.toRadians(e[1]),Lc.height=e[2],re.default.cartographicToCartesian(Lc,Yi),[Yi.x,Yi.y,Yi.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Lc.longitude=w.toRadians(e[i+1]),Lc.latitude=w.toRadians(e[i+2]),Lc.height=e[i+3],re.default.cartographicToCartesian(Lc,Yi),n[i+1]=Yi.x,n[i+2]=Yi.y,n[i+3]=Yi.z;return n}function SJ(e){let t=e.cartesian;if(c(t))return t;let n=e.cartesianVelocity;if(c(n))return n;let i=e.unitCartesian;if(c(i))return i;let o=e.unitSpherical;if(c(o))return f6e(o);let r=e.spherical;if(c(r))return h6e(r);let s=e.cartographicRadians;if(c(s))return p6e(s);let a=e.cartographicDegrees;if(c(a))return b6e(a);throw new le(`${JSON.stringify(e)} is not a valid CZML interval.`)}function gme(e,t){m.unpack(e,t,Yi),m.normalize(Yi,Yi),m.pack(Yi,e,t)}function y6e(e){let t=SJ(e);if(t.length===3)return gme(t,0),t;for(let n=1;n<t.length;n+=4)gme(t,n);return t}function xme(e,t){Fe.unpack(e,t,Dk),Fe.normalize(Dk,Dk),Fe.pack(Dk,e,t)}function g6e(e){let t=e.unitQuaternion;if(c(t)){if(t.length===4)return xme(t,0),t;for(let n=1;n<t.length;n+=5)xme(t,n)}return t}function _me(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")?je:e.hasOwnProperty("cartesian2")?D:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?m:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?eg:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?Y:e.hasOwnProperty("arcType")?Kt:e.hasOwnProperty("classificationType")?Un:e.hasOwnProperty("colorBlendMode")?bc:e.hasOwnProperty("cornerType")?Fi:e.hasOwnProperty("heightReference")?ze:e.hasOwnProperty("horizontalOrigin")?xi:e.hasOwnProperty("date")?ee:e.hasOwnProperty("labelStyle")?Yo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Nt:e.hasOwnProperty("distanceDisplayCondition")?vt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Fe:e.hasOwnProperty("shadowMode")?Sn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Sf:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?de:e.hasOwnProperty("uri")?s2.default:e.hasOwnProperty("verticalOrigin")?Mn:Object}function x6e(e,t,n){switch(e){case Kt:return Kt[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case je:return t.boundingRectangle;case D:return t.cartesian2;case m:return SJ(t);case eg:return y6e(t);case Y:return u6e(t);case Un:return Un[t.classificationType??t];case bc:return bc[t.colorBlendMode??t];case Fi:return Fi[t.cornerType??t];case ze:return ze[t.heightReference??t];case xi:return xi[t.horizontalOrigin??t];case Image:return yme(t,n);case ee:return ee.fromIso8601(t.date??t);case Yo:return Yo[t.labelStyle??t];case Number:return t.number??t;case Nt:return t.nearFarScalar;case vt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Fe:return g6e(t);case qu:return t.number??t;case eV:return eV[t.portionToDisplay??t];case Sn:return Sn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Sf:return Sf[t.stripeOrientation??t];case de:return m6e(t);case s2.default:return yme(t,n);case Mn:return Mn[t.verticalOrigin??t];default:throw new le(`Unknown CzmlDataSource interval type: ${e}`)}}var _6e={HERMITE:$P,LAGRANGE:e2,LINEAR:Qy};function Bk(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(c(n)||c(i))&&t.setInterpolationOptions({interpolationAlgorithm:_6e[n],interpolationDegree:i});let o=e.forwardExtrapolationType;c(o)&&(t.forwardExtrapolationType=ol[o]);let r=e.forwardExtrapolationDuration;c(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;c(s)&&(t.backwardExtrapolationType=ol[s]);let a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}var Tme={iso8601:void 0};function pr(e){if(c(e))return Tme.iso8601=e,Zn.fromIso8601(Tme)}function CJ(e){let t=Ye.MAXIMUM_INTERVAL.clone();return t.data=e,t}function Sme(e){let t=new Sc;return t.intervals.addInterval(CJ(e)),t}function Cme(e){let t=new ya(e.referenceFrame);return t.intervals.addInterval(CJ(e)),t}function Yk(e,t,n,i,o,r,s){let a=pr(i.interval);c(o)&&(c(a)?a=Zn.intersect(a,o,sT):a=o);let l,d,u,f=!c(i.reference)&&!c(i.velocityReference),p=c(a)&&!a.equals(Ye.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Pme(t[n],a)}let y=!1;if(f){if(d=x6e(e,i,r),!c(d))return;l=e.packedLength??1,u=d.length??1,y=!c(i.array)&&typeof d!="string"&&u>l&&e!==Object}let h=typeof e.unpack=="function"&&e!==qu;if(!y&&!p){f?t[n]=new Qn(h?e.unpack(d,0):d):t[n]=bme(e,s,i);return}let g=t[n],x,S=i.epoch;if(c(S)&&(x=ee.fromIso8601(S)),y&&!p){g instanceof Fd||(t[n]=g=new Fd(e)),g.addSamplesPackedArray(d,x),Bk(i,g);return}let V;if(!y&&p){a=a.clone(),f?a.data=h?e.unpack(d,0):d:a.data=bme(e,s,i),c(g)||(t[n]=g=f?new zb:new Sc),f&&g instanceof zb?g.intervals.addInterval(a):g instanceof Sc?(f&&(a.data=new Qn(a.data)),g.intervals.addInterval(a)):(t[n]=g=Sme(g),f&&(a.data=new Qn(a.data)),g.intervals.addInterval(a));return}c(g)||(t[n]=g=new Sc),g instanceof Sc||(t[n]=g=Sme(g));let Z=g.intervals;V=Z.findInterval(a),(!c(V)||!(V.data instanceof Fd))&&(V=a.clone(),V.data=new Fd(e),Z.addInterval(V)),V.data.addSamplesPackedArray(d,x),Bk(i,V.data)}function Pme(e,t){if(e instanceof Fd){e.removeSamples(t);return}else if(e instanceof zb){e.intervals.removeInterval(t);return}else if(e instanceof Sc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Zn.intersect(n.get(i),t,sT);o.isEmpty||Pme(o.data,t)}n.removeInterval(t);return}}function Te(e,t,n,i,o,r,s){if(c(i))if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a)Yk(e,t,n,i[a],o,r,s);else Yk(e,t,n,i,o,r,s)}function Vme(e,t,n,i,o,r){let s=pr(n.interval);c(i)&&(c(s)?s=Zn.intersect(s,i,sT):s=i);let a=c(n.cartesianVelocity)?1:0,l=m.packedLength*(a+1),d,u,f=!c(n.reference),p=c(s)&&!s.equals(Ye.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return vme(e[t],s)}let y,h=!1;if(f&&(c(n.referenceFrame)&&(y=Ui[n.referenceFrame]),y=y??Ui.FIXED,d=SJ(n),u=d.length??1,h=u>l),!h&&!p){f?e[t]=new Oc(m.unpack(d),y):e[t]=o2(r,n.reference);return}let g=e[t],x,S=n.epoch;if(c(S)&&(x=ee.fromIso8601(S)),h&&!p){(!(g instanceof xa)||c(y)&&g.referenceFrame!==y)&&(e[t]=g=new xa(y,a)),g.addSamplesPackedArray(d,x),Bk(n,g);return}let V;if(!h&&p){s=s.clone(),f?s.data=m.unpack(d):s.data=o2(r,n.reference),c(g)||(f?g=new Hb(y):g=new ya(y),e[t]=g),f&&g instanceof Hb&&c(y)&&g.referenceFrame===y?g.intervals.addInterval(s):g instanceof ya?(f&&(s.data=new Oc(s.data,y)),g.intervals.addInterval(s)):(e[t]=g=Cme(g),f&&(s.data=new Oc(s.data,y)),g.intervals.addInterval(s));return}c(g)?g instanceof ya||(e[t]=g=Cme(g)):e[t]=g=new ya(y);let Z=g.intervals;V=Z.findInterval(s),(!c(V)||!(V.data instanceof xa)||c(y)&&V.data.referenceFrame!==y)&&(V=s.clone(),V.data=new xa(y,a),Z.addInterval(V)),V.data.addSamplesPackedArray(d,x),Bk(n,V.data)}function vme(e,t){if(e instanceof xa){e.removeSamples(t);return}else if(e instanceof Hb){e.intervals.removeInterval(t);return}else if(e instanceof ya){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Zn.intersect(n.get(i),t,sT);o.isEmpty||vme(o.data,t)}n.removeInterval(t);return}}function Fme(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Vme(e,t,n[s],i,o,r);else Vme(e,t,n,i,o,r)}function Lme(e,t,n,i){c(n.references)?Hk(e,t,n.references,n.interval,i,Q1,Sc):(c(n.cartesian2)?n.array=D.unpackArray(n.cartesian2):c(n.cartesian)&&(n.array=D.unpackArray(n.cartesian)),c(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function Zme(e,t,n,i,o,r){let s=pr(n.interval);c(i)&&(c(s)?s=Zn.intersect(s,i,sT):s=i);let a=e[t],l,d;if(c(s)){a instanceof W1||(a=new W1,e[t]=a);let f=a.intervals;d=f.findInterval({start:s.start,stop:s.stop}),c(d)?l=d.data:(d=s.clone(),f.addInterval(d))}else l=a;let u;c(n.solidColor)?(l instanceof Ut||(l=new Ut),u=n.solidColor,Te(Y,l,"color",u.color,void 0,void 0,r)):c(n.grid)?(l instanceof O1||(l=new O1),u=n.grid,Te(Y,l,"color",u.color,void 0,o,r),Te(Number,l,"cellAlpha",u.cellAlpha,void 0,o,r),Te(D,l,"lineCount",u.lineCount,void 0,o,r),Te(D,l,"lineThickness",u.lineThickness,void 0,o,r),Te(D,l,"lineOffset",u.lineOffset,void 0,o,r)):c(n.image)?(l instanceof $0||(l=new $0),u=n.image,Te(Image,l,"image",u.image,void 0,o,r),Te(D,l,"repeat",u.repeat,void 0,o,r),Te(Y,l,"color",u.color,void 0,o,r),Te(Boolean,l,"transparent",u.transparent,void 0,o,r)):c(n.stripe)?(l instanceof q1||(l=new q1),u=n.stripe,Te(Sf,l,"orientation",u.orientation,void 0,o,r),Te(Y,l,"evenColor",u.evenColor,void 0,o,r),Te(Y,l,"oddColor",u.oddColor,void 0,o,r),Te(Number,l,"offset",u.offset,void 0,o,r),Te(Number,l,"repeat",u.repeat,void 0,o,r)):c(n.polylineOutline)?(l instanceof jy||(l=new jy),u=n.polylineOutline,Te(Y,l,"color",u.color,void 0,o,r),Te(Y,l,"outlineColor",u.outlineColor,void 0,o,r),Te(Number,l,"outlineWidth",u.outlineWidth,void 0,o,r)):c(n.polylineGlow)?(l instanceof K1||(l=new K1),u=n.polylineGlow,Te(Y,l,"color",u.color,void 0,o,r),Te(Number,l,"glowPower",u.glowPower,void 0,o,r),Te(Number,l,"taperPower",u.taperPower,void 0,o,r)):c(n.polylineArrow)?(l instanceof B1||(l=new B1),u=n.polylineArrow,Te(Y,l,"color",u.color,void 0,void 0,r)):c(n.polylineDash)?(l instanceof H1||(l=new H1),u=n.polylineDash,Te(Y,l,"color",u.color,void 0,void 0,r),Te(Y,l,"gapColor",u.gapColor,void 0,void 0,r),Te(Number,l,"dashLength",u.dashLength,void 0,o,r),Te(Number,l,"dashPattern",u.dashPattern,void 0,o,r)):c(n.checkerboard)&&(l instanceof X1||(l=new X1),u=n.checkerboard,Te(Y,l,"evenColor",u.evenColor,void 0,o,r),Te(Y,l,"oddColor",u.oddColor,void 0,o,r),Te(D,l,"repeat",u.repeat,void 0,o,r)),c(d)?d.data=l:e[t]=l}function Ad(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Zme(e,t,n[s],i,o,r);else Zme(e,t,n,i,o,r)}function T6e(e,t,n,i){let o=t.name;c(o)&&(e.name=t.name)}function S6e(e,t,n,i){let o=t.description;c(o)&&Te(String,e,"description",o,void 0,i,n)}function C6e(e,t,n,i){let o=t.position;c(o)&&Fme(e,"position",o,void 0,i,n)}function V6e(e,t,n,i){let o=t.viewFrom;c(o)&&Te(m,e,"viewFrom",o,void 0,i,n)}function L6e(e,t,n,i){let o=t.orientation;c(o)&&Te(Fe,e,"orientation",o,void 0,i,n)}function Z6e(e,t,n,i){let o=t.properties;if(c(o)){c(e.properties)||(e.properties=new Bc);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,l=s.length;a<l;++a)Yk(_me(s[a]),e.properties,r,s[a],void 0,i,n);else Yk(_me(s),e.properties,r,s,void 0,i,n)}}}function Hk(e,t,n,i,o,r,s){let a=n.map(function(l){return o2(o,l)});if(c(i)){i=pr(i);let l=e[t];if(!(l instanceof s)){let d=new s;d.intervals.addInterval(CJ(l)),e[t]=l=d}i.data=new r(a),l.intervals.addInterval(i)}else e[t]=new r(a)}function Rme(e,t,n,i){let o=n.references;c(o)?Hk(e,t,o,n.interval,i,Q1,Sc):Te(Array,e,t,n,void 0,void 0,i)}function Gme(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Rme(e,t,n[o],i);else Rme(e,t,n,i)}function Eme(e,t,n,i){let o=n.references;c(o)?Hk(e,t,o,n.interval,i,Bb,ya):(c(n.cartesian)?n.array=m.unpackArray(n.cartesian):c(n.cartographicRadians)?n.array=m.fromRadiansArrayHeights(n.cartographicRadians,re.default):c(n.cartographicDegrees)&&(n.array=m.fromDegreesArrayHeights(n.cartographicDegrees,re.default)),c(n.array)&&Te(Array,e,t,n,void 0,void 0,i))}function a2(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Eme(e,t,n[o],i);else Eme(e,t,n,i)}function R6e(e){return m.unpackArray(e)}function G6e(e){return m.fromRadiansArrayHeights(e,re.default)}function E6e(e){return m.fromDegreesArrayHeights(e,re.default)}function Xme(e,t,n,i){let o=n.references;if(c(o)){let r=o.map(function(s){let a={};return Hk(a,"positions",s,n.interval,i,Bb,ya),a.positions});e[t]=new Bb(r)}else c(n.cartesian)?n.array=n.cartesian.map(R6e):c(n.cartographicRadians)?n.array=n.cartographicRadians.map(G6e):c(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(E6e)),c(n.array)&&Te(Array,e,t,n,void 0,void 0,i)}function X6e(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)Xme(e,t,n[o],i);else Xme(e,t,n,i)}function I6e(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)Lme(e,t,n[o],i);else Lme(e,t,n,i)}function W6e(e,t,n,i){let o=t.availability;if(!c(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)c(r)||(r=new Yr),r.addInterval(pr(o[s]));else r=new Yr,r.addInterval(pr(o));e.availability=r}function w6e(e,t,n,i,o){c(t)&&Te(eg,e,"alignedAxis",t,n,i,o)}function P6e(e,t,n,i){let o=t.billboard;if(!c(o))return;let r=pr(o.interval),s=e.billboard;c(s)||(e.billboard=s=new cc),Te(Boolean,s,"show",o.show,r,i,n),Te(Image,s,"image",o.image,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(D,s,"pixelOffset",o.pixelOffset,r,i,n),Te(m,s,"eyeOffset",o.eyeOffset,r,i,n),Te(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(Mn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"color",o.color,r,i,n),Te(qu,s,"rotation",o.rotation,r,i,n),w6e(s,o.alignedAxis,r,i,n),Te(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(Nt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(Nt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(Nt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te(je,s,"imageSubRegion",o.imageSubRegion,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function v6e(e,t,n,i){let o=t.box;if(!c(o))return;let r=pr(o.interval),s=e.box;c(s)||(e.box=s=new Nx),Te(Boolean,s,"show",o.show,r,i,n),Te(m,s,"dimensions",o.dimensions,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function F6e(e,t,n,i){let o=t.corridor;if(!c(o))return;let r=pr(o.interval),s=e.corridor;c(s)||(e.corridor=s=new Ux),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"positions",o.positions,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(Fi,s,"cornerType",o.cornerType,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function A6e(e,t,n,i){let o=t.cylinder;if(!c(o))return;let r=pr(o.interval),s=e.cylinder;c(s)||(e.cylinder=s=new Ox),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"length",o.length,r,i,n),Te(Number,s,"topRadius",o.topRadius,r,i,n),Te(Number,s,"bottomRadius",o.bottomRadius,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(Number,s,"slices",o.slices,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function M6e(e,t){let n=e.version;if(c(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new le("Cesium only supports CZML version 1.");t._version=n}}if(!c(t._version))throw new le("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;c(e.name)&&(i.name=e.name);let o=e.clock;if(c(o)){let r=i.clock;c(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 N6e(e,t,n,i){let o=t.ellipse;if(!c(o))return;let r=pr(o.interval),s=e.ellipse;c(s)||(e.ellipse=s=new Dx),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Te(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(qu,s,"rotation",o.rotation,r,i,n),Te(qu,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function k6e(e,t,n,i){let o=t.ellipsoid;if(!c(o))return;let r=pr(o.interval),s=e.ellipsoid;c(s)||(e.ellipsoid=s=new Bx),Te(Boolean,s,"show",o.show,r,i,n),Te(m,s,"radii",o.radii,r,i,n),Te(m,s,"innerRadii",o.innerRadii,r,i,n),Te(Number,s,"minimumClock",o.minimumClock,r,i,n),Te(Number,s,"maximumClock",o.maximumClock,r,i,n),Te(Number,s,"minimumCone",o.minimumCone,r,i,n),Te(Number,s,"maximumCone",o.maximumCone,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Te(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Te(Number,s,"subdivisions",o.subdivisions,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function U6e(e,t,n,i){let o=t.label;if(!c(o))return;let r=pr(o.interval),s=e.label;c(s)||(e.label=s=new Nm),Te(Boolean,s,"show",o.show,r,i,n),Te(String,s,"text",o.text,r,i,n),Te(String,s,"font",o.font,r,i,n),Te(Yo,s,"style",o.style,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(Boolean,s,"showBackground",o.showBackground,r,i,n),Te(Y,s,"backgroundColor",o.backgroundColor,r,i,n),Te(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),Te(D,s,"pixelOffset",o.pixelOffset,r,i,n),Te(m,s,"eyeOffset",o.eyeOffset,r,i,n),Te(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Te(Mn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"fillColor",o.fillColor,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Nt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(Nt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Te(Nt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function O6e(e,t,n,i){let o=t.model;if(!c(o))return;let r=pr(o.interval),s=e.model;c(s)||(e.model=s=new Up),Te(Boolean,s,"show",o.show,r,i,n),Te(s2.default,s,"uri",o.gltf,r,i,n),Te(Number,s,"scale",o.scale,r,i,n),Te(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Te(Number,s,"maximumScale",o.maximumScale,r,i,n),Te(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Te(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Te(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"silhouetteColor",o.silhouetteColor,r,i,n),Te(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Te(Y,s,"color",o.color,r,i,n),Te(bc,s,"colorBlendMode",o.colorBlendMode,r,i,n),Te(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,l,d=o.nodeTransformations;if(c(d))if(Array.isArray(d))for(a=0,l=d.length;a<l;++a)Ime(s,d[a],r,i,n);else Ime(s,d,r,i,n);let u=o.articulations;if(c(u))if(Array.isArray(u))for(a=0,l=u.length;a<l;++a)Wme(s,u[a],r,i,n);else Wme(s,u,r,i,n)}function Ime(e,t,n,i,o){let r=pr(t.interval);c(n)&&(c(r)?r=Zn.intersect(r,n,sT):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let l=0,d=a.length;l<d;++l){let u=a[l];if(u==="interval")continue;let f=t[u];if(!c(f))continue;c(s)||(e.nodeTransformations=s=new Bc),s.hasProperty(u)||s.addProperty(u);let p=s[u];c(p)||(s[u]=p=new Yx),Te(m,p,"translation",f.translation,r,i,o),Te(Fe,p,"rotation",f.rotation,r,i,o),Te(m,p,"scale",f.scale,r,i,o)}}function Wme(e,t,n,i,o){let r=pr(t.interval);c(n)&&(c(r)?r=Zn.intersect(r,n,sT):r=n);let s=e.articulations,a=Object.keys(t);for(let l=0,d=a.length;l<d;++l){let u=a[l];if(u==="interval")continue;let f=t[u];c(f)&&(c(s)||(e.articulations=s=new Bc),s.hasProperty(u)||s.addProperty(u),Te(Number,s,u,f,r,i,o))}}function D6e(e,t,n,i){let o=t.path;if(!c(o))return;let r=pr(o.interval),s=e.path;c(s)||(e.path=s=new Op),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"leadTime",o.leadTime,r,i,n),Te(Number,s,"trailTime",o.trailTime,r,i,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"resolution",o.resolution,r,i,n),Ad(s,"material",o.material,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function B6e(e,t,n,i){let o=t.point;if(!c(o))return;let r=pr(o.interval),s=e.point;c(s)||(e.point=s=new zx),Te(Boolean,s,"show",o.show,r,i,n),Te(Number,s,"pixelSize",o.pixelSize,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Y,s,"color",o.color,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Nt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Te(Nt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function r2(e){this.polygon=e,this._definitionChanged=new ye}Object.defineProperties(r2.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!c(e)||e.isConstant)&&(!c(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});r2.prototype.getValue=function(e,t){let n;c(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return c(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),c(i)&&(i=i.map(function(o){return new Fa(o)}))),c(t)?(t.positions=n,t.holes=i,t):new Fa(n,i)};r2.prototype.equals=function(e){return this===e||e instanceof r2&&J.equals(this.polygon._positions,e.polygon._positions)&&J.equals(this.polygon._holes,e.polygon._holes)};function Y6e(e,t,n,i){let o=t.polygon;if(!c(o))return;let r=pr(o.interval),s=e.polygon;c(s)||(e.polygon=s=new km),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"_positions",o.positions,n),X6e(s,"_holes",o.holes,n),(c(s._positions)||c(s._holes))&&(s.hierarchy=new r2(s)),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(qu,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),Te(Boolean,s,"closeTop",o.closeTop,r,i,n),Te(Boolean,s,"closeBottom",o.closeBottom,r,i,n),Te(Kt,s,"arcType",o.arcType,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function H6e(e){return e?Kt.GEODESIC:Kt.NONE}function z6e(e,t,n,i){let o=t.polyline;if(!c(o))return;let r=pr(o.interval),s=e.polyline;if(c(s)||(e.polyline=s=new uc),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"positions",o.positions,n),Te(Number,s,"width",o.width,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Ad(s,"material",o.material,r,i,n),Ad(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Te(Kt,s,"arcType",o.arcType,r,i,n),Te(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n),c(o.followSurface)&&!c(o.arcType)){let a={};Te(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=d6e(a.followSurface,H6e)}}function K6e(e,t,n,i){let o=t.polylineVolume;if(!c(o))return;let r=pr(o.interval),s=e.polylineVolume;c(s)||(e.polylineVolume=s=new Kx),a2(s,"positions",o.positions,n),I6e(s,"shape",o.shape,n),Te(Boolean,s,"show",o.show,r,i,n),Te(Fi,s,"cornerType",o.cornerType,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function J6e(e,t,n,i){let o=t.rectangle;if(!c(o))return;let r=pr(o.interval),s=e.rectangle;c(s)||(e.rectangle=s=new Um),Te(Boolean,s,"show",o.show,r,i,n),Te(de,s,"coordinates",o.coordinates,r,i,n),Te(Number,s,"height",o.height,r,i,n),Te(ze,s,"heightReference",o.heightReference,r,i,n),Te(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Te(ze,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Te(qu,s,"rotation",o.rotation,r,i,n),Te(qu,s,"stRotation",o.stRotation,r,i,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Te(Un,s,"classificationType",o.classificationType,r,i,n),Te(Number,s,"zIndex",o.zIndex,r,i,n)}function Q6e(e,t,n,i){let o=t.tileset;if(!c(o))return;let r=pr(o.interval),s=e.tileset;c(s)||(e.tileset=s=new Hx),Te(Boolean,s,"show",o.show,r,i,n),Te(s2.default,s,"uri",o.uri,r,i,n),Te(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function j6e(e,t,n,i){let o=t.wall;if(!c(o))return;let r=pr(o.interval),s=e.wall;c(s)||(e.wall=s=new Dp),Te(Boolean,s,"show",o.show,r,i,n),a2(s,"positions",o.positions,n),Gme(s,"minimumHeights",o.minimumHeights,n),Gme(s,"maximumHeights",o.maximumHeights,n),Te(Number,s,"granularity",o.granularity,r,i,n),Te(Boolean,s,"fill",o.fill,r,i,n),Ad(s,"material",o.material,r,i,n),Te(Boolean,s,"outline",o.outline,r,i,n),Te(Y,s,"outlineColor",o.outlineColor,r,i,n),Te(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Te(Sn,s,"shadows",o.shadows,r,i,n),Te(vt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function wme(e,t,n,i,o){let r=e.id;if(c(r)||(r=Hn()),TJ=r,!c(o._version)&&r!=="document")throw new le("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")M6e(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;c(a)&&(s.parent=t.getOrCreateEntity(a));for(let l=n.length-1;l>-1;l--)n[l](s,e,t,i)}TJ=void 0}function q6e(e){let t,n=e._documentPacket.clock;if(!c(n)){if(!c(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ye.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=ee.secondsDifference(s,r),l=Math.round(a/120);return t=new Tf,t.startTime=ee.clone(r),t.stopTime=ee.clone(s),t.clockRange=zr.LOOP_STOP,t.multiplier=l,t.currentTime=ee.clone(r),t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}c(e._clock)?t=e._clock.clone():(t=new Tf,t.startTime=Ye.MINIMUM_VALUE.clone(),t.stopTime=Ye.MAXIMUM_VALUE.clone(),t.currentTime=Ye.MINIMUM_VALUE.clone(),t.clockRange=zr.LOOP_STOP,t.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=pr(n.interval);return c(i)&&(t.startTime=i.start,t.stopTime=i.stop),c(n.currentTime)&&(t.currentTime=ee.fromIso8601(n.currentTime)),c(n.range)&&(t.clockRange=zr[n.range]??zr.LOOP_STOP),c(n.step)&&(t.clockStep=fo[n.step]??fo.SYSTEM_CLOCK_MULTIPLIER),c(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function Ame(e,t,n,i){if(!c(t))throw new L("czml is required.");n=n??z.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Ct(s)),e._credit=s,typeof t=="string"||t instanceof Ge){t=Ge.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,l=t.credits;if(c(l)){let d=l.length;for(let u=0;u<d;u++)a.push(l[u])}}return r=Ge.createIfNeeded(r),Hr.setLoading(e,!0),Promise.resolve(o).then(function(a){return $6e(e,a,r,i)}).catch(function(a){return Hr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function $6e(e,t,n,i){Hr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Mme,o.removeAll()),ys._processCzml(t,o,n,void 0,e);let r=q6e(e),s=e._documentPacket;return c(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!c(e._name)&&c(n)&&(e._name=Ob(n.getUrlComponent()),r=!0),Hr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function Mme(){this.name=void 0,this.clock=void 0}function ys(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._clock=void 0,this._documentPacket=new Mme,this._version=void 0,this._entityCollection=new Ks(this),this._entityCluster=new wd,this._credit=void 0,this._resourceCredits=[]}ys.load=function(e,t){return new ys().load(e,t)};Object.defineProperties(ys.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});ys.updaters=[P6e,v6e,F6e,A6e,N6e,k6e,U6e,O6e,T6e,S6e,D6e,B6e,Y6e,z6e,K6e,Z6e,J6e,C6e,Q6e,V6e,j6e,L6e,W6e];ys.registerUpdater=function(e){ys.updaters.includes(e)||ys.updaters.push(e)};ys.unregisterUpdater=function(e){if(ys.updaters.includes(e)){let t=ys.updaters.indexOf(e);ys.updaters.splice(t,1)}};ys.prototype.process=function(e,t){return Ame(this,e,t,!1)};ys.prototype.load=function(e,t){return Ame(this,e,t,!0)};ys.prototype.update=function(e){return!0};ys.processPacketData=Te;ys.processPositionPacketData=Fme;ys.processMaterialPacketData=Ad;ys._processCzml=function(e,t,n,i,o){if(i=i??ys.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)wme(e[r],t,i,n,o);else wme(e,t,i,n,o)};var c2=ys;var Mri=_(T(),1);function sl(){this._dataSources=[],this._dataSourceAdded=new ye,this._dataSourceRemoved=new ye,this._dataSourceMoved=new ye}Object.defineProperties(sl.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}}});sl.prototype.add=function(e){if(!c(e))throw new L("dataSource is required.");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})};sl.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};sl.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=[]};sl.prototype.contains=function(e){return this.indexOf(e)!==-1};sl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};sl.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._dataSources[e]};sl.prototype.getByName=function(e){if(!c(e))throw new L("name is required.");return this._dataSources.filter(function(t){return t.name===e})};function zk(e,t){if(!c(t))throw new L("dataSource is required.");let n=e.indexOf(t);if(n===-1)throw new L("dataSource is not in this collection.");return n}function Nme(e,t,n){let i=e._dataSources,o=i.length-1;if(t=w.clamp(t,0,o),n=w.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}sl.prototype.raise=function(e){let t=zk(this._dataSources,e);Nme(this,t,t+1)};sl.prototype.lower=function(e){let t=zk(this._dataSources,e);Nme(this,t,t-1)};sl.prototype.raiseToTop=function(e){let t=zk(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))};sl.prototype.lowerToBottom=function(e){let t=zk(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};sl.prototype.isDestroyed=function(){return!1};sl.prototype.destroy=function(){return this.removeAll(!0),he(this)};var l2=sl;var Ugi=_(T(),1);var qri=_(T(),1);var Hri=_(T(),1);function _a(e){e=e??z.EMPTY_OBJECT,this._primitives=[],this._guid=Hn(),this._primitiveAdded=new ye,this._primitiveRemoved=new ye,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(_a.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});_a.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new L("primitive is required.");if(n){if(t<0)throw new L("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new L("index must be less than or equal to the number of primitives.")}let 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._primitiveAdded.raiseEvent(e),e};_a.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.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};_a.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};_a.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};_a.prototype.contains=function(e){return!!(c(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function Kk(e,t){if(!e.contains(t))throw new L("primitive is not in this collection.");return e._primitives.indexOf(t)}_a.prototype.raise=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};_a.prototype.raiseToTop=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};_a.prototype.lower=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};_a.prototype.lowerToBottom=function(e){if(c(e)){let t=Kk(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};_a.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._primitives[e]};_a.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};_a.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.prePassesUpdate)&&i.prePassesUpdate(e)}};_a.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];c(o.updateForPass)&&o.updateForPass(e,t)}};_a.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.postPassesUpdate)&&i.postPassesUpdate(e)}};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return this.removeAll(),he(this)};var al=_a;function wh(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(wh.prototype,{length:{get:function(){return this._length}}});wh.prototype.add=function(e,t){C.defined("primitive",e),c(t)&&C.typeOf.number("zIndex",t),t=t??0;let n=this._collections[t];if(!c(n)){n=new al({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};wh.prototype.set=function(e,t){return C.defined("primitive",e),C.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};wh.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};wh.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};wh.prototype.contains=function(e){if(!c(e))return!1;let t=this._collections[e._zIndex];return c(t)&&t.contains(e)};wh.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};wh.prototype.isDestroyed=function(){return!1};wh.prototype.destroy=function(){return this.removeAll(),he(this)};var d2=wh;var abi=_(T(),1);var isi=_(T(),1);function tV(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Zt}tV.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};tV.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);c(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};tV.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};tV.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};tV.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),c(e)&&c(e.getBoundingSphere)?e.getBoundingSphere(t):ut.FAILED};var aT=tV;var bhi=_(T(),1);var Vai=_(T(),1);var Fsi=_(T(),1);var lsi=_(T(),1);var LJ={},Jk=new m,kme=new m,Ume=new Fe,Ome=new te;function nV(e,t,n,i,o,r,s,a,l,d){let u=e+t;m.multiplyByScalar(i,Math.cos(u),Jk),m.multiplyByScalar(n,Math.sin(u),kme),m.add(Jk,kme,Jk);let f=Math.cos(e);f=f*f;let p=Math.sin(e);p=p*p;let h=r/Math.sqrt(s*f+o*p)/a;return Fe.fromAxisAngle(Jk,h,Ume),te.fromQuaternion(Ume,Ome),te.multiplyByVector(Ome,l,d),m.normalize(d,d),m.multiplyByScalar(d,a,d),d}var Dme=new m,Bme=new m,VJ=new m,eqe=new m;LJ.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),l=e.length,d=n?l:0;for(let u=0;u<l;u+=3){let f=u+1,p=u+2,y=m.fromArray(e,u,Dme);i.scaleToGeodeticSurface(y,y);let h=m.clone(y,Bme),g=i.geodeticSurfaceNormal(y,eqe),x=m.multiplyByScalar(g,o,VJ);m.add(y,x,y),n&&(m.multiplyByScalar(g,r,x),m.add(h,x,h),a[u+d]=h.x,a[f+d]=h.y,a[p+d]=h.z),a[u]=y.x,a[f]=y.y,a[p]=y.z}return a};var tqe=new m,nqe=new m,iqe=new m;LJ.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,l=i*i,d=o*o,u=o*i,f=m.magnitude(s),p=m.normalize(s,tqe),y=m.cross(m.UNIT_Z,s,nqe);y=m.normalize(y,y);let h=m.cross(p,y,iqe),g=1+Math.ceil(w.PI_OVER_TWO/a),x=w.PI_OVER_TWO/(g-1),S=w.PI_OVER_TWO-g*x;S<0&&(g-=Math.ceil(Math.abs(S)/x));let V=2*(g*(g+2)),Z=t?new Array(V*3):void 0,R=0,E=Dme,I=Bme,v=g*4*3,P=v-1,F=0,N=n?new Array(v):void 0,b,G,X,W,A;for(S=w.PI_OVER_TWO,E=nV(S,r,h,y,l,u,d,f,p,E),t&&(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z),n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x),S=w.PI_OVER_TWO-x,b=1;b<g+1;++b){if(E=nV(S,r,h,y,l,u,d,f,p,E),I=nV(Math.PI-S,r,h,y,l,u,d,f,p,I),t){for(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z,X=2*b+2,G=1;G<X-1;++G)W=G/(X-1),A=m.lerp(E,I,W,VJ),Z[R++]=A.x,Z[R++]=A.y,Z[R++]=A.z;Z[R++]=I.x,Z[R++]=I.y,Z[R++]=I.z}n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x,N[F++]=I.x,N[F++]=I.y,N[F++]=I.z),S=w.PI_OVER_TWO-(b+1)*x}for(b=g;b>1;--b){if(S=w.PI_OVER_TWO-(b-1)*x,E=nV(-S,r,h,y,l,u,d,f,p,E),I=nV(S+Math.PI,r,h,y,l,u,d,f,p,I),t){for(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z,X=2*(b-1)+2,G=1;G<X-1;++G)W=G/(X-1),A=m.lerp(E,I,W,VJ),Z[R++]=A.x,Z[R++]=A.y,Z[R++]=A.z;Z[R++]=I.x,Z[R++]=I.y,Z[R++]=I.z}n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x,N[F++]=I.x,N[F++]=I.y,N[F++]=I.z)}S=w.PI_OVER_TWO,E=nV(-S,r,h,y,l,u,d,f,p,E);let k={};return t&&(Z[R++]=E.x,Z[R++]=E.y,Z[R++]=E.z,k.positions=Z,k.numPts=g),n&&(N[P--]=E.z,N[P--]=E.y,N[P--]=E.x,k.outerPositions=N),k};var Yl=LJ;var iV=new m,ZJ=new m,RJ=new m,Yme=new m,Es=new D,Hme=new te,oqe=new te,GJ=new Fe,zme=new m,Kme=new m,Jme=new m,qk=new pe,Qme=new m,jme=new D,qme=new D;function $me(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,l=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,f=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,y=i.tangent?new Float32Array(d*3):void 0,h=i.bitangent?new Float32Array(d*3):void 0,g=u?new Float32Array(d*3):void 0,x=0,S=zme,V=Kme,Z=Jme,R=new Xi(a),E=R.project(a.cartesianToCartographic(o,qk),Qme),I=a.scaleToGeodeticSurface(o,iV);a.geodeticSurfaceNormal(I,I);let v=Hme,P=oqe;if(l!==0){let A=Fe.fromAxisAngle(I,l,GJ);v=te.fromQuaternion(A,v),A=Fe.fromAxisAngle(I,-l,GJ),P=te.fromQuaternion(A,P)}else v=te.clone(te.IDENTITY,v),P=te.clone(te.IDENTITY,P);let F=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,jme),N=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,qme),b=e.length,G=n?b:0,X=G/3*2;for(let A=0;A<b;A+=3){let k=A+1,B=A+2,O=m.fromArray(e,A,iV);if(i.st){let H=te.multiplyByVector(v,O,ZJ),U=R.project(a.cartesianToCartographic(H,qk),RJ);m.subtract(U,E,U),Es.x=(U.x+r)/(2*r),Es.y=(U.y+s)/(2*s),F.x=Math.min(Es.x,F.x),F.y=Math.min(Es.y,F.y),N.x=Math.max(Es.x,N.x),N.y=Math.max(Es.y,N.y),n&&(f[x+X]=Es.x,f[x+1+X]=Es.y),f[x++]=Es.x,f[x++]=Es.y}(i.normal||i.tangent||i.bitangent||u)&&(S=a.geodeticSurfaceNormal(O,S),u&&(g[A+G]=-S.x,g[k+G]=-S.y,g[B+G]=-S.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(V=m.normalize(m.cross(m.UNIT_Z,S,V),V),te.multiplyByVector(P,V,V)),i.normal&&(p[A]=S.x,p[k]=S.y,p[B]=S.z,n&&(p[A+G]=-S.x,p[k+G]=-S.y,p[B+G]=-S.z)),i.tangent&&(y[A]=V.x,y[k]=V.y,y[B]=V.z,n&&(y[A+G]=-V.x,y[k+G]=-V.y,y[B+G]=-V.z)),i.bitangent&&(Z=m.normalize(m.cross(S,V,Z),Z),h[A]=Z.x,h[k]=Z.y,h[B]=Z.z,n&&(h[A+G]=Z.x,h[k+G]=Z.y,h[B+G]=Z.z))))}if(i.st){b=f.length;for(let A=0;A<b;A+=2)f[A]=(f[A]-F.x)/(N.x-F.x),f[A+1]=(f[A+1]-F.y)/(N.y-F.y)}let W=new fn;if(i.position){let A=Yl.raisePositionsToHeight(e,t,n);W.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:A})}if(i.st&&(W.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:f})),i.normal&&(W.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(W.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),i.bitangent&&(W.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),u&&(W.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),n&&c(t.offsetAttribute)){let A=new Uint8Array(d);if(t.offsetAttribute===$t.TOP)A=A.fill(1,0,d/2);else{let k=t.offsetAttribute===$t.NONE?0:1;A=A.fill(k)}W.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return W}function efe(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 cT=new m;function rqe(e){let t=e.center;cT=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,cT),e.height,cT),cT=m.add(t,cT,cT);let n=new ue(cT,e.semiMajorAxis),i=Yl.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=$me(o,e,!1),a=efe(r);return a=Me.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function sqe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,l=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,f=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,y=n.normal?new Float32Array(u*3):void 0,h=n.tangent?new Float32Array(u*3):void 0,g=n.bitangent?new Float32Array(u*3):void 0,x=t.shadowVolume,S=x?new Float32Array(u*3):void 0,V=0,Z=zme,R=Kme,E=Jme,I=new Xi(s),v=I.project(s.cartesianToCartographic(i,qk),Qme),P=s.scaleToGeodeticSurface(i,iV);s.geodeticSurfaceNormal(P,P);let F=Fe.fromAxisAngle(P,d,GJ),N=te.fromQuaternion(F,Hme),b=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,jme),G=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,qme),X=e.length,W=X/3*2;for(let k=0;k<X;k+=3){let B=k+1,O=k+2,H=m.fromArray(e,k,iV),U;if(n.st){let Q=te.multiplyByVector(N,H,ZJ),ie=I.project(s.cartesianToCartographic(Q,qk),RJ);m.subtract(ie,v,ie),Es.x=(ie.x+o)/(2*o),Es.y=(ie.y+r)/(2*r),b.x=Math.min(Es.x,b.x),b.y=Math.min(Es.y,b.y),G.x=Math.max(Es.x,G.x),G.y=Math.max(Es.y,G.y),p[V+W]=Es.x,p[V+1+W]=Es.y,p[V++]=Es.x,p[V++]=Es.y}H=s.scaleToGeodeticSurface(H,H),U=m.clone(H,ZJ),Z=s.geodeticSurfaceNormal(H,Z),x&&(S[k+X]=-Z.x,S[B+X]=-Z.y,S[O+X]=-Z.z);let K=m.multiplyByScalar(Z,a,Yme);if(H=m.add(H,K,H),K=m.multiplyByScalar(Z,l,K),U=m.add(U,K,U),n.position&&(f[k+X]=U.x,f[B+X]=U.y,f[O+X]=U.z,f[k]=H.x,f[B]=H.y,f[O]=H.z),n.normal||n.tangent||n.bitangent){E=m.clone(Z,E);let Q=m.fromArray(e,(k+3)%X,Yme);m.subtract(Q,H,Q);let ie=m.subtract(U,H,RJ);Z=m.normalize(m.cross(ie,Q,Z),Z),n.normal&&(y[k]=Z.x,y[B]=Z.y,y[O]=Z.z,y[k+X]=Z.x,y[B+X]=Z.y,y[O+X]=Z.z),n.tangent&&(R=m.normalize(m.cross(E,Z,R),R),h[k]=R.x,h[B]=R.y,h[O]=R.z,h[k+X]=R.x,h[k+1+X]=R.y,h[k+2+X]=R.z),n.bitangent&&(g[k]=E.x,g[B]=E.y,g[O]=E.z,g[k+X]=E.x,g[B+X]=E.y,g[O+X]=E.z)}}if(n.st){X=p.length;for(let k=0;k<X;k+=2)p[k]=(p[k]-b.x)/(G.x-b.x),p[k+1]=(p[k+1]-b.y)/(G.y-b.y)}let A=new fn;if(n.position&&(A.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})),n.st&&(A.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(A.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),n.tangent&&(A.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),n.bitangent&&(A.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),x&&(A.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:S})),c(t.offsetAttribute)){let k=new Uint8Array(u);if(t.offsetAttribute===$t.TOP)k=k.fill(1,0,u/2);else{let B=t.offsetAttribute===$t.NONE?0:1;k=k.fill(B)}A.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return A}function aqe(e){let t=e.length/3,n=Me.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,l=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=l}return n}var Qk=new ue,jk=new ue;function cqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,iV),e.height,iV);Qk.center=m.add(t,o,Qk.center),Qk.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),jk.center=m.add(t,o,jk.center),jk.radius=i;let r=Yl.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,l=r.outerPositions,d=ue.union(Qk,jk),u=$me(s,e,!0),f=efe(a),p=f.length;f.length=p*2;let y=s.length/3;for(let R=0;R<p;R+=3)f[R+p]=f[R+2]+y,f[R+1+p]=f[R+1]+y,f[R+2+p]=f[R]+y;let h=Me.createTypedArray(y*2/3,f),g=new dt({attributes:u,indices:h,primitiveType:ve.TRIANGLES}),x=sqe(l,e);f=aqe(l);let S=Me.createTypedArray(l.length*2/3,f),V=new dt({attributes:x,indices:S,primitiveType:ve.TRIANGLES}),Z=An.combineInstances([new Rt({geometry:g}),new Rt({geometry:V})]);return{boundingSphere:d,attributes:Z[0].attributes,indices:Z[0].indices}}function tfe(e,t,n,i,o,r,s){let l=Yl.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=l.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=m.fromArray(l,p*3);let f=de.fromCartesianArray(u,r,s);return f.width>w.PI&&(f.north=f.north>0?w.PI_OVER_TWO-w.EPSILON7:f.north,f.south=f.south<0?w.EPSILON7-w.PI_OVER_TWO:f.south,f.east=w.PI,f.west=-w.PI),f}function vh(e){e=e??z.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??re.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE,s=e.vertexFormat??We.DEFAULT;if(C.defined("options.center",t),C.typeOf.number("options.semiMajorAxis",i),C.typeOf.number("options.semiMinorAxis",o),i<o)throw new L("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new L("granularity must be greater than zero.");let a=e.height??0,l=e.extrudedHeight??a;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=re.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(l,a),this._granularity=r,this._vertexFormat=We.clone(s),this._extrudedHeight=Math.min(l,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}vh.packedLength=m.packedLength+re.packedLength+We.packedLength+9;vh.pack=function(e,t,n){return C.defined("value",e),C.defined("array",t),n=n??0,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var nfe=new m,ife=new re,ofe=new We,Ph={center:nfe,ellipsoid:ife,vertexFormat:ofe,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};vh.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=m.unpack(e,t,nfe);t+=m.packedLength;let o=re.unpack(e,t,ife);t+=re.packedLength;let r=We.unpack(e,t,ofe);t+=We.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t++],y=e[t++]===1,h=e[t];return c(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=l,n._stRotation=d,n._height=u,n._granularity=f,n._extrudedHeight=p,n._shadowVolume=y,n._offsetAttribute=h===-1?void 0:h,n):(Ph.height=u,Ph.extrudedHeight=p,Ph.granularity=f,Ph.stRotation=d,Ph.rotation=l,Ph.semiMajorAxis=s,Ph.semiMinorAxis=a,Ph.shadowVolume=y,Ph.offsetAttribute=h===-1?void 0:h,new vh(Ph))};vh.computeRectangle=function(e,t){e=e??z.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??re.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??w.RADIANS_PER_DEGREE,a=e.rotation??0;if(C.defined("options.center",n),C.typeOf.number("options.semiMajorAxis",o),C.typeOf.number("options.semiMinorAxis",r),o<r)throw new L("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(s<=0)throw new L("granularity must be greater than zero.");return tfe(n,o,r,a,s,i,t)};vh.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!w.equalsEpsilon(t,n,0,w.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=cqe(o);else if(r=rqe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===$t.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:ve.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};vh.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new vh({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};function lqe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Yl.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 l=0;l<o;++l)r[l]=m.fromArray(i,l*3);let s=e._ellipsoid,a=e.rectangle;return dt._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(vh.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=tfe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=lqe(this)),this._textureCoordinateRotationPoints}}});var cl=vh;var $si=_(T(),1);var rfe=new m,lT=new m;function dqe(e){let t=e.center;lT=m.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,lT),e.height,lT),lT=m.add(t,lT,lT);let n=new ue(lT,e.semiMajorAxis),i=Yl.computeEllipsePositions(e,!1,!0).outerPositions,o=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:Yl.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Me.createTypedArray(r,r*2),a=0;for(let l=0;l<r;++l)s[a++]=l,s[a++]=(l+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var $k=new ue,eU=new ue;function uqe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,rfe),e.height,rfe);$k.center=m.add(t,o,$k.center),$k.radius=i,o=m.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),eU.center=m.add(t,o,eU.center),eU.radius=i;let r=Yl.computeEllipsePositions(e,!1,!0).outerPositions,s=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:Yl.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ue.union($k,eU),l=r.length/3;if(c(e.offsetAttribute)){let h=new Uint8Array(l);if(e.offsetAttribute===$t.TOP)h=h.fill(1,0,l/2);else{let g=e.offsetAttribute===$t.NONE?0:1;h=h.fill(g)}s.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}let d=e.numberOfVerticalLines??16;d=w.clamp(d,0,l/2);let u=Me.createTypedArray(l,l*2+d*2);l/=2;let f=0,p;for(p=0;p<l;++p)u[f++]=p,u[f++]=(p+1)%l,u[f++]=p+l,u[f++]=(p+1)%l+l;let y;if(d>0){let h=Math.min(d,l);y=Math.round(l/h);let g=Math.min(y*d,l);for(p=0;p<g;p+=y)u[f++]=p,u[f++]=p+l}return{boundingSphere:a,attributes:s,indices:u}}function oV(e){e=e??z.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??re.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??w.RADIANS_PER_DEGREE;if(!c(t))throw new L("center is required.");if(!c(i))throw new L("semiMajorAxis is required.");if(!c(o))throw new L("semiMinorAxis is required.");if(i<o)throw new L("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new L("granularity must be greater than zero.");let s=e.height??0,a=e.extrudedHeight??s;this._center=m.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=re.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"}oV.packedLength=m.packedLength+re.packedLength+8;oV.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,m.pack(e._center,t,n),n+=m.packedLength,re.pack(e._ellipsoid,t,n),n+=re.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 sfe=new m,afe=new re,Qb={center:sfe,ellipsoid:afe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};oV.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=m.unpack(e,t,sfe);t+=m.packedLength;let o=re.unpack(e,t,afe);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t];return c(n)?(n._center=m.clone(i,n._center),n._ellipsoid=re.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=l,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=f,n._offsetAttribute=p===-1?void 0:p,n):(Qb.height=l,Qb.extrudedHeight=u,Qb.granularity=d,Qb.rotation=a,Qb.semiMajorAxis=r,Qb.semiMinorAxis=s,Qb.numberOfVerticalLines=f,Qb.offsetAttribute=p===-1?void 0:p,new oV(Qb))};oV.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!w.equalsEpsilon(t,n,0,w.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=uqe(o);else if(r=dqe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===$t.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new dt({attributes:r.attributes,indices:r.indices,primitiveType:ve.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Md=oV;var cfe=new Y,lfe=m.ZERO,dfe=new m,ufe=new de;function mqe(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 Cf(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new mqe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}c(Object.create)&&(Cf.prototype=Object.create(Yn.prototype),Cf.prototype.constructor=Cf);Cf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new Tn(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 Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,cfe)),c(o)||(o=Y.WHITE),i.color=Yt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,lfe,dfe))),new Rt({id:t,geometry:new cl(this._options),attributes:i})};Cf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,cfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,lfe,dfe))),new Rt({id:t,geometry:new Md(this._options),attributes:r})};Cf.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Cf.prototype._isHidden=function(e,t){let n=e.position;return!c(n)||!c(t.semiMajorAxis)||!c(t.semiMinorAxis)||oi.prototype._isHidden.call(this,e,t)};Cf.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 Ut)};Cf.prototype._setStaticOptions=function(e,t){let n=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),i=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),o=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),r=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ye.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ye.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ye.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=J.getValueOrUndefined(t.rotation,Ye.MINIMUM_VALUE),s.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),s.stRotation=J.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),s.numberOfVerticalLines=J.getValueOrUndefined(t.numberOfVerticalLines,Ye.MINIMUM_VALUE),s.offsetAttribute=Yn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Yn.getGeometryHeight(n,i),o=Yn.getGeometryExtrudedHeight(o,r),o===Yn.CLAMP_TO_GROUND&&(o=ui.getMinimumMaximumHeights(cl.computeRectangle(s,ufe)).minimumTerrainHeight),s.extrudedHeight=o};Cf.DynamicGeometryUpdater=rV;function rV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(rV.prototype=Object.create(ii.prototype),rV.prototype.constructor=rV);rV.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.center)||!c(i.semiMajorAxis)||!c(i.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t,n)};rV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,ze.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);c(s)&&!c(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=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(cl.computeRectangle(i,ufe)).minimumTerrainHeight),i.extrudedHeight=s};var u2=Cf;var bci=_(T(),1);var Oai=_(T(),1);var fqe=new m,hqe=new m,pqe=new m,bqe=new m,yqe=new m,gqe=new m(1,1,1),mfe=Math.cos,ffe=Math.sin;function jb(e){e=e??z.EMPTY_OBJECT;let t=e.radii??gqe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??w.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??w.PI,a=Math.round(e.stackPartitions??64),l=Math.round(e.slicePartitions??64),d=e.vertexFormat??We.DEFAULT;if(l<3)throw new L("options.slicePartitions cannot be less than three.");if(a<3)throw new L("options.stackPartitions cannot be less than three.");this._radii=m.clone(t),this._innerRadii=m.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._vertexFormat=We.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}jb.packedLength=2*m.packedLength+We.packedLength+7;jb.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");return n=n??0,m.pack(e._radii,t,n),n+=m.packedLength,m.pack(e._innerRadii,t,n),n+=m.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var hfe=new m,pfe=new m,bfe=new We,tg={radii:hfe,innerRadii:pfe,vertexFormat:bfe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};jb.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i=m.unpack(e,t,hfe);t+=m.packedLength;let o=m.unpack(e,t,pfe);t+=m.packedLength;let r=We.unpack(e,t,bfe);t+=We.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++],p=e[t];return c(n)?(n._radii=m.clone(i,n._radii),n._innerRadii=m.clone(o,n._innerRadii),n._vertexFormat=We.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=l,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=f,n._offsetAttribute=p===-1?void 0:p,n):(tg.minimumClock=s,tg.maximumClock=a,tg.minimumCone=l,tg.maximumCone=d,tg.stackPartitions=u,tg.slicePartitions=f,tg.offsetAttribute=p===-1?void 0:p,new jb(tg))};jb.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,l=e._slicePartitions+1,d=e._stackPartitions+1;l=Math.round(l*Math.abs(o-i)/w.TWO_PI),d=Math.round(d*Math.abs(s-r)/w.PI),l<2&&(l=2),d<2&&(d=2);let u,f,p=0,y=[r],h=[i];for(u=0;u<d;u++)y.push(r+u*(s-r)/(d-1));for(y.push(s),f=0;f<l;f++)h.push(i+f*(o-i)/(l-1));h.push(o);let g=y.length,x=h.length,S=0,V=1,Z=n.x!==t.x||n.y!==t.y||n.z!==t.z,R=!1,E=!1,I=!1;Z&&(V=2,r>0&&(R=!0,S+=l-1),s<Math.PI&&(E=!0,S+=l-1),(o-i)%w.TWO_PI?(I=!0,S+=(d-1)*2+1):S+=1);let v=x*g*V,P=new Float64Array(v*3),F=new Array(v).fill(!1),N=new Array(v).fill(!1),b=l*d*V,G=6*(b+S+1-(l+d)*V),X=Me.createTypedArray(b,G),W=a.normal?new Float32Array(v*3):void 0,A=a.tangent?new Float32Array(v*3):void 0,k=a.bitangent?new Float32Array(v*3):void 0,B=a.st?new Float32Array(v*2):void 0,O=new Array(g),H=new Array(g);for(u=0;u<g;u++)O[u]=ffe(y[u]),H[u]=mfe(y[u]);let U=new Array(x),K=new Array(x);for(f=0;f<x;f++)K[f]=mfe(h[f]),U[f]=ffe(h[f]);for(u=0;u<g;u++)for(f=0;f<x;f++)P[p++]=t.x*O[u]*K[f],P[p++]=t.y*O[u]*U[f],P[p++]=t.z*H[u];let Q=v/2;if(Z)for(u=0;u<g;u++)for(f=0;f<x;f++)P[p++]=n.x*O[u]*K[f],P[p++]=n.y*O[u]*U[f],P[p++]=n.z*H[u],F[Q]=!0,u>0&&u!==g-1&&f!==0&&f!==x-1&&(N[Q]=!0),Q++;p=0;let ie,j;for(u=1;u<g-2;u++)for(ie=u*x,j=(u+1)*x,f=1;f<x-2;f++)X[p++]=j+f,X[p++]=j+f+1,X[p++]=ie+f+1,X[p++]=j+f,X[p++]=ie+f+1,X[p++]=ie+f;if(Z){let rt=g*x;for(u=1;u<g-2;u++)for(ie=rt+u*x,j=rt+(u+1)*x,f=1;f<x-2;f++)X[p++]=j+f,X[p++]=ie+f,X[p++]=ie+f+1,X[p++]=j+f,X[p++]=ie+f+1,X[p++]=j+f+1}let $,ne;if(Z){if(R)for(ne=g*x,u=1;u<x-2;u++)X[p++]=u,X[p++]=u+1,X[p++]=ne+u+1,X[p++]=u,X[p++]=ne+u+1,X[p++]=ne+u;if(E)for($=g*x-x,ne=g*x*V-x,u=1;u<x-2;u++)X[p++]=$+u+1,X[p++]=$+u,X[p++]=ne+u,X[p++]=$+u+1,X[p++]=ne+u,X[p++]=ne+u+1}if(I){for(u=1;u<g-2;u++)ne=x*g+x*u,$=x*u,X[p++]=ne,X[p++]=$+x,X[p++]=$,X[p++]=ne,X[p++]=ne+x,X[p++]=$+x;for(u=1;u<g-2;u++)ne=x*g+x*(u+1)-1,$=x*(u+1)-1,X[p++]=$+x,X[p++]=ne,X[p++]=$,X[p++]=$+x,X[p++]=ne+x,X[p++]=ne}let be=new fn;a.position&&(be.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:P}));let Ce=0,me=0,_e=0,Ve=0,Ie=v/2,Ze,De=re.fromCartesian3(t),Ke=re.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<v;u++){Ze=F[u]?Ke:De;let rt=m.fromArray(P,u*3,fqe),Xt=Ze.geodeticSurfaceNormal(rt,hqe);if(N[u]&&m.negate(Xt,Xt),a.st){let Ht=D.negate(Xt,yqe);B[Ce++]=Math.atan2(Ht.y,Ht.x)/w.TWO_PI+.5,B[Ce++]=Math.asin(Xt.z)/Math.PI+.5}if(a.normal&&(W[me++]=Xt.x,W[me++]=Xt.y,W[me++]=Xt.z),a.tangent||a.bitangent){let Ht=pqe,qe=0,mn;if(F[u]&&(qe=Ie),!R&&u>=qe&&u<qe+x*2?mn=m.UNIT_X:mn=m.UNIT_Z,m.cross(mn,Xt,Ht),m.normalize(Ht,Ht),a.tangent&&(A[_e++]=Ht.x,A[_e++]=Ht.y,A[_e++]=Ht.z),a.bitangent){let Dt=m.cross(Xt,Ht,bqe);m.normalize(Dt,Dt),k[Ve++]=Dt.x,k[Ve++]=Dt.y,k[Ve++]=Dt.z}}}a.st&&(be.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:B})),a.normal&&(be.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:W})),a.tangent&&(be.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:A})),a.bitangent&&(be.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:k}))}if(c(e._offsetAttribute)){let rt=P.length,Xt=e._offsetAttribute===$t.NONE?0:1,Ht=new Uint8Array(rt/3).fill(Xt);be.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ht})}return new dt({attributes:be,indices:X,primitiveType:ve.TRIANGLES,boundingSphere:ue.fromEllipsoid(De),offsetAttribute:e._offsetAttribute})};var EJ;jb.getUnitEllipsoid=function(){return c(EJ)||(EJ=jb.createGeometry(new jb({radii:new m(1,1,1),vertexFormat:We.POSITION_ONLY}))),EJ};var Js=jb;var xqe=new Ut(Y.WHITE),XJ=m.ZERO,IJ=new m,_qe=new m,Tqe=new m,WJ=new Y,Sqe=new m(1,1,1);function Cqe(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 Nd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Cqe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}c(Object.create)&&(Nd.prototype=Object.create(oi.prototype),Nd.prototype.constructor=Nd);Object.defineProperties(Nd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Nd.prototype.createFillGeometryInstance=function(e,t,n){C.defined("time",e);let i=this._entity,o=i.isAvailable(e),r,s=new Tn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),l=kn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:l,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let u;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,WJ)),c(u)||(u=Y.WHITE),r=Yt.fromColor(u),d.color=r}return c(this._options.offsetAttribute)&&(d.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,XJ,IJ))),new Rt({id:i,geometry:new Js(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};Nd.prototype.createOutlineGeometryInstance=function(e,t,n){C.defined("time",e);let i=this._entity,o=i.isAvailable(e),r=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,WJ),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Tn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return c(this._options.offsetAttribute)&&(a.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,XJ,IJ))),new Rt({id:i,geometry:new Id(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Nd.prototype._computeCenter=function(e,t){return J.getValueOrUndefined(this._entity.position,e,t)};Nd.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.radii)||oi.prototype._isHidden.call(this,e,t)};Nd.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)};Nd.prototype._setStaticOptions=function(e,t){let n=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ye.MINIMUM_VALUE,i.radii),i.innerRadii=J.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=J.getValueOrUndefined(t.minimumClock,Ye.MINIMUM_VALUE),i.maximumClock=J.getValueOrUndefined(t.maximumClock,Ye.MINIMUM_VALUE),i.minimumCone=J.getValueOrUndefined(t.minimumCone,Ye.MINIMUM_VALUE),i.maximumCone=J.getValueOrUndefined(t.maximumCone,Ye.MINIMUM_VALUE),i.stackPartitions=J.getValueOrUndefined(t.stackPartitions,Ye.MINIMUM_VALUE),i.slicePartitions=J.getValueOrUndefined(t.slicePartitions,Ye.MINIMUM_VALUE),i.subdivisions=J.getValueOrUndefined(t.subdivisions,Ye.MINIMUM_VALUE),i.offsetAttribute=n!==ze.NONE?$t.ALL:void 0};Nd.prototype._onEntityPropertyChanged=Bp;Nd.DynamicGeometryUpdater=m2;function m2(e,t,n){ii.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 m,this._material={}}c(Object.create)&&(m2.prototype=Object.create(ii.prototype),m2.prototype.constructor=m2);m2.prototype.update=function(e){C.defined("time",e);let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!J.getValueOrDefault(n.show,e,!0)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=J.getValueOrUndefined(n.radii,e,_qe),o=c(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!c(o)||!c(i)){c(this._primitive)&&(this._primitive.show=!1),c(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,Y.BLACK,WJ),l=qo.getValue(e,n.material??xqe,this._material),d=J.getValueOrUndefined(n.innerRadii,e,Tqe),u=J.getValueOrUndefined(n.minimumClock,e),f=J.getValueOrUndefined(n.maximumClock,e),p=J.getValueOrUndefined(n.minimumCone,e),y=J.getValueOrUndefined(n.maximumCone,e),h=J.getValueOrUndefined(n.stackPartitions,e),g=J.getValueOrUndefined(n.slicePartitions,e),x=J.getValueOrUndefined(n.subdivisions,e),S=J.getValueOrDefault(n.outlineWidth,e,1),V=J.getValueOrDefault(n.heightReference,e,ze.NONE),Z=V!==ze.NONE?$t.ALL:void 0,R=this._scene.mode,E=R===se.SCENE3D&&V===ze.NONE,I=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),F=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=J.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,XJ,IJ);if(!E||this._lastSceneMode!==R||!c(this._primitive)||I.stackPartitions!==h||I.slicePartitions!==g||c(d)&&!m.equals(I.innerRadii!==d)||I.minimumClock!==u||I.maximumClock!==f||I.minimumCone!==p||I.maximumCone!==y||I.subdivisions!==x||this._lastOutlineWidth!==S||I.offsetAttribute!==Z){let G=this._primitives;G.removeAndDestroy(this._primitive),G.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=R,this._lastOutlineWidth=S,I.stackPartitions=h,I.slicePartitions=g,I.subdivisions=x,I.offsetAttribute=Z,I.radii=m.clone(E?Sqe:i,I.radii),c(d)?E?I.innerRadii=m.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,I.innerRadii):I.innerRadii=m.clone(d,I.innerRadii):I.innerRadii=void 0,I.minimumClock=u,I.maximumClock=f,I.minimumCone=p,I.maximumCone=y;let X=new so({material:l,translucent:l.isTranslucent(),closed:!0});I.vertexFormat=X.vertexFormat;let W=this._geometryUpdater.createFillGeometryInstance(e,E,this._modelMatrix);this._primitive=G.add(new In({geometryInstances:W,appearance:X,asynchronous:!1,shadows:v}));let A=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=G.add(new In({geometryInstances:A,appearance:new an({flat:!0,translucent:A.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(S)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=Y.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=F,this._lastOffset=m.clone(N,this._lastOffset)}else if(this._primitive.ready){let G=this._primitive,X=this._outlinePrimitive;G.show=!0,X.show=!0,G.appearance.material=l;let W=this._attributes;c(W)||(W=G.getGeometryInstanceAttributes(t),this._attributes=W),r!==this._lastShow&&(W.show=Tn.toValue(r,W.show),this._lastShow=r);let A=this._outlineAttributes;c(A)||(A=X.getGeometryInstanceAttributes(t),this._outlineAttributes=A),s!==this._lastOutlineShow&&(A.show=Tn.toValue(s,A.show),this._lastOutlineShow=s),Y.equals(a,this._lastOutlineColor)||(A.color=Yt.toValue(a,A.color),Y.clone(a,this._lastOutlineColor)),vt.equals(F,this._lastDistanceDisplayCondition)||(W.distanceDisplayCondition=kn.toValue(F,W.distanceDisplayCondition),A.distanceDisplayCondition=kn.toValue(F,A.distanceDisplayCondition),vt.clone(F,this._lastDistanceDisplayCondition)),m.equals(N,this._lastOffset)||(W.offset=$i.toValue(N,W.offset),A.offset=$i.toValue(N,W.offset),m.clone(N,this._lastOffset))}E&&(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 f2=Nd;var lli=_(T(),1);var Eci=_(T(),1);function sV(e){e=e??z.EMPTY_OBJECT;let t=e.vertexFormat??We.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}sV.packedLength=We.packedLength;sV.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,We.pack(e._vertexFormat,t,n),t};var yfe=new We,Vqe={vertexFormat:yfe};sV.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=We.unpack(e,t,yfe);return c(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n):new sV(Vqe)};var tU=new m(-.5,-.5,0),nU=new m(.5,.5,0);sV.createGeometry=function(e){let t=e._vertexFormat,n=new fn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=tU.x,o[1]=tU.y,o[2]=0,o[3]=nU.x,o[4]=tU.y,o[5]=0,o[6]=nU.x,o[7]=nU.y,o[8]=0,o[9]=tU.x,o[10]=nU.y,o[11]=0,n.position=new Ee({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 Ee({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 Ee({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 Ee({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 Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new dt({attributes:n,indices:i,primitiveType:ve.TRIANGLES,boundingSphere:new ue(m.ZERO,Math.sqrt(2))})};var h2=sV;var kci=_(T(),1);function aV(){this._workerName="createPlaneOutlineGeometry"}aV.packedLength=0;aV.pack=function(e,t){return C.defined("value",e),C.defined("array",t),t};aV.unpack=function(e,t,n){return C.defined("array",e),c(n)?n:new aV};var ng=new m(-.5,-.5,0),iU=new m(.5,.5,0);aV.createGeometry=function(){let e=new fn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=ng.x,n[1]=ng.y,n[2]=ng.z,n[3]=iU.x,n[4]=ng.y,n[5]=ng.z,n[6]=iU.x,n[7]=iU.y,n[8]=ng.z,n[9]=ng.x,n[10]=iU.y,n[11]=ng.z,e.position=new Ee({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 dt({attributes:e,indices:t,primitiveType:ve.LINES,boundingSphere:new ue(m.ZERO,Math.sqrt(2))})};var p2=aV;var Lqe=new m,gfe=new Y;function Zqe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function tm(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Zqe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}c(Object.create)&&(tm.prototype=Object.create(oi.prototype),tm.prototype.constructor=tm);tm.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let y;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(y=this._materialProperty.color.getValue(e,gfe)),c(y)||(y=Y.WHITE),o=Yt.fromColor(y),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let l=t.plane,d=this._options,u=t.computeModelMatrix(e),f=J.getValueOrDefault(l.plane,e,d.plane),p=J.getValueOrUndefined(l.dimensions,e,d.dimensions);return d.plane=f,d.dimensions=p,u=wJ(f,p,u,u),new Rt({id:t,geometry:new h2(this._options),modelMatrix:u,attributes:i})};tm.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,gfe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),l=J.getValueOrDefault(r.plane,e,s.plane),d=J.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=l,s.dimensions=d,a=wJ(l,d,a,a),new Rt({id:t,geometry:new p2,modelMatrix:a,attributes:{show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};tm.prototype._isHidden=function(e,t){return!c(t.plane)||!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};tm.prototype._getIsClosed=function(e){return!1};tm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!J.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!J.isConstant(t.outlineWidth)};tm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ye.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ye.MINIMUM_VALUE,i.dimensions)};tm.DynamicGeometryUpdater=cV;function cV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(cV.prototype=Object.create(ii.prototype),cV.prototype.constructor=cV);cV.prototype._isHidden=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(e.position,n,Lqe);return!c(o)||!c(i.plane)||!c(i.dimensions)||ii.prototype._isHidden.call(this,e,t,n)};cV.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 Rqe=new m,Gqe=new m,Eqe=new m,Xqe=new m,Iqe=new te,Wqe=new te,wqe=new M;function wJ(e,t,n,i){let o=e.normal,r=e.distance,s=m.multiplyByScalar(o,-r,Eqe),a=m.clone(m.UNIT_Z,Gqe);w.equalsEpsilon(Math.abs(m.dot(a,o)),1,w.EPSILON8)&&(a=m.clone(m.UNIT_Y,a));let l=m.cross(a,o,Rqe);a=m.cross(o,l,a),m.normalize(l,l),m.normalize(a,a);let d=Iqe;te.setColumn(d,0,l,d),te.setColumn(d,1,a,d),te.setColumn(d,2,o,d);let u=m.fromElements(t.x,t.y,1,Xqe),f=te.multiplyByScale(d,u,Wqe),p=M.fromRotationTranslation(f,s,wqe);return M.multiplyTransformation(n,p,i)}tm.createPrimitiveMatrix=wJ;var b2=tm;var Fdi=_(T(),1);var vli=_(T(),1);var Pqe=new m,vqe=new je,Fqe=new D,Aqe=new D,Mqe=new m,Nqe=new m,kqe=new m,y2=new m,Uqe=new m,Oqe=new m,xfe=new Fe,Dqe=new te,Bqe=new te,Yqe=new m;function Hqe(e,t,n,i,o,r,s,a,l){let d=e.positions,u=ai.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let f=Me.createTypedArray(d.length,u.length);f.set(u);let p=Dqe;if(i!==0){let b=Fe.fromAxisAngle(s,i,xfe);if(p=te.fromQuaternion(b,p),t.tangent||t.bitangent){b=Fe.fromAxisAngle(s,-i,xfe);let G=te.fromQuaternion(b,Bqe);a=m.normalize(te.multiplyByVector(G,a,a),a),t.bitangent&&(l=m.normalize(m.cross(s,a,l),l))}}else p=te.clone(te.IDENTITY,p);let y=Aqe;t.st&&(y.x=n.x,y.y=n.y);let h=d.length,g=h*3,x=new Float64Array(g),S=t.normal?new Float32Array(g):void 0,V=t.tangent?new Float32Array(g):void 0,Z=t.bitangent?new Float32Array(g):void 0,R=t.st?new Float32Array(h*2):void 0,E=0,I=0,v=0,P=0,F=0;for(let b=0;b<h;b++){let G=d[b];if(x[E++]=G.x,x[E++]=G.y,x[E++]=G.z,t.st)if(c(o)&&o.positions.length===h)R[F++]=o.positions[b].x,R[F++]=o.positions[b].y;else{let X=te.multiplyByVector(p,G,Pqe),W=r(X,Fqe);D.subtract(W,y,W);let A=w.clamp(W.x/n.width,0,1),k=w.clamp(W.y/n.height,0,1);R[F++]=A,R[F++]=k}t.normal&&(S[I++]=s.x,S[I++]=s.y,S[I++]=s.z),t.tangent&&(V[P++]=a.x,V[P++]=a.y,V[P++]=a.z),t.bitangent&&(Z[v++]=l.x,Z[v++]=l.y,Z[v++]=l.z)}let N=new fn;return t.position&&(N.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:x})),t.normal&&(N.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:S})),t.tangent&&(N.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:V})),t.bitangent&&(N.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:Z})),t.st&&(N.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:R})),new dt({attributes:N,indices:f,primitiveType:ve.TRIANGLES})}function dT(e){e=e??z.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates;C.defined("options.polygonHierarchy",t);let i=e.vertexFormat??We.DEFAULT;this._vertexFormat=We.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Dn.computeHierarchyPackedLength(t,m)+We.packedLength+re.packedLength+(c(n)?Dn.computeHierarchyPackedLength(n,D):1)+2}dT.fromPositions=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new dT(t)};dT.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._stRotation,c(e._textureCoordinates)?n=Dn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var zqe=re.clone(re.UNIT_SPHERE),Kqe=new We,Jqe={polygonHierarchy:{}};dT.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=Dn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,zqe);t+=re.packedLength;let r=We.unpack(e,t,Kqe);t+=We.packedLength;let s=e[t++],a=e[t]===-1?void 0:Dn.unpackPolygonHierarchy(e,t,D);c(a)?(t=a.startingIndex,delete a.startingIndex):t++;let l=e[t++];return c(n)||(n=new dT(Jqe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=l,n};dT.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=c(o),s=n.positions;if(s=xo(s,m.equalsEpsilon,!0),s.length<3)return;let a=Mqe,l=Nqe,d=kqe,u=Uqe,f=Oqe;if(!Eb.computeProjectTo2DArguments(s,y2,u,f))return;if(a=m.cross(u,f,a),a=m.normalize(a,a),!m.equalsEpsilon(y2,m.ZERO,w.EPSILON6)){let F=e._ellipsoid.geodeticSurfaceNormal(y2,Yqe);m.dot(a,F)<0&&(a=m.negate(a,a),u=m.negate(u,u))}let y=Eb.createProjectPointsTo2DFunction(y2,u,f),h=Eb.createProjectPointTo2DFunction(y2,u,f);t.tangent&&(l=m.clone(u,l)),t.bitangent&&(d=m.clone(f,d));let g=Dn.polygonsFromHierarchy(n,r,y,!1),x=g.hierarchy,S=g.polygons,V=function(F){return F},Z=r?Dn.polygonsFromHierarchy(o,!0,V,!1).polygons:void 0;if(x.length===0)return;s=x[0].outerRing;let R=ue.fromPoints(s),E=Dn.computeBoundingRectangle(a,h,s,i,vqe),I=[];for(let F=0;F<S.length;F++){let N=new Rt({geometry:Hqe(S[F],t,E,i,r?Z[F]:void 0,h,a,l,d)});I.push(N)}let v=An.combineInstances(I)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Me.createTypedArray(v.attributes.position.values.length/3,v.indices);let P=v.attributes;return t.position||delete P.position,new dt({attributes:P,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:R})};var g2=dT;var rdi=_(T(),1);var _fe=[],oU=[];function Qqe(e,t,n,i,o){let s=$r.fromPoints(t,e).projectPointsOntoPlane(t,_fe);ai.computeWindingOrder2D(s)===qr.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,d,u=t.length,f=0;if(i)for(l=new Float64Array(u*2*3),d=0;d<u;d++){let h=t[d],g=t[(d+1)%u];l[f++]=h.x,l[f++]=h.y,l[f++]=h.z,l[f++]=g.x,l[f++]=g.y,l[f++]=g.z}else{let h=0;if(o===Kt.GEODESIC)for(d=0;d<u;d++)h+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===Kt.RHUMB)for(d=0;d<u;d++)h+=Dn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(l=new Float64Array(h*3),d=0;d<u;d++){let g;o===Kt.GEODESIC?g=Dn.subdivideLine(t[d],t[(d+1)%u],n,oU):o===Kt.RHUMB&&(g=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,oU));let x=g.length;for(let S=0;S<x;++S)l[f++]=g[S]}}u=l.length/3;let p=u*2,y=Me.createTypedArray(u,p);for(f=0,d=0;d<u-1;d++)y[f++]=d,y[f++]=d+1;return y[f++]=u-1,y[f++]=0,new Rt({geometry:new dt({attributes:new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:l})}),indices:y,primitiveType:ve.LINES})})}function jqe(e,t,n,i,o){let s=$r.fromPoints(t,e).projectPointsOntoPlane(t,_fe);ai.computeWindingOrder2D(s)===qr.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,d,u=t.length,f=new Array(u),p=0;if(i)for(l=new Float64Array(u*2*3*2),d=0;d<u;++d){f[d]=p/3;let x=t[d],S=t[(d+1)%u];l[p++]=x.x,l[p++]=x.y,l[p++]=x.z,l[p++]=S.x,l[p++]=S.y,l[p++]=S.z}else{let x=0;if(o===Kt.GEODESIC)for(d=0;d<u;d++)x+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===Kt.RHUMB)for(d=0;d<u;d++)x+=Dn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(l=new Float64Array(x*3*2),d=0;d<u;++d){f[d]=p/3;let S;o===Kt.GEODESIC?S=Dn.subdivideLine(t[d],t[(d+1)%u],n,oU):o===Kt.RHUMB&&(S=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,oU));let V=S.length;for(let Z=0;Z<V;++Z)l[p++]=S[Z]}}u=l.length/(3*2);let y=f.length,h=(u*2+y)*2,g=Me.createTypedArray(u+y,h);for(p=0,d=0;d<u;++d)g[p++]=d,g[p++]=(d+1)%u,g[p++]=d+u,g[p++]=(d+1)%u+u;for(d=0;d<y;d++){let x=f[d];g[p++]=x,g[p++]=x+u}return new Rt({geometry:new dt({attributes:new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:l})}),indices:g,primitiveType:ve.LINES})})}function uT(e){if(C.typeOf.object("options",e),C.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&c(e.height))throw new L("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==Kt.GEODESIC&&e.arcType!==Kt.RHUMB)throw new L("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.ellipsoid??re.default,i=e.granularity??w.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&c(e.extrudedHeight),s=e.arcType??Kt.GEODESIC,a=e.height??0,l=e.extrudedHeight??a;if(!r){let d=Math.max(a,l);l=Math.min(a,l),a=d}this._ellipsoid=re.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=l,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Dn.computeHierarchyPackedLength(t,m)+re.packedLength+8}uT.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,m),re.pack(e._ellipsoid,t,n),n+=re.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 qqe=re.clone(re.UNIT_SPHERE),$qe={polygonHierarchy:{}};uT.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=Dn.unpackPolygonHierarchy(e,t,m);t=i.startingIndex,delete i.startingIndex;let o=re.unpack(e,t,qqe);t+=re.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++]===1,d=e[t++]===1,u=e[t++],f=e[t++],p=e[t];return c(n)||(n=new uT($qe)),n._polygonHierarchy=i,n._ellipsoid=re.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=l,n._arcType=u,n._offsetAttribute=f===-1?void 0:f,n.packedLength=p,n};uT.fromPositions=function(e){e=e??z.EMPTY_OBJECT,C.defined("options.positions",e.positions);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 uT(t)};uT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Dn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,l=[],d=w.chordLength(n,t.maximumRadius),u=e._height,f=e._extrudedHeight,p=e._perPositionHeightExtrude||!w.equalsEpsilon(u,f,0,w.EPSILON2),y,h;if(p)for(h=0;h<s.length;h++){if(a=jqe(t,s[h],d,o,r),a.geometry=Dn.scaleToGeodeticHeightExtruded(a.geometry,u,f,t,o),c(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length/3,V=new Uint8Array(S);e._offsetAttribute===$t.TOP?V=V.fill(1,0,S/2):(y=e._offsetAttribute===$t.NONE?0:1,V=V.fill(y)),a.geometry.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}l.push(a)}else for(h=0;h<s.length;h++){if(a=Qqe(t,s[h],d,o,r),a.geometry.attributes.position.values=ai.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),c(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length;y=e._offsetAttribute===$t.NONE?0:1;let V=new Uint8Array(S/3).fill(y);a.geometry.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}l.push(a)}let g=An.combineInstances(l)[0],x=ue.fromVertices(g.attributes.position.values);return new dt({attributes:g.attributes,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:x,offsetAttribute:e._offsetAttribute})};var x2=uT;var Tfe="Entity polygons cannot have both height and perPositionHeight.  height will be ignored",Sfe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Cfe=new Y,Vfe=m.ZERO,Lfe=new m,Zfe=new de,e$e=[],t$e=new D;function n$e(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 kd(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new n$e(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}c(Object.create)&&(kd.prototype=Object.create(Yn.prototype),kd.prototype.constructor=kd);kd.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Tn(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 Ut){let s;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Cfe)),c(s)||(s=Y.WHITE),o.color=Yt.fromColor(s)}c(i.offsetAttribute)&&(o.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vfe,Lfe)));let r;return i.perPositionHeight&&!c(i.extrudedHeight)?r=new g2(i):r=new ob(i),new Rt({id:t,geometry:r,attributes:o})};kd.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Cfe),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};c(i.offsetAttribute)&&(s.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Vfe,Lfe)));let a;return i.perPositionHeight&&!c(i.extrudedHeight)?a=new zu(i):a=new x2(i),new Rt({id:t,geometry:a,attributes:s})};kd.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!c(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=$r.fromPoints(i,o),s=r.projectPointsOntoPlane(i,e$e),a=s.length,l=0,d=a-1,u=new D;for(let p=0;p<a;d=p++){let y=s[p],h=s[d],g=y.x*h.y-h.x*y.y,x=D.add(y,h,t$e);x=D.multiplyByScalar(x,g,x),u=D.add(u,x,u),l+=g}let f=1/(l*3);return u=D.multiplyByScalar(u,f,u),r.projectPointOntoEllipsoid(u,t)};kd.prototype._isHidden=function(e,t){return!c(t.hierarchy)||oi.prototype._isHidden.call(this,e,t)};kd.prototype._isOnTerrain=function(e,t){let n=Yn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=c(i)&&(i.isConstant?i.getValue(Ye.MINIMUM_VALUE):!0);return n&&!o};kd.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 Ut)};kd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ye.MINIMUM_VALUE),r=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),s=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),a=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),l=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE),d=J.getValueOrDefault(t.perPositionHeight,Ye.MINIMUM_VALUE,!1);r=Yn.getGeometryHeight(r,s);let u;if(d?(c(r)&&(r=void 0,ht(Tfe)),s!==ze.NONE&&d&&(r=void 0,ht(Sfe))):(c(a)&&!c(r)&&(r=0),u=Yn.computeGeometryOffsetAttribute(r,s,a,l)),i.polygonHierarchy=o,i.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),i.stRotation=J.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=J.getValueOrDefault(t.closeTop,Ye.MINIMUM_VALUE,!0),i.closeBottom=J.getValueOrDefault(t.closeBottom,Ye.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=J.getValueOrDefault(t.arcType,Ye.MINIMUM_VALUE,Kt.GEODESIC),i.textureCoordinates=J.getValueOrUndefined(t.textureCoordinates,Ye.MINIMUM_VALUE),a=Yn.getGeometryExtrudedHeight(a,l),a===Yn.CLAMP_TO_GROUND){let f=ob.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Zfe);a=ui.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};kd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=c(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};kd.DynamicGeometryUpdater=lV;function lV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(lV.prototype=Object.create(ii.prototype),lV.prototype.constructor=lV);lV.prototype._isHidden=function(e,t,n){return!c(this._options.polygonHierarchy)||ii.prototype._isHidden.call(this,e,t,n)};lV.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,ze.NONE),s=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE),a=J.getValueOrUndefined(t.extrudedHeight,n),l=J.getValueOrUndefined(t.perPositionHeight,n);o=Yn.getGeometryHeight(o,s);let d;if(l?(c(o)&&(o=void 0,ht(Tfe)),r!==ze.NONE&&l&&(o=void 0,ht(Sfe))):(c(a)&&!c(o)&&(o=0),d=Yn.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=d,i.height=o,i.arcType=J.getValueOrDefault(t.arcType,n,Kt.GEODESIC),a=Yn.getGeometryExtrudedHeight(a,s),a===Yn.CLAMP_TO_GROUND){let u=ob.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Zfe);a=ui.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var _2=kd;var Kui=_(T(),1);var aui=_(T(),1);function i$e(e,t,n,i){let o=new fn;i.position&&(o.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),l=ai.triangulate(t),d=(a-1)*r*6+l.length*2,u=Me.createTypedArray(s,d),f,p,y,h,g,x,S=r*2,V=0;for(f=0;f<a-1;f++){for(p=0;p<r-1;p++)y=p*2+f*r*2,x=y+S,h=y+1,g=h+S,u[V++]=h,u[V++]=y,u[V++]=g,u[V++]=g,u[V++]=y,u[V++]=x;y=r*2-2+f*r*2,h=y+1,g=h+S,x=y+S,u[V++]=h,u[V++]=y,u[V++]=g,u[V++]=g,u[V++]=y,u[V++]=x}if(i.st||i.tangent||i.bitangent){let E=new Float32Array(s*2),I=1/(a-1),v=1/n.height,P=n.height/2,F,N,b=0;for(f=0;f<a;f++){for(F=f*I,N=v*(t[0].y+P),E[b++]=F,E[b++]=N,p=1;p<r;p++)N=v*(t[p].y+P),E[b++]=F,E[b++]=N,E[b++]=F,E[b++]=N;N=v*(t[0].y+P),E[b++]=F,E[b++]=N}for(p=0;p<r;p++)F=0,N=v*(t[p].y+P),E[b++]=F,E[b++]=N;for(p=0;p<r;p++)F=(a-1)*I,N=v*(t[p].y+P),E[b++]=F,E[b++]=N;o.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}let Z=s-r*2;for(f=0;f<l.length;f+=3){let E=l[f]+Z,I=l[f+1]+Z,v=l[f+2]+Z;u[V++]=E,u[V++]=I,u[V++]=v,u[V++]=v+r,u[V++]=I+r,u[V++]=E+r}let R=new dt({attributes:o,indices:u,boundingSphere:ue.fromVertices(e),primitiveType:ve.TRIANGLES});if(i.normal&&(R=An.computeNormal(R)),i.tangent||i.bitangent){try{R=An.computeTangentAndBitangent(R)}catch{ht("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(R.attributes.tangent=void 0),i.bitangent||(R.attributes.bitangent=void 0),i.st||(R.attributes.st=void 0)}return R}function S2(e){e=e??z.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new L("options.polylinePositions is required.");if(!c(n))throw new L("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._cornerType=e.cornerType??Fi.ROUNDED,this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+re.packedLength+We.packedLength+2}S2.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Rfe=re.clone(re.UNIT_SPHERE),Gfe=new We,T2={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Rfe,vertexFormat:Gfe,cornerType:void 0,granularity:void 0};S2.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=re.unpack(e,t,Rfe);t+=re.packedLength;let l=We.unpack(e,t,Gfe);t+=We.packedLength;let d=e[t++],u=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=We.clone(l,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(T2.polylinePositions=r,T2.shapePositions=s,T2.cornerType=d,T2.granularity=u,new S2(T2))};var o$e=new je;S2.createGeometry=function(e){let t=e._positions,n=xo(t,m.equalsEpsilon),i=e._shape;if(i=bf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ai.computeWindingOrder2D(i)===qr.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,o$e),r=bf.computePositions(n,i,o,e,!0);return i$e(r,i,o,e._vertexFormat)};var C2=S2;var Eui=_(T(),1);function r$e(e,t){let n=new fn;n.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Me.createTypedArray(o,2*i*(s+1)),l,d,u=0;l=0;let f=l*i;for(d=0;d<i-1;d++)a[u++]=d+f,a[u++]=d+f+1;for(a[u++]=i-1+f,a[u++]=f,l=s-1,f=l*i,d=0;d<i-1;d++)a[u++]=d+f,a[u++]=d+f+1;for(a[u++]=i-1+f,a[u++]=f,l=0;l<s-1;l++){let y=i*l,h=y+i;for(d=0;d<i;d++)a[u++]=d+y,a[u++]=d+h}return new dt({attributes:n,indices:Me.createTypedArray(o,a),boundingSphere:ue.fromVertices(e),primitiveType:ve.LINES})}function L2(e){e=e??z.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new L("options.polylinePositions is required.");if(!c(n))throw new L("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._cornerType=e.cornerType??Fi.ROUNDED,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*m.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+re.packedLength+2}L2.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Efe=re.clone(re.UNIT_SPHERE),V2={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Efe,height:void 0,cornerType:void 0,granularity:void 0};L2.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=re.unpack(e,t,Efe);t+=re.packedLength;let l=e[t++],d=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._cornerType=l,n._granularity=d,n):(V2.polylinePositions=r,V2.shapePositions=s,V2.cornerType=l,V2.granularity=d,new L2(V2))};var s$e=new je;L2.createGeometry=function(e){let t=e._positions,n=xo(t,m.equalsEpsilon),i=e._shape;if(i=bf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;ai.computeWindingOrder2D(i)===qr.CLOCKWISE&&i.reverse();let o=je.fromPoints(i,s$e),r=bf.computePositions(n,i,o,e,!1);return r$e(r,i)};var Z2=L2;var Xfe=new Y;function a$e(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 Fh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new a$e(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}c(Object.create)&&(Fh.prototype=Object.create(oi.prototype),Fh.prototype.constructor=Fh);Fh.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,Xfe)),c(l)||(l=Y.WHITE),o=Yt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Rt({id:t,geometry:new C2(this._options),attributes:i})};Fh.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Xfe),o=this._distanceDisplayConditionProperty.getValue(e);return new Rt({id:t,geometry:new Z2(this._options),attributes:{show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Fh.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.shape)||oi.prototype._isHidden.call(this,e,t)};Fh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!J.isConstant(t.granularity)||!J.isConstant(t.outlineWidth)||!J.isConstant(t.cornerType)};Fh.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ye.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ye.MINIMUM_VALUE,o.shape),o.granularity=c(n)?n.getValue(Ye.MINIMUM_VALUE):void 0,o.cornerType=c(i)?i.getValue(Ye.MINIMUM_VALUE):void 0};Fh.DynamicGeometryUpdater=dV;function dV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(dV.prototype=Object.create(ii.prototype),dV.prototype.constructor=dV);dV.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.polylinePositions)||!c(i.shapePositions)||ii.prototype._isHidden.call(this,e,t,n)};dV.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 R2=Fh;var Jmi=_(T(),1);var Smi=_(T(),1);var PJ=new m,wfe=new m,Pfe=new m,vfe=new m,Ffe=new de,c$e=new D,l$e=new ue,d$e=new ue;function Afe(e,t){let n=new dt({attributes:new fn,primitiveType:ve.TRIANGLES});return n.attributes.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function u$e(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,l=0,d=vfe,u=Pfe,f=wfe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let y=m.fromArray(e,p,PJ),h=l+1,g=l+2;f=n.geodeticSurfaceNormal(y,f),(t.tangent||t.bitangent)&&(m.cross(m.UNIT_Z,f,u),te.multiplyByVector(i,u,u),m.normalize(u,u),t.bitangent&&m.normalize(m.cross(f,u,d),d)),t.normal&&(r[l]=f.x,r[h]=f.y,r[g]=f.z),t.tangent&&(s[l]=u.x,s[h]=u.y,s[g]=u.z),t.bitangent&&(a[l]=d.x,a[h]=d.y,a[g]=d.z),l+=3}return Afe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var vJ=new m,Mfe=new m;function m$e(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,l=0,d=0,u=!0,f=vfe,p=Pfe,y=wfe;if(t.normal||t.tangent||t.bitangent)for(let h=0;h<i;h+=6){let g=m.fromArray(e,h,PJ),x=m.fromArray(e,(h+6)%i,vJ);if(u){let S=m.fromArray(e,(h+3)%i,Mfe);m.subtract(x,g,x),m.subtract(S,g,S),y=m.normalize(m.cross(S,x,y),y),u=!1}m.equalsEpsilon(x,g,w.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(f=n.geodeticSurfaceNormal(g,f),t.tangent&&(p=m.normalize(m.cross(f,y,p),p))),t.normal&&(o[a++]=y.x,o[a++]=y.y,o[a++]=y.z,o[a++]=y.x,o[a++]=y.y,o[a++]=y.z),t.tangent&&(r[l++]=p.x,r[l++]=p.y,r[l++]=p.z,r[l++]=p.x,r[l++]=p.y,r[l++]=p.z),t.bitangent&&(s[d++]=f.x,s[d++]=f.y,s[d++]=f.z,s[d++]=f.x,s[d++]=f.y,s[d++]=f.z)}return Afe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function Nfe(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,l=0,d=o,u=o,f=0;s&&(l=1,u-=1,f+=1),a&&(d-=1,u-=1,f+=1),f+=r*u;let p=n.position?new Float64Array(f*3):void 0,y=n.st?new Float32Array(f*2):void 0,h=0,g=0,x=PJ,S=c$e,V=Number.MAX_VALUE,Z=Number.MAX_VALUE,R=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let G=l;G<d;++G)for(let X=0;X<r;++X)Rs.computePosition(t,i,n.st,G,X,x,S),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(y[g++]=S.x,y[g++]=S.y,V=Math.min(V,S.x),Z=Math.min(Z,S.y),R=Math.max(R,S.x),E=Math.max(E,S.y));if(s&&(Rs.computePosition(t,i,n.st,0,0,x,S),p[h++]=x.x,p[h++]=x.y,p[h++]=x.z,n.st&&(y[g++]=S.x,y[g++]=S.y,V=S.x,Z=S.y,R=S.x,E=S.y)),a&&(Rs.computePosition(t,i,n.st,o-1,0,x,S),p[h++]=x.x,p[h++]=x.y,p[h]=x.z,n.st&&(y[g++]=S.x,y[g]=S.y,V=Math.min(V,S.x),Z=Math.min(Z,S.y),R=Math.max(R,S.x),E=Math.max(E,S.y))),n.st&&(V<0||Z<0||R>1||E>1))for(let G=0;G<y.length;G+=2)y[G]=(y[G]-V)/(R-V),y[G+1]=(y[G+1]-Z)/(E-Z);let I=u$e(p,n,i,t.tangentRotationMatrix),v=6*(r-1)*(u-1);s&&(v+=3*(r-1)),a&&(v+=3*(r-1));let P=Me.createTypedArray(f,v),F=0,N=0,b;for(b=0;b<u-1;++b){for(let G=0;G<r-1;++G){let X=F,W=X+r,A=W+1,k=X+1;P[N++]=X,P[N++]=W,P[N++]=k,P[N++]=k,P[N++]=W,P[N++]=A,++F}++F}if(s||a){let G=f-1,X=f-1;s&&a&&(G=f-2);let W,A;if(F=0,s)for(b=0;b<r-1;b++)W=F,A=W+1,P[N++]=G,P[N++]=W,P[N++]=A,++F;if(a)for(F=(u-1)*r,b=0;b<r-1;b++)W=F,A=W+1,P[N++]=W,P[N++]=X,P[N++]=A,++F}return I.indices=P,n.st&&(I.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:y})),I}function uV(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 mV(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 FJ=new We;function f$e(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,l=t.height,d=t.width,u;if(n){let qe=We.clone(o,FJ);qe.normal=!0,e._vertexFormat=qe}let f=Nfe(e,t);n&&(e._vertexFormat=o);let p=ai.scaleToGeodeticHeight(f.attributes.position.values,s,a,!1);p=new Float64Array(p);let y=p.length,h=y*2,g=new Float64Array(h);g.set(p);let x=ai.scaleToGeodeticHeight(f.attributes.position.values,r,a);g.set(x,y),f.attributes.position.values=g;let S=o.normal?new Float32Array(h):void 0,V=o.tangent?new Float32Array(h):void 0,Z=o.bitangent?new Float32Array(h):void 0,R=o.st?new Float32Array(h/3*2):void 0,E,I;if(o.normal){for(I=f.attributes.normal.values,S.set(I),u=0;u<y;u++)I[u]=-I[u];S.set(I,y),f.attributes.normal.values=S}if(n){I=f.attributes.normal.values,o.normal||(f.attributes.normal=void 0);let qe=new Float32Array(h);for(u=0;u<y;u++)I[u]=-I[u];qe.set(I,y),f.attributes.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:qe})}let v,P=c(i);if(P){let qe=y/3*2,mn=new Uint8Array(qe);i===$t.TOP?mn=mn.fill(1,0,qe/2):(v=i===$t.NONE?0:1,mn=mn.fill(v)),f.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:mn})}if(o.tangent){let qe=f.attributes.tangent.values;for(V.set(qe),u=0;u<y;u++)qe[u]=-qe[u];V.set(qe,y),f.attributes.tangent.values=V}if(o.bitangent){let qe=f.attributes.bitangent.values;Z.set(qe),Z.set(qe,y),f.attributes.bitangent.values=Z}o.st&&(E=f.attributes.st.values,R.set(E),R.set(E,y/3*2),f.attributes.st.values=R);let F=f.indices,N=F.length,b=y/3,G=Me.createTypedArray(h/3,N*2);for(G.set(F),u=0;u<N;u+=3)G[u+N]=F[u+2]+b,G[u+1+N]=F[u+1]+b,G[u+2+N]=F[u]+b;f.indices=G;let X=t.northCap,W=t.southCap,A=l,k=2,B=0,O=4,H=4;X&&(k-=1,A-=1,B+=1,O-=2,H-=1),W&&(k-=1,A-=1,B+=1,O-=2,H-=1),B+=k*d+2*A-O;let U=(B+H)*2,K=new Float64Array(U*3),Q=n?new Float32Array(U*3):void 0,ie=P?new Uint8Array(U):void 0,j=o.st?new Float32Array(U*2):void 0,$=i===$t.TOP;P&&!$&&(v=i===$t.ALL?1:0,ie=ie.fill(v));let ne=0,be=0,Ce=0,me=0,_e=d*A,Ve;for(u=0;u<_e;u+=d)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);if(W){let qe=X?_e+1:_e;for(Ve=qe*3,u=0;u<2;u++)K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,qe*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1)}else for(u=_e-d;u<_e;u++)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);for(u=_e-1;u>0;u-=d)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);if(X){let qe=_e;for(Ve=qe*3,u=0;u<2;u++)K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,qe*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1)}else for(u=d-1;u>=0;u--)Ve=u*3,K=uV(K,ne,Ve,p,x),ne+=6,o.st&&(j=mV(j,be,u*2,E),be+=4),n&&(Ce+=3,Q[Ce++]=I[Ve],Q[Ce++]=I[Ve+1],Q[Ce++]=I[Ve+2]),$&&(ie[me++]=1,me+=1);let Ie=m$e(K,o,a);o.st&&(Ie.attributes.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:j})),n&&(Ie.attributes.extrudeDirection=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:Q})),P&&(Ie.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:ie}));let Ze=Me.createTypedArray(U,B*6),De,Ke,rt,Xt;y=K.length/3;let Ht=0;for(u=0;u<y-1;u+=2){De=u,Xt=(De+2)%y;let qe=m.fromArray(K,De*3,vJ),mn=m.fromArray(K,Xt*3,Mfe);m.equalsEpsilon(qe,mn,w.EPSILON10)||(Ke=(De+1)%y,rt=(Ke+2)%y,Ze[Ht++]=De,Ze[Ht++]=Ke,Ze[Ht++]=Xt,Ze[Ht++]=Xt,Ze[Ht++]=Ke,Ze[Ht++]=rt)}return Ie.indices=Ze,Ie=An.combineInstances([new Rt({geometry:f}),new Rt({geometry:Ie})]),Ie[0]}var h$e=[new m,new m,new m,new m],kfe=new pe,p$e=new pe;function AJ(e,t,n,i,o){if(n===0)return de.clone(e,o);let r=Rs.computeOptions(e,t,n,0,Ffe,kfe),s=r.height,a=r.width,l=h$e;return Rs.computePosition(r,i,!1,0,0,l[0]),Rs.computePosition(r,i,!1,0,a-1,l[1]),Rs.computePosition(r,i,!1,s-1,0,l[2]),Rs.computePosition(r,i,!1,s-1,a-1,l[3]),de.fromCartesianArray(l,i,o)}function Ah(e){e=e??z.EMPTY_OBJECT;let t=e.rectangle;if(C.typeOf.object("rectangle",t),de._validate(t),t.north<t.south)throw new L("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=e.height??0,i=e.extrudedHeight??n;this._rectangle=de.clone(t),this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Ah.packedLength=de.packedLength+re.packedLength+We.packedLength+7;Ah.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),n=n??0,de.pack(e._rectangle,t,n),n+=de.packedLength,re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var Ufe=new de,Ofe=re.clone(re.UNIT_SPHERE),ig={rectangle:Ufe,ellipsoid:Ofe,vertexFormat:FJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Ah.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=de.unpack(e,t,Ufe);t+=de.packedLength;let o=re.unpack(e,t,Ofe);t+=re.packedLength;let r=We.unpack(e,t,FJ);t+=We.packedLength;let s=e[t++],a=e[t++],l=e[t++],d=e[t++],u=e[t++],f=e[t++]===1,p=e[t];return c(n)?(n._rectangle=de.clone(i,n._rectangle),n._ellipsoid=re.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=l,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=f,n._offsetAttribute=p===-1?void 0:p,n):(ig.granularity=s,ig.height=a,ig.rotation=l,ig.stRotation=d,ig.extrudedHeight=u,ig.shadowVolume=f,ig.offsetAttribute=p===-1?void 0:p,new Ah(ig))};Ah.computeRectangle=function(e,t){e=e??z.EMPTY_OBJECT;let n=e.rectangle;if(C.typeOf.object("rectangle",n),de._validate(n),n.north<n.south)throw new L("options.rectangle.north must be greater than or equal to options.rectangle.south");let i=e.granularity??w.RADIANS_PER_DEGREE,o=e.ellipsoid??re.default,r=e.rotation??0;return AJ(n,i,r,o,t)};var b$e=new te,Ife=new Fe,y$e=new pe;Ah.createGeometry=function(e){if(w.equalsEpsilon(e._rectangle.north,e._rectangle.south,w.EPSILON10)||w.equalsEpsilon(e._rectangle.east,e._rectangle.west,w.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Rs.computeOptions(t,e._granularity,i,o,Ffe,kfe,p$e),a=b$e;if(o!==0||i!==0){let y=de.center(t,y$e),h=n.geodeticSurfaceNormalCartographic(y,vJ);Fe.fromAxisAngle(h,-o,Ife),te.fromQuaternion(Ife,a)}else te.clone(te.IDENTITY,a);let l=e._surfaceHeight,d=e._extrudedHeight,u=!w.equalsEpsilon(l,d,0,w.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let f,p;if(t=e._rectangle,u){f=f$e(e,s);let y=ue.fromRectangle3D(t,n,l,d$e),h=ue.fromRectangle3D(t,n,d,l$e);p=ue.union(y,h)}else{if(f=Nfe(e,s),f.attributes.position.values=ai.scaleToGeodeticHeight(f.attributes.position.values,l,n,!1),c(e._offsetAttribute)){let y=f.attributes.position.values.length,h=e._offsetAttribute===$t.NONE?0:1,g=new Uint8Array(y/3).fill(h);f.attributes.applyOffset=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}p=ue.fromRectangle3D(t,n,l)}return r.position||delete f.attributes.position,new dt({attributes:f.attributes,indices:f.indices,primitiveType:f.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Ah.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Ah({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};var Wfe=new de,g$e=[new D,new D,new D],x$e=new Ii,_$e=new pe;function T$e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=de.clone(e._rectangle,Wfe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=AJ(t,n,o,i,Wfe),s=g$e;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,l=Ii.fromRotation(e._stRotation,x$e),d=de.center(a,_$e);for(let h=0;h<3;++h){let g=s[h];g.x-=d.longitude,g.y-=d.latitude,Ii.multiplyByVector(l,g,g),g.x+=d.longitude,g.y+=d.latitude,g.x=(g.x-a.west)/a.width,g.y=(g.y-a.south)/a.height}let u=s[0],f=s[1],p=s[2],y=new Array(6);return D.pack(u,y),D.pack(f,y,2),D.pack(p,y,4),y}Object.defineProperties(Ah.prototype,{rectangle:{get:function(){return c(this._rotatedRectangle)||(this._rotatedRectangle=AJ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=T$e(this)),this._textureCoordinateRotationPoints}}});var mT=Ah;var Dfe=new Y,Bfe=m.ZERO,Yfe=new m,Hfe=new de,S$e=new de,C$e=new pe;function V$e(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 Vf(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new V$e(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}c(Object.create)&&(Vf.prototype=Object.create(Yn.prototype),Vf.prototype.constructor=Vf);Vf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new Tn(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 Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Dfe)),c(o)||(o=Y.WHITE),i.color=Yt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Bfe,Yfe))),new Rt({id:t,geometry:new mT(this._options),attributes:i})};Vf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,Dfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=$i.fromCartesian3(J.getValueOrDefault(this._terrainOffsetProperty,e,Bfe,Yfe))),new Rt({id:t,geometry:new U_(this._options),attributes:r})};Vf.prototype._computeCenter=function(e,t){let n=J.getValueOrUndefined(this._entity.rectangle.coordinates,e,S$e);if(!c(n))return;let i=de.center(n,C$e);return pe.toCartesian(i,re.default,t)};Vf.prototype._isHidden=function(e,t){return!c(t.coordinates)||oi.prototype._isHidden.call(this,e,t)};Vf.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 Ut)};Vf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=J.getValueOrUndefined(t.height,Ye.MINIMUM_VALUE),o=J.getValueOrDefault(t.heightReference,Ye.MINIMUM_VALUE,ze.NONE),r=J.getValueOrUndefined(t.extrudedHeight,Ye.MINIMUM_VALUE),s=J.getValueOrDefault(t.extrudedHeightReference,Ye.MINIMUM_VALUE,ze.NONE);c(r)&&!c(i)&&(i=0);let a=this._options;a.vertexFormat=n?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ye.MINIMUM_VALUE,a.rectangle),a.granularity=J.getValueOrUndefined(t.granularity,Ye.MINIMUM_VALUE),a.stRotation=J.getValueOrUndefined(t.stRotation,Ye.MINIMUM_VALUE),a.rotation=J.getValueOrUndefined(t.rotation,Ye.MINIMUM_VALUE),a.offsetAttribute=Yn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Yn.getGeometryHeight(i,o),r=Yn.getGeometryExtrudedHeight(r,s),r===Yn.CLAMP_TO_GROUND&&(r=ui.getMinimumMaximumHeights(mT.computeRectangle(a,Hfe)).minimumTerrainHeight),a.extrudedHeight=r};Vf.DynamicGeometryUpdater=fV;function fV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(fV.prototype=Object.create(ii.prototype),fV.prototype.constructor=fV);fV.prototype._isHidden=function(e,t,n){return!c(this._options.rectangle)||ii.prototype._isHidden.call(this,e,t,n)};fV.prototype._setOptions=function(e,t,n){let i=this._options,o=J.getValueOrUndefined(t.height,n),r=J.getValueOrDefault(t.heightReference,n,ze.NONE),s=J.getValueOrUndefined(t.extrudedHeight,n),a=J.getValueOrDefault(t.extrudedHeightReference,n,ze.NONE);c(s)&&!c(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=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=ui.getMinimumMaximumHeights(mT.computeRectangle(i,Hfe)).minimumTerrainHeight),i.extrudedHeight=s};var G2=Vf;var thi=_(T(),1);var _fi=_(T(),1);var ifi=_(T(),1);var zfe={};function L$e(e,t){return w.equalsEpsilon(e.latitude,t.latitude,w.EPSILON10)&&w.equalsEpsilon(e.longitude,t.longitude,w.EPSILON10)}var Z$e=new pe,R$e=new pe;function G$e(e,t,n,i){t=xo(t,m.equalsEpsilon);let o=t.length;if(o<2)return;let r=c(i),s=c(n),a=new Array(o),l=new Array(o),d=new Array(o),u=t[0];a[0]=u;let f=e.cartesianToCartographic(u,Z$e);s&&(f.height=n[0]),l[0]=f.height,r?d[0]=i[0]:d[0]=0;let p=l[0],y=d[0],h=p===y,g=1;for(let x=1;x<o;++x){let S=t[x],V=e.cartesianToCartographic(S,R$e);s&&(V.height=n[x]),h=h&&V.height===0,L$e(f,V)?f.height<V.height&&(l[g-1]=V.height):(a[g]=S,l[g]=V.height,r?d[g]=i[x]:d[g]=0,h=h&&l[g]===d[g],pe.clone(V,f),++g)}if(!(h||g<2))return a.length=g,l.length=g,d.length=g,{positions:a,topHeights:l,bottomHeights:d}}var E$e=new Array(2),X$e=new Array(2),I$e={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};zfe.computePositions=function(e,t,n,i,o,r){let s=G$e(e,t,n,i);if(!c(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,l=a-2,d,u,f=w.chordLength(o,e.maximumRadius),p=I$e;if(p.minDistance=f,p.ellipsoid=e,r){let y=0,h;for(h=0;h<a-1;h++)y+=vi.numberOfPoints(t[h],t[h+1],f)+1;d=new Float64Array(y*3),u=new Float64Array(y*3);let g=E$e,x=X$e;p.positions=g,p.height=x;let S=0;for(h=0;h<a-1;h++){g[0]=t[h],g[1]=t[h+1],x[0]=n[h],x[1]=n[h+1];let V=vi.generateArc(p);d.set(V,S),x[0]=i[h],x[1]=i[h+1],u.set(vi.generateArc(p),S),S+=V.length}}else p.positions=t,p.height=n,d=new Float64Array(vi.generateArc(p)),p.height=i,u=new Float64Array(vi.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:l}};var fT=zfe;var MJ=new m,rU=new m,W$e=new m,Kfe=new m,w$e=new m,P$e=new m,v$e=new m;function hT(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new L("options.positions is required.");if(c(n)&&n.length!==t.length)throw new L("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new L("options.positions and options.minimumHeights must have the same length.");let o=e.vertexFormat??We.DEFAULT,r=e.granularity??w.RADIANS_PER_DEGREE,s=e.ellipsoid??re.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=We.clone(o),this._granularity=r,this._ellipsoid=re.clone(s),this._workerName="createWallGeometry";let a=1+t.length*m.packedLength+2;c(i)&&(a+=i.length),c(n)&&(a+=n.length),this.packedLength=a+re.packedLength+We.packedLength+1}hT.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._granularity,t};var Jfe=re.clone(re.UNIT_SPHERE),Qfe=new We,E2={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Jfe,vertexFormat:Qfe,granularity:void 0};hT.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let l=re.unpack(e,t,Jfe);t+=re.packedLength;let d=We.unpack(e,t,Qfe);t+=We.packedLength;let u=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(l,n._ellipsoid),n._vertexFormat=We.clone(d,n._vertexFormat),n._granularity=u,n):(E2.positions=r,E2.minimumHeights=s,E2.maximumHeights=a,E2.granularity=u,new hT(E2))};hT.fromConstantHeights=function(e){e=e??z.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new hT(l)};hT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=fT.computePositions(s,t,i,n,r,!0);if(!c(a))return;let l=a.bottomPositions,d=a.topPositions,u=a.numCorners,f=d.length,p=f*2,y=o.position?new Float64Array(p):void 0,h=o.normal?new Float32Array(p):void 0,g=o.tangent?new Float32Array(p):void 0,x=o.bitangent?new Float32Array(p):void 0,S=o.st?new Float32Array(p/3*2):void 0,V=0,Z=0,R=0,E=0,I=0,v=v$e,P=P$e,F=w$e,N=!0;f/=3;let b,G=0,X=1/(f-u-1);for(b=0;b<f;++b){let O=b*3,H=m.fromArray(d,O,MJ),U=m.fromArray(l,O,rU);if(o.position&&(y[V++]=U.x,y[V++]=U.y,y[V++]=U.z,y[V++]=H.x,y[V++]=H.y,y[V++]=H.z),o.st&&(S[I++]=G,S[I++]=0,S[I++]=G,S[I++]=1),o.normal||o.tangent||o.bitangent){let K=m.clone(m.ZERO,Kfe),Q=m.subtract(H,s.geodeticSurfaceNormal(H,rU),rU);if(b+1<f&&(K=m.fromArray(d,O+3,Kfe)),N){let ie=m.subtract(K,H,W$e),j=m.subtract(Q,H,MJ);v=m.normalize(m.cross(j,ie,v),v),N=!1}m.equalsEpsilon(H,K,w.EPSILON10)?N=!0:(G+=X,o.tangent&&(P=m.normalize(m.subtract(K,H,P),P)),o.bitangent&&(F=m.normalize(m.cross(v,P,F),F))),o.normal&&(h[Z++]=v.x,h[Z++]=v.y,h[Z++]=v.z,h[Z++]=v.x,h[Z++]=v.y,h[Z++]=v.z),o.tangent&&(g[E++]=P.x,g[E++]=P.y,g[E++]=P.z,g[E++]=P.x,g[E++]=P.y,g[E++]=P.z),o.bitangent&&(x[R++]=F.x,x[R++]=F.y,x[R++]=F.z,x[R++]=F.x,x[R++]=F.y,x[R++]=F.z)}}let W=new fn;o.position&&(W.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:y})),o.normal&&(W.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(W.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:g})),o.bitangent&&(W.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:x})),o.st&&(W.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:S}));let A=p/3;p-=6*(u+1);let k=Me.createTypedArray(A,p),B=0;for(b=0;b<A-2;b+=2){let O=b,H=b+2,U=m.fromArray(y,O*3,MJ),K=m.fromArray(y,H*3,rU);if(m.equalsEpsilon(U,K,w.EPSILON10))continue;let Q=b+1,ie=b+3;k[B++]=Q,k[B++]=O,k[B++]=ie,k[B++]=ie,k[B++]=O,k[B++]=H}return new dt({attributes:W,indices:k,primitiveType:ve.TRIANGLES,boundingSphere:new ue.fromVertices(y)})};var X2=hT;var Ffi=_(T(),1);var jfe=new m,qfe=new m;function pT(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new L("options.positions is required.");if(c(n)&&n.length!==t.length)throw new L("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new L("options.positions and options.minimumHeights must have the same length.");let o=e.granularity??w.RADIANS_PER_DEGREE,r=e.ellipsoid??re.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=re.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*m.packedLength+2;c(i)&&(s+=i.length),c(n)&&(s+=n.length),this.packedLength=s+re.packedLength+1}pT.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n]=e._granularity,t};var $fe=re.clone(re.UNIT_SPHERE),I2={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:$fe,granularity:void 0};pT.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let l=re.unpack(e,t,$fe);t+=re.packedLength;let d=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=re.clone(l,n._ellipsoid),n._granularity=d,n):(I2.positions=r,I2.minimumHeights=s,I2.maximumHeights=a,I2.granularity=d,new pT(I2))};pT.fromConstantHeights=function(e){e=e??z.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new L("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new pT(l)};pT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=fT.computePositions(r,t,i,n,o,!1);if(!c(s))return;let a=s.bottomPositions,l=s.topPositions,d=l.length,u=d*2,f=new Float64Array(u),p=0;d/=3;let y;for(y=0;y<d;++y){let V=y*3,Z=m.fromArray(l,V,jfe),R=m.fromArray(a,V,qfe);f[p++]=R.x,f[p++]=R.y,f[p++]=R.z,f[p++]=Z.x,f[p++]=Z.y,f[p++]=Z.z}let h=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f})}),g=u/3;u=2*g-4+g;let x=Me.createTypedArray(g,u),S=0;for(y=0;y<g-2;y+=2){let V=y,Z=y+2,R=m.fromArray(f,V*3,jfe),E=m.fromArray(f,Z*3,qfe);if(m.equalsEpsilon(R,E,w.EPSILON10))continue;let I=y+1,v=y+3;x[S++]=I,x[S++]=V,x[S++]=I,x[S++]=v,x[S++]=V,x[S++]=Z}return x[S++]=g-2,x[S++]=g-1,new dt({attributes:h,indices:x,primitiveType:ve.LINES,boundingSphere:new ue.fromVertices(f)})};var W2=pT;var ehe=new Y;function F$e(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Lf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new F$e(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}c(Object.create)&&(Lf.prototype=Object.create(oi.prototype),Lf.prototype.constructor=Lf);Lf.prototype.createFillGeometryInstance=function(e){if(C.defined("time",e),!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,ehe)),c(l)||(l=Y.WHITE),o=Yt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Rt({id:t,geometry:new X2(this._options),attributes:i})};Lf.prototype.createOutlineGeometryInstance=function(e){if(C.defined("time",e),!this._outlineEnabled)throw new L("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=J.getValueOrDefault(this._outlineColorProperty,e,Y.BLACK,ehe),o=this._distanceDisplayConditionProperty.getValue(e);return new Rt({id:t,geometry:new W2(this._options),attributes:{show:new Tn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Yt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Lf.prototype._isHidden=function(e,t){return!c(t.positions)||oi.prototype._isHidden.call(this,e,t)};Lf.prototype._getIsClosed=function(e){return!1};Lf.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)};Lf.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?an.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ye.MINIMUM_VALUE,s.positions),s.minimumHeights=c(n)?n.getValue(Ye.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=c(i)?i.getValue(Ye.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=c(o)?o.getValue(Ye.MINIMUM_VALUE):void 0};Lf.DynamicGeometryUpdater=hV;function hV(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(hV.prototype=Object.create(ii.prototype),hV.prototype.constructor=hV);hV.prototype._isHidden=function(e,t,n){return!c(this._options.positions)||ii.prototype._isHidden.call(this,e,t,n)};hV.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 w2=Lf;var bT=[EX,qP,DP,u2,f2,b2,_2,R2,G2,w2];function yT(e,t){this.entity=e,this.scene=t;let n=new Array(bT.length),i=new ye,o=new hr;for(let r=0;r<n.length;r++){let s=new bT[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(yT.prototype._onEntityPropertyChanged,this)}yT.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)};yT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};yT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),he(this)};yT.registerUpdater=function(e){bT.includes(e)||bT.push(e)};yT.unregisterUpdater=function(e){if(bT.includes(e)){let t=bT.indexOf(e);bT.splice(t,1)}};var gT=yT;var Whi=_(T(),1);var the=new Y,A$e=new vt,M$e=new vt,N$e=m.ZERO,k$e=new m;function Zf(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 Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.subscriptions=new Zt,this.showsUpdated=new Zt,this.itemsToRemove=[],this.invalidated=!1;let a;c(o)&&(a=o.definitionChanged.addEventListener(Zf.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Zf.prototype.onMaterialChanged=function(){this.invalidated=!0};Zf.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:c(t)?t.equals(n):!1};Zf.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)}))}};Zf.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Zf.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){c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let l;c(this.depthFailAppearanceType)&&(c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),l=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:l,shadows:this.shadows}),o.add(i),t=!1}else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),f=this.attributes.get(u.id.id);if(c(f)||(f=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!d.fillMaterialProperty.isConstant||l){let x=d.fillMaterialProperty.color,S=J.getValueOrDefault(x,e,Y.WHITE,the);Y.equals(f._lastColor,S)||(f._lastColor=Y.clone(S,f._lastColor),f.color=Yt.toValue(S,f.color),(this.translucent&&f.color[3]===255||!this.translucent&&f.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(c(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Ut&&(!d.depthFailMaterialProperty.isConstant||l)){let x=d.depthFailMaterialProperty.color,S=J.getValueOrDefault(x,e,Y.WHITE,the);Y.equals(f._lastDepthFailColor,S)||(f._lastDepthFailColor=Y.clone(S,f._lastDepthFailColor),f.depthFailColor=Yt.toValue(S,f.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=d.distanceDisplayConditionProperty;if(!J.isConstant(h)){let x=J.getValueOrDefault(h,e,M$e,A$e);vt.equals(x,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(x,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(x,f.distanceDisplayCondition))}let g=d.terrainOffsetProperty;if(!J.isConstant(g)){let x=J.getValueOrDefault(g,e,N$e,k$e);m.equals(x,f._lastOffset)||(f._lastOffset=m.clone(x,f._lastOffset),f.offset=$i.toValue(x,f.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Zf.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=Tn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Zf.prototype.contains=function(e){return this.updaters.contains(e.id)};Zf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Zf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),c(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function pV(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}pV.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 l=n[a];if(l.isMaterial(t)){l.add(t,o);return}}let s=new Zf(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function nhe(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}pV.prototype.remove=function(e){nhe(this._solidItems,e)||nhe(this._translucentItems,e)};function ihe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,l=a.length;if(l>0)for(r=0;r<l;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function sU(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,l=a.length;for(let d=0;d<l;d++)e.add(n,a[d]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}pV.prototype.update=function(e){let t=sU(this,this._solidItems,e,!0);t=sU(this,this._translucentItems,e,t)&&t;let n=ihe(this,this._solidItems,e),i=ihe(this,this._translucentItems,e);return(n||i)&&(t=sU(this,this._solidItems,e,t)&&t,t=sU(this,this._translucentItems,e,t)&&t),t};function ohe(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 ut.FAILED}pV.prototype.getBoundingSphere=function(e,t){let n=ohe(this._solidItems,e,t);return n===ut.FAILED?ohe(this._translucentItems,e,t):n};function rhe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}pV.prototype.removeAllPrimitives=function(){rhe(this._solidItems),rhe(this._translucentItems)};var nm=pV;var Khi=_(T(),1);var U$e=new vt,O$e=new vt,D$e=m.ZERO,B$e=new m;function Rf(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 Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Rf.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt}Rf.prototype.onMaterialChanged=function(){this.invalidated=!0};Rf.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=c(t)&&t.equals(n);return r=(!c(i)&&!c(o)||c(i)&&i.equals(o))&&r,r};Rf.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};Rf.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var Y$e=new Y;Rf.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){c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material);let a;c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=qo.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 l=s[r],d=l.entity,u=this.geometry.get(l.id),f=this.attributes.get(u.id.id);if(c(f)||(f=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),c(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!l.depthFailMaterialProperty.isConstant){let x=l.depthFailMaterialProperty.color,S=J.getValueOrDefault(x,e,Y.WHITE,Y$e);Y.equals(f._lastDepthFailColor,S)||(f._lastDepthFailColor=Y.clone(S,f._lastDepthFailColor),f.depthFailColor=Yt.toValue(S,f.depthFailColor))}let p=d.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=l.distanceDisplayConditionProperty;if(!J.isConstant(h)){let x=J.getValueOrDefault(h,e,O$e,U$e);vt.equals(x,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(x,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(x,f.distanceDisplayCondition))}let g=l.terrainOffsetProperty;if(!J.isConstant(g)){let x=J.getValueOrDefault(g,e,D$e,B$e);m.equals(x,f._lastOffset)||(f._lastOffset=m.clone(x,f._lastOffset),f.offset=$i.toValue(x,f.offset))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Rf.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,d=a.show[0]===1;l!==d&&(a.show=Tn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Rf.prototype.contains=function(e){return this.updaters.contains(e.id)};Rf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Rf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function bV(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}bV.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 Rf(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};bV.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}}};bV.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};bV.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 ut.FAILED};bV.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 im=bV;var upi=_(T(),1);var qhi=_(T(),1),ahe=_(she(),1);function aU(){this._tree=new ahe.default}function xT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}xT.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};aU.prototype.insert=function(e,t){C.typeOf.string("id",e),C.typeOf.object("rectangle",t);let n=xT.fromRectangleAndId(e,t,new xT);this._tree.insert(n)};function H$e(e,t){return e.id===t.id}var z$e=new xT;aU.prototype.remove=function(e,t){C.typeOf.string("id",e),C.typeOf.object("rectangle",t);let n=xT.fromRectangleAndId(e,t,z$e);this._tree.remove(n,H$e)};var K$e=new xT;aU.prototype.collides=function(e){C.typeOf.object("rectangle",e);let t=xT.fromRectangleAndId("",e,K$e);return this._tree.collides(t)};var _T=aU;var J$e=new Y,Q$e=new vt,j$e=new vt;function qb(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 Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.subscriptions=new Zt,this.showsUpdated=new Zt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new _T}qb.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};qb.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)}))}};qb.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 c(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};qb.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new kc({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),f=this.attributes.get(u.id.id);if(c(f)||(f=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!d.fillMaterialProperty.isConstant||l){let g=d.fillMaterialProperty.color,x=J.getValueOrDefault(g,e,Y.WHITE,J$e);Y.equals(f._lastColor,x)||(f._lastColor=Y.clone(x,f._lastColor),f.color=Yt.toValue(x,f.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=d.distanceDisplayConditionProperty;if(!J.isConstant(h)){let g=J.getValueOrDefault(h,e,j$e,Q$e);vt.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(g,f.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};qb.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=Tn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};qb.prototype.contains=function(e){return this.updaters.contains(e.id)};qb.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getBoundingSphere(e.entity);return c(i)?(i.clone(t),ut.DONE):ut.FAILED};qb.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function yV(e,t){this._batches=[],this._primitives=e,this._classificationType=t}yV.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 l=i[a];if(l.zIndex===o&&!l.overlapping(n.geometry.rectangle)){r=l;break}}return c(r)||(r=new qb(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};yV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};yV.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,l=a.length;for(let d=0;d<l;d++){n=a[d],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};yV.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 ut.FAILED};yV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var gV=yV;var Lpi=_(T(),1);var q$e=new vt,$$e=new vt;function om(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(om.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new _T}om.prototype.onMaterialChanged=function(){this.invalidated=!0};om.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};om.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};om.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,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};om.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 c(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};om.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=qo.getValue(e,this.materialProperty,this.material),n=new kc({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{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=qo.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 l=s[r],d=l.entity,u=this.geometry.get(l.id),f=this.attributes.get(u.id.id);c(f)||(f=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f));let p=d.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=l.distanceDisplayConditionProperty;if(!J.isConstant(h)){let g=J.getValueOrDefault(h,e,$$e,q$e);vt.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(g,f.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};om.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,d=a.show[0]===1;l!==d&&(a.show=Tn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};om.prototype.contains=function(e){return this.updaters.contains(e.id)};om.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};om.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function xV(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}xV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=pd.shouldUseSphericalCoordinates(o.geometry.rectangle),s=J.getValueOrDefault(t.zIndex,0);for(let l=0;l<i;++l){let d=n[l];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new om(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};xV.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}}};xV.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};xV.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 ut.FAILED};xV.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 P2=xV;var kpi=_(T(),1);var eet=new Y,tet=new vt,net=new vt,iet=m.ZERO,oet=new m;function $b(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 Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.itemsToRemove=[],this.subscriptions=new Zt,this.showsUpdated=new Zt}$b.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)}))}};$b.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 c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};$b.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)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new an({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),f=this.attributes.get(u.id.id);if(c(f)||(f=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!d.outlineColorProperty.isConstant||l){let x=d.outlineColorProperty,S=J.getValueOrDefault(x,e,Y.WHITE,eet);Y.equals(f._lastColor,S)||(f._lastColor=Y.clone(S,f._lastColor),f.color=Yt.toValue(S,f.color),(this.translucent&&f.color[3]===255||!this.translucent&&f.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=d.distanceDisplayConditionProperty;if(!J.isConstant(h)){let x=J.getValueOrDefault(h,e,net,tet);vt.equals(x,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(x,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(x,f.distanceDisplayCondition))}let g=d.terrainOffsetProperty;if(!J.isConstant(g)){let x=J.getValueOrDefault(g,e,iet,oet);m.equals(x,f._lastOffset)||(f._lastOffset=m.clone(x,f._lastOffset),f.offset=$i.toValue(x,f.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};$b.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);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=Tn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};$b.prototype.contains=function(e){return this.updaters.contains(e.id)};$b.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};$b.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function _V(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Zt,this._translucentBatches=new Zt}_V.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),c(r)||(r=new $b(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),c(r)||(r=new $b(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};_V.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};_V.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,l=a.length,d,u=!0,f=!1;do{for(f=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(f=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<l;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(f=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(f);return u};_V.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 ut.FAILED};_V.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 TV=_V;var ret=[];function Hl(e,t,n,i){C.defined("scene",e),C.defined("entityCollection",t),n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Zt,this._removedObjects=new Zt,this._changedObjects=new Zt;let o=Sn.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=$o.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new TV(n,e,s,!1),this._outlineBatches[o+s]=new TV(n,e,s,!0),this._closedColorBatches[s]=new nm(n,an,void 0,!0,s,!0),this._closedColorBatches[o+s]=new nm(n,an,void 0,!0,s,!1),this._closedMaterialBatches[s]=new im(n,so,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new im(n,so,void 0,!0,s,!1),this._openColorBatches[s]=new nm(n,an,void 0,!1,s,!0),this._openColorBatches[o+s]=new nm(n,an,void 0,!1,s,!1),this._openMaterialBatches[s]=new im(n,so,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new im(n,so,void 0,!1,s,!1);let a=Un.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new P2(i,s,so)),l[s]=new gV(i,s);else for(s=0;s<a;++s)l[s]=new gV(i,s);this._groundColorBatches=l,this._groundMaterialBatches=d,this._dynamicBatch=new aT(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Zt,this._updaterSets=new Zt,this._entityCollection=t,t.collectionChanged.addEventListener(Hl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,ret)}Hl.registerUpdater=function(e){gT.registerUpdater(e)};Hl.unregisterUpdater=function(e){gT.unregisterUpdater(e)};Hl.prototype.update=function(e){C.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,d,u,f=this;for(a=s.length-1;a>-1;a--)l=s[a],d=l.id,u=this._updaterSets.get(d),u.entity===l?u.forEach(function(g){f._removeUpdater(g),f._insertUpdaterIntoBatch(e,g)}):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],d=l.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)l=n[a],d=l.id,u=new gT(l,this._scene),this._updaterSets.set(d,u),u.forEach(function(g){f._insertUpdaterIntoBatch(e,g)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Hl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,y=this._batches,h=y.length;for(a=0;a<h;a++)p=y[a].update(e)&&p;return p};var set=[],aet=new ue;Hl.prototype.getBoundingSphere=function(e,t){C.defined("entity",e),C.defined("result",t);let n=set,i=aet,o=0,r=ut.DONE,s=this._batches,a=s.length,l=e.id,d=this._updaterSets.get(l).updaters;for(let u=0;u<d.length;u++){let f=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(f,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ue.clone(i,n[o]),o++)}}return o===0?ut.FAILED:(n.length=o,ue.fromBoundingSpheres(n,t),ut.DONE)};Hl.prototype.isDestroyed=function(){return!1};Hl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hl.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(),he(this)};Hl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Hl.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=Sn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(c(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 Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Hl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Hl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var v2=Hl;var Vbi=_(T(),1);var cet=1,det="30px sans-serif",uet=Yo.FILL,met=Y.WHITE,fet=Y.BLACK,het=1,pet=!1,bet=new Y(.165,.165,.165,.8),yet=new D(7,5),get=D.ZERO,xet=m.ZERO,_et=ze.NONE,Tet=xi.CENTER,Cet=Mn.CENTER,Vet=new m,Let=new Y,Zet=new Y,Ret=new Y,Get=new D,Eet=new m,Xet=new D,Iet=new Nt,Wet=new Nt,wet=new Nt,Pet=new vt;function che(e){this.entity=e,this.label=void 0,this.index=void 0}function og(e,t){if(!c(e))throw new L("entityCluster is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(og.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}og.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l,d=r.label,u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),f;if(u&&(f=J.getValueOrUndefined(s._position,e,Vet),l=J.getValueOrUndefined(a._text,e),u=c(f)&&c(l)),!u){UJ(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,y=J.getValueOrDefault(a._heightReference,e,_et);c(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=m.equals(d.position,f)&&d.heightReference===y),d.show=!0,d.position=f,d.text=l,d.scale=J.getValueOrDefault(a._scale,e,cet),d.font=J.getValueOrDefault(a._font,e,det),d.style=J.getValueOrDefault(a._style,e,uet),d.fillColor=J.getValueOrDefault(a._fillColor,e,met,Let),d.outlineColor=J.getValueOrDefault(a._outlineColor,e,fet,Zet),d.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,het),d.showBackground=J.getValueOrDefault(a._showBackground,e,pet),d.backgroundColor=J.getValueOrDefault(a._backgroundColor,e,bet,Ret),d.backgroundPadding=J.getValueOrDefault(a._backgroundPadding,e,yet,Get),d.pixelOffset=J.getValueOrDefault(a._pixelOffset,e,get,Xet),d.eyeOffset=J.getValueOrDefault(a._eyeOffset,e,xet,Eet),d.heightReference=y,d.horizontalOrigin=J.getValueOrDefault(a._horizontalOrigin,e,Tet),d.verticalOrigin=J.getValueOrDefault(a._verticalOrigin,e,Cet),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Iet),d.pixelOffsetScaleByDistance=J.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Wet),d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,wet),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,Pet),d.disableDepthTestDistance=J.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};og.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.label))return ut.FAILED;let i=n.label;return t.center=m.clone(i._clampedPosition??i.position,t.center),t.radius=0,ut.DONE};og.prototype.isDestroyed=function(){return!1};og.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(og.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return he(this)};og.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],c(r._label)&&c(r._position)&&s.set(r.id,new che(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._label)&&c(r._position)?s.contains(r.id)||s.set(r.id,new che(r)):(UJ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],UJ(s.get(r.id),r,a),s.remove(r.id)};function UJ(e,t,n){c(e)&&(e.label=void 0,n.removeLabel(t))}var F2=og;var Hbi=_(T(),1);var vet=1,Fet=!0,Aet=0,Met=!0,Net=!0,ket=Sn.ENABLED,Uet=ze.NONE,Oet=Y.RED,Det=0,Bet=Y.WHITE,Yet=bc.HIGHLIGHT,Het=.5,zet=new D(1,1),lhe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Ket=new M,Jet=new M,dhe=new Y,uhe=new Array(4),Qet=new m;function rg(e,t){C.typeOf.object("scene",e),C.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(rg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Zt,this._onCollectionChanged(t,t.values,[],[])}async function jet(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await af.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!c(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(l=>{c(s[t.id])&&(console.log(l),l.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!c(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}rg.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),f;if(u&&(f=s.computeModelMatrix(e,Ket),l=Ge.createIfNeeded(J.getValueOrUndefined(a._uri,e)),u=c(f)&&c(l)),!u){c(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if(!c(d)||l.url!==d.url){c(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:l.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...lhe}},n[s.id]=d;let h=J.getValueOrDefault(a._incrementallyLoadTextures,e,Met),g=J.getValueOrDefault(a._environmentMapOptions,e,lhe,d.environmentMapOptionsScratch);jet(this,s,l,h,g)}let p=d.modelPrimitive;if(!c(p))continue;p.show=!0,p.scale=J.getValueOrDefault(a._scale,e,vet),p.enableVerticalExaggeration=J.getValueOrDefault(a._enableVerticalExaggeration,e,Fet),p.minimumPixelSize=J.getValueOrDefault(a._minimumPixelSize,e,Aet),p.maximumScale=J.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=M.clone(f,p.modelMatrix),p.shadows=J.getValueOrDefault(a._shadows,e,ket),p.heightReference=J.getValueOrDefault(a._heightReference,e,Uet),p.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=J.getValueOrDefault(a._silhouetteColor,e,Oet,dhe),p.silhouetteSize=J.getValueOrDefault(a._silhouetteSize,e,Det),p.color=J.getValueOrDefault(a._color,e,Bet,dhe),p.colorBlendMode=J.getValueOrDefault(a._colorBlendMode,e,Yet),p.colorBlendAmount=J.getValueOrDefault(a._colorBlendAmount,e,Het),p.clippingPlanes=J.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=J.getValueOrDefault(a._clampAnimations,e,Net),p.imageBasedLighting.imageBasedLightingFactor=J.getValueOrDefault(a._imageBasedLightingFactor,e,zet);let y=J.getValueOrUndefined(a._lightColor,e);if(c(y)&&(Y.pack(y,uhe,0),y=m.unpack(uhe,0,Qet)),p.lightColor=y,p.customShader=J.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let h=J.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==h&&(h?p.activeAnimations.addAll({loop:Al.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=h);let g=J.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(c(g)){let V=Object.keys(g);for(let Z=0,R=V.length;Z<R;++Z){let E=V[Z],I=g[E];if(!c(I))continue;let v=p.getNode(E);if(!c(v))continue;let P=M.fromTranslationRotationScale(I,Jet);v.matrix=M.multiply(v.originalMatrix,P,P)}}let x=!1,S=J.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(c(S)){let V=Object.keys(S);for(let Z=0,R=V.length;Z<R;++Z){let E=V[Z],I=S[E];c(I)&&(x=!0,p.setArticulationStage(E,I))}}x&&p.applyArticulations()}}return!0};rg.prototype.isDestroyed=function(){return!1};rg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(rg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)OJ(this,e[i],t,n);return he(this)};var cU=new m,qet=new pe;rg.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._modelHash[e.id];if(!c(n))return ut.FAILED;if(n.loadFailed)return ut.FAILED;let i=n.modelPrimitive;if(!c(i)||!i.show)return ut.PENDING;if(!i.ready||!n.modelUpdated)return ut.PENDING;let o=this._scene,r=o.ellipsoid??re.default;if(i.heightReference!==ze.NONE){let a=i.modelMatrix;cU.x=a[12],cU.y=a[13],cU.z=a[14];let l=r.cartesianToCartographic(cU,qet),d=o.getHeight(l,i.heightReference);return c(d)&&(Lu(i.heightReference)?l.height=d:l.height+=d),ue.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(l),ut.DONE}return ue.clone(i.boundingSphere,t),ut.DONE};rg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._model)&&c(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._model)&&c(r._position)?($et(r,a),s.set(r.id,r)):(OJ(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],OJ(this,r,a,l),s.remove(r.id)};function OJ(e,t,n,i){let o=n[t.id];c(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function $et(e,t){let n=t[e.id];c(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var A2=rg;var L0i=_(T(),1);var t0i=_(T(),1);function sg(e){this._definitionChanged=new ye,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(sg.prototype,{isConstant:{get:function(){return J.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return c(this._value)?this._value.referenceFrame:Ui.FIXED}}});var ett=new ee;sg.prototype.getValue=function(e,t){return c(e)||(e=ee.now(ett)),this.getValueInReferenceFrame(e,Ui.FIXED,t)};sg.prototype.setValue=function(e){this._value!==e&&(this._value=e,c(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),c(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};sg.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new L("time is required.");if(!c(t))throw new L("referenceFrame is required.");if(c(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),c(n)?re.default.scaleToGeodeticSurface(n,n):void 0};sg.prototype.equals=function(e){return this===e||e instanceof sg&&this._value===e._value};sg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Mh=sg;var ttt=60,ntt=1,fhe=new Zn,DJ=new Zn,BJ=new Zn;function mhe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function itt(e,t,n,i,o,r,s,a,l){let d=a,u;u=e.getValueInReferenceFrame(t,r,l[d]),c(u)&&(l[d++]=u);let f=!c(o)||ee.lessThanOrEquals(o,t)||ee.greaterThanOrEquals(o,n),p=0,y=i.length,h=i[p],g=n,x=!1,S,V,Z;for(;p<y;){if(!f&&ee.greaterThanOrEquals(h,o)&&(u=e.getValueInReferenceFrame(o,r,l[d]),c(u)&&(l[d++]=u),f=!0),ee.greaterThan(h,t)&&ee.lessThan(h,g)&&!h.equals(o)&&(u=e.getValueInReferenceFrame(h,r,l[d]),c(u)&&(l[d++]=u)),p<y-1){if(s>0&&!x){let R=i[p+1],E=ee.secondsDifference(R,h);x=E>s,x&&(S=Math.ceil(E/s),V=0,Z=E/Math.max(S,2),S=Math.max(S-1,1))}if(x&&V<S){h=ee.addSeconds(h,Z,new ee),V++;continue}}x=!1,p++,h=i[p]}return u=e.getValueInReferenceFrame(n,r,l[d]),c(u)&&(l[d++]=u),d}function ott(e,t,n,i,o,r,s,a){let l,d=0,u=s,f=t,p=!c(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(f,n);)!p&&ee.greaterThanOrEquals(f,i)&&(p=!0,l=e.getValueInReferenceFrame(i,o,a[u]),c(l)&&(a[u]=l,u++)),l=e.getValueInReferenceFrame(f,o,a[u]),c(l)&&(a[u]=l,u++),d++,f=ee.addSeconds(t,r*d,new ee);return l=e.getValueInReferenceFrame(n,o,a[u]),c(l)&&(a[u]=l,u++),u}function rtt(e,t,n,i,o,r,s,a){let l,d=0,u=s,f=t,p=Math.max(r,60),y=!c(i)||ee.lessThanOrEquals(i,t)||ee.greaterThanOrEquals(i,n);for(;ee.lessThan(f,n);)!y&&ee.greaterThanOrEquals(f,i)&&(y=!0,l=e.getValueInReferenceFrame(i,o,a[u]),c(l)&&(a[u]=l,u++)),l=e.getValueInReferenceFrame(f,o,a[u]),c(l)&&(a[u]=l,u++),d++,f=ee.addSeconds(t,p*d,new ee);return l=e.getValueInReferenceFrame(n,o,a[u]),c(l)&&(a[u]=l,u++),u}function stt(e,t,n,i,o,r,s,a){BJ.start=t,BJ.stop=n;let l=s,d=e.intervals;for(let u=0;u<d.length;u++){let f=d.get(u);if(!Zn.intersect(f,BJ,fhe).isEmpty){let p=f.start;f.isStartIncluded||(f.isStopIncluded?p=f.stop:p=ee.addSeconds(f.start,ee.secondsDifference(f.stop,f.start)/2,new ee));let y=e.getValueInReferenceFrame(p,o,a[l]);c(y)&&(a[l]=y,l++)}}return l}function att(e,t,n,i,o,r,s,a){let l=e.getValueInReferenceFrame(t,o,a[s]);return c(l)&&(a[s++]=l),s}function ctt(e,t,n,i,o,r,s,a){DJ.start=t,DJ.stop=n;let l=s,d=e.intervals;for(let u=0;u<d.length;u++){let f=d.get(u);if(!Zn.intersect(f,DJ,fhe).isEmpty){let p=f.start,y=f.stop,h=t;ee.greaterThan(p,h)&&(h=p);let g=n;ee.lessThan(y,g)&&(g=y),l=hhe(f.data,h,g,i,o,r,l,a)}}return l}function hhe(e,t,n,i,o,r,s,a){for(;e instanceof Yb;)e=e.resolvedProperty;if(e instanceof xa){let l=e._property._times;s=itt(e,t,n,l,i,o,r,s,a)}else e instanceof XX?s=ott(e,t,n,i,o,r,s,a):e instanceof ya?s=ctt(e,t,n,i,o,r,s,a):e instanceof Hb?s=stt(e,t,n,i,o,r,s,a):e instanceof Oc||e instanceof Mh&&J.isConstant(e)?s=att(e,t,n,i,o,r,s,a):s=rtt(e,t,n,i,o,r,s,a);return s}function phe(e,t,n,i,o,r,s){c(s)||(s=[]);let a=hhe(e,t,n,i,o,r,0,s);return s.length=a,s}var ltt=new te;function M2(e,t){this._unusedIndexes=[],this._polylineCollection=new df,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}M2.prototype.update=function(e){if(this._referenceFrame===Ui.INERTIAL){let t=wt.computeIcrfToCentralBodyFixedMatrix(e,ltt);M.fromRotationTranslation(t,m.ZERO,this._polylineCollection.modelMatrix)}};M2.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,l=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!c(a)||a.getValue(e));if(d){let f=J.getValueOrUndefined(i._leadTime,e),p=J.getValueOrUndefined(i._trailTime,e),y=n._availability,h=c(y),g=c(f),x=c(p);if(d=h||g&&x,d){if(x&&(r=ee.addSeconds(e,-p,new ee)),g&&(s=ee.addSeconds(e,f,new ee)),h){let S=y.start,V=y.stop;(!x||ee.greaterThan(S,r))&&(r=S),(!g||ee.lessThan(V,s))&&(s=V)}d=ee.lessThan(r,s)}}if(!d){c(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0);return}if(!c(l)){let f=this._unusedIndexes;if(f.length>0){let y=f.pop();l=this._polylineCollection.get(y),t.index=y}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}let u=J.getValueOrDefault(i._resolution,e,ttt);l.show=!0,l.positions=phe(o,r,s,e,this._referenceFrame,u,l.positions.slice()),l.material=qo.getValue(e,i._material,l.material),l.width=J.getValueOrDefault(i._width,e,ntt),l.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,l.distanceDisplayCondition)};M2.prototype.removeObject=function(e){let t=e.polyline;c(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};M2.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),he(this)};function ag(e,t){if(!c(e))throw new L("scene is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(ag.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}ag.prototype.update=function(e){if(!c(e))throw new L("time is required.");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&&c(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,l=r.updater,d=Ui.FIXED;this._scene.mode===se.SCENE3D&&(d=a.referenceFrame);let u=this._updaters[d];if(l===u&&c(u)){u.updateObject(e,r);continue}c(l)&&l.removeObject(r),c(u)||(u=new M2(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,c(u)&&u.updateObject(e,r)}return!0};ag.prototype.isDestroyed=function(){return!1};ag.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ag.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return he(this)};ag.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],c(r._path)&&c(r._position)&&a.set(r.id,new mhe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._path)&&c(r._position)?a.contains(r.id)||a.set(r.id,new mhe(r)):(s=a.get(r.id),c(s)&&(c(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),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};ag._subSample=phe;var N2=ag;var k0i=_(T(),1);var bhe=Y.WHITE,yhe=Y.BLACK,ghe=0,xhe=1,_he=0,The=Ar.NONE,She=new Y,dtt=new m,Che=new Y,Vhe=new Nt,Lhe=new Nt,Zhe=new vt;function Rhe(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 cg(e,t){if(!c(e))throw new L("entityCluster is required.");if(!c(t))throw new L("entityCollection is required.");t.collectionChanged.addEventListener(cg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}cg.prototype.update=function(e){if(!c(e))throw new L("time is required.");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,l=r.pointPrimitive,d=r.billboard,u=J.getValueOrDefault(a._heightReference,e,ze.NONE),f=s.isShowing&&s.isAvailable(e)&&J.getValueOrDefault(a._show,e,!0),p;if(f&&(p=J.getValueOrUndefined(s._position,e,dtt),f=c(p)),!f){k2(r,s,n);continue}J.isConstant(s._position)||(n._clusterDirty=!0);let y=!1,h=!1;if(u!==ze.NONE&&!c(d)?(c(l)&&(k2(r,s,n),l=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,y=!0,h=m.equals(d.position,p)&&d.heightReference===u):u===ze.NONE&&!c(l)&&(c(d)&&(k2(r,s,n),d=void 0),l=n.getPoint(s),l.id=s,r.pointPrimitive=l),c(l))l.show=!0,l.position=p,l.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,Vhe),l.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Lhe),l.color=J.getValueOrDefault(a._color,e,bhe,She),l.outlineColor=J.getValueOrDefault(a._outlineColor,e,yhe,Che),l.outlineWidth=J.getValueOrDefault(a._outlineWidth,e,ghe),l.pixelSize=J.getValueOrDefault(a._pixelSize,e,xhe),l.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,Zhe),l.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,_he),l.splitDirection=J.getValueOrDefault(a._splitDirection,e,The);else if(c(d)){d.show=!0,d.position=p,d.scaleByDistance=J.getValueOrUndefined(a._scaleByDistance,e,Vhe),d.translucencyByDistance=J.getValueOrUndefined(a._translucencyByDistance,e,Lhe),d.distanceDisplayCondition=J.getValueOrUndefined(a._distanceDisplayCondition,e,Zhe),d.disableDepthTestDistance=J.getValueOrDefault(a._disableDepthTestDistance,e,_he),d.splitDirection=J.getValueOrDefault(a._splitDirection,e,The),d.heightReference=u;let g=J.getValueOrDefault(a._color,e,bhe,She),x=J.getValueOrDefault(a._outlineColor,e,yhe,Che),S=Math.round(J.getValueOrDefault(a._outlineWidth,e,ghe)),V=Math.max(1,Math.round(J.getValueOrDefault(a._pixelSize,e,xhe)));if(S>0?(d.scale=1,y=y||S!==r.outlineWidth||V!==r.pixelSize||!Y.equals(g,r.color)||!Y.equals(x,r.outlineColor)):(d.scale=V/50,V=50,y=y||S!==r.outlineWidth||!Y.equals(g,r.color)||!Y.equals(x,r.outlineColor)),y){r.color=Y.clone(g,r.color),r.outlineColor=Y.clone(x,r.outlineColor),r.pixelSize=V,r.outlineWidth=S;let Z=g.alpha,R=g.toCssColorString(),E=x.toCssColorString(),I=JSON.stringify([R,V,E,S]);d.setImage(I,w_(Z,R,E,S,V))}h&&d._updateClamping()}}return!0};cg.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new L("entity is required.");if(!c(t))throw new L("result is required.");let n=this._items.get(e.id);if(!c(n)||!(c(n.pointPrimitive)||c(n.billboard)))return ut.FAILED;if(c(n.pointPrimitive))t.center=m.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!c(i._clampedPosition))return ut.PENDING;t.center=m.clone(i._clampedPosition,t.center)}return t.radius=0,ut.DONE};cg.prototype.isDestroyed=function(){return!1};cg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(cg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return he(this)};cg.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],c(r._point)&&c(r._position)&&s.set(r.id,new Rhe(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._point)&&c(r._position)?s.contains(r.id)||s.set(r.id,new Rhe(r)):(k2(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],k2(s.get(r.id),r,a),s.remove(r.id)};function k2(e,t,n){if(c(e)){let i=e.pointPrimitive;if(c(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;c(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var U2=cg;var xgi=_(T(),1);var Nyi=_(T(),1);var ayi=_(T(),1);var Whe=[];function utt(e,t,n,i,o){let r=Whe;r.length=o;let s,a=n.red,l=n.green,d=n.blue,u=n.alpha,f=i.red,p=i.green,y=i.blue,h=i.alpha;if(Y.equals(n,i)){for(s=0;s<o;s++)r[s]=Y.clone(n);return r}let g=(f-a)/o,x=(p-l)/o,S=(y-d)/o,V=(h-u)/o;for(s=0;s<o;s++)r[s]=new Y(a+s*g,l+s*x,d+s*S,u+s*V);return r}function O2(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new L("At least two positions are required.");if(typeof i!="number")throw new L("width must be a number");if(c(n)&&(o&&n.length<t.length||!o&&n.length<t.length-1))throw new L("colors has an invalid length.");this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=We.clone(e.vertexFormat??We.DEFAULT),this._arcType=e.arcType??Kt.GEODESIC,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._ellipsoid=re.clone(e.ellipsoid??re.default),this._workerName="createPolylineGeometry";let r=1+t.length*m.packedLength;r+=c(n)?1+n.length*Y.packedLength:1,this.packedLength=r+re.packedLength+We.packedLength+4}O2.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=Y.packedLength)Y.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var whe=re.clone(re.UNIT_SPHERE),Phe=new We,TT={positions:void 0,colors:void 0,ellipsoid:whe,vertexFormat:Phe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};O2.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=Y.packedLength)s[i]=Y.unpack(e,t);let a=re.unpack(e,t,whe);t+=re.packedLength;let l=We.unpack(e,t,Phe);t+=We.packedLength;let d=e[t++],u=e[t++]===1,f=e[t++],p=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=re.clone(a,n._ellipsoid),n._vertexFormat=We.clone(l,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=f,n._granularity=p,n):(TT.positions=r,TT.colors=s,TT.width=d,TT.colorsPerVertex=u,TT.arcType=f,TT.granularity=p,new O2(TT))};var Ghe=new m,Ehe=new m,Xhe=new m,Ihe=new m;O2.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,l,d,u,f=[],p=xo(e._positions,m.equalsEpsilon,!1,f);if(c(i)&&f.length>0){let A=0,k=f[0];i=i.filter(function(B,O){let H=!1;return o?H=O===k||O===0&&k===1:H=O+1===k,H?(A++,k=f[A],!1):!0})}let y=p.length;if(y<2||t<=0)return;if(r===Kt.GEODESIC||r===Kt.RHUMB){let A,k;r===Kt.GEODESIC?(A=w.chordLength(s,a.maximumRadius),k=vi.numberOfPoints):(A=s,k=vi.numberOfPointsRhumbLine);let B=vi.extractHeights(p,a);if(c(i)){let O=1;for(l=0;l<y-1;++l)O+=k(p[l],p[l+1],A);let H=new Array(O),U=0;for(l=0;l<y-1;++l){let K=p[l],Q=p[l+1],ie=i[l],j=k(K,Q,A);if(o&&l<O){let $=i[l+1],ne=utt(K,Q,ie,$,j),be=ne.length;for(d=0;d<be;++d)H[U++]=ne[d]}else for(d=0;d<j;++d)H[U++]=Y.clone(ie)}H[U]=Y.clone(i[i.length-1]),i=H,Whe.length=0}r===Kt.GEODESIC?p=vi.generateCartesianArc({positions:p,minDistance:A,ellipsoid:a,height:B}):p=vi.generateCartesianRhumbArc({positions:p,granularity:A,ellipsoid:a,height:B})}y=p.length;let h=y*4-4,g=new Float64Array(h*3),x=new Float64Array(h*3),S=new Float64Array(h*3),V=new Float32Array(h*2),Z=n.st?new Float32Array(h*2):void 0,R=c(i)?new Uint8Array(h*4):void 0,E=0,I=0,v=0,P=0,F;for(d=0;d<y;++d){d===0?(F=Ghe,m.subtract(p[0],p[1],F),m.add(p[0],F,F)):F=p[d-1],m.clone(F,Xhe),m.clone(p[d],Ehe),d===y-1?(F=Ghe,m.subtract(p[y-1],p[y-2],F),m.add(p[y-1],F,F)):F=p[d+1],m.clone(F,Ihe);let A,k;c(R)&&(d!==0&&!o?A=i[d-1]:A=i[d],d!==y-1&&(k=i[d]));let B=d===0?2:0,O=d===y-1?2:4;for(u=B;u<O;++u){m.pack(Ehe,g,E),m.pack(Xhe,x,E),m.pack(Ihe,S,E),E+=3;let H=u-2<0?-1:1;if(V[I++]=2*(u%2)-1,V[I++]=H*t,n.st&&(Z[v++]=d/(y-1),Z[v++]=Math.max(V[I-2],0)),c(R)){let U=u<2?A:k;R[P++]=Y.floatToByte(U.red),R[P++]=Y.floatToByte(U.green),R[P++]=Y.floatToByte(U.blue),R[P++]=Y.floatToByte(U.alpha)}}}let N=new fn;N.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:g}),N.prevPosition=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:x}),N.nextPosition=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:S}),N.expandAndWidth=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:V}),n.st&&(N.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:Z})),c(R)&&(N.color=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));let b=Me.createTypedArray(h,y*6-6),G=0,X=0,W=y-1;for(d=0;d<W;++d)b[X++]=G,b[X++]=G+2,b[X++]=G+1,b[X++]=G+1,b[X++]=G+2,b[X++]=G+3,G+=4;return new dt({attributes:N,indices:b,primitiveType:ve.TRIANGLES,boundingSphere:ue.fromPoints(p),geometryType:yu.POLYLINES})};var e0=O2;var mtt=new Qn(0),lU={},vhe=new Y,ftt=new Ut(Y.WHITE),htt=new Qn(!0),ptt=new Qn(Sn.DISABLED),btt=new Qn(new vt),ytt=new Qn(Un.BOTH);function gtt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function xtt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Gf(e,t){if(!c(e))throw new L("entity is required");if(!c(t))throw new L("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Gf.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new ye,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 gtt,this._groundGeometryOptions=new xtt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=$o.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Gf.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||!c(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}}});Gf.prototype.isOutlineVisible=function(e){return!1};Gf.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Gf.prototype.createFillGeometryInstance=function(e){if(!c(e))throw new L("time is required.");if(!this._fillEnabled)throw new L("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new Tn(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 Ut&&(c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,vhe)),c(a)||(a=Y.WHITE),s.color=Yt.fromColor(a)),this.clampToGround?new Rt({id:t,geometry:new vx(this._groundGeometryOptions),attributes:s}):(c(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(c(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,vhe)),c(a)||(a=Y.WHITE),s.depthFailColor=Yt.fromColor(a)),new Rt({id:t,geometry:new e0(this._geometryOptions),attributes:s}))};Gf.prototype.createOutlineGeometryInstance=function(e){throw new L("This instance does not represent an outlined geometry.")};Gf.prototype.isDestroyed=function(){return!1};Gf.prototype.destroy=function(){this._entitySubscription(),he(this)};Gf.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!c(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(c(s)&&s.isConstant&&!s.getValue(Ye.MINIMUM_VALUE)||!c(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,l=o.material??ftt,d=l instanceof Ut;this._materialProperty=l,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??htt,this._shadowsProperty=o.shadows??ptt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??btt,this._classificationTypeProperty=o.classificationType??ytt,this._fillEnabled=!0,this._zIndex=a??mtt;let u=o.width,f=o.arcType,p=o.clampToGround,y=o.granularity;if(!r.isConstant||!J.isConstant(u)||!J.isConstant(f)||!J.isConstant(y)||!J.isConstant(p)||!J.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let h=this._geometryOptions,g=r.getValue(Ye.MINIMUM_VALUE,h.positions);if(!c(g)||g.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x;d&&(!c(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?x=es.VERTEX_FORMAT:x=ua.VERTEX_FORMAT,h.vertexFormat=x,h.positions=g,h.width=c(u)?u.getValue(Ye.MINIMUM_VALUE):void 0,h.arcType=c(f)?f.getValue(Ye.MINIMUM_VALUE):void 0,h.granularity=c(y)?y.getValue(Ye.MINIMUM_VALUE):void 0;let S=this._groundGeometryOptions;S.positions=g,S.width=h.width,S.arcType=h.arcType,S.granularity=h.granularity,this._clampToGround=c(p)?p.getValue(Ye.MINIMUM_VALUE):!1,!this._clampToGround&&c(a)&&ht("Entity polylines must have clampToGround: true when using zIndex.  zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Gf.prototype.createDynamicUpdater=function(e,t){if(C.defined("primitives",e),C.defined("groundPrimitives",t),!this._dynamic)throw new L("This instance does not represent dynamic geometry.");return new D2(e,t,this)};var SV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function D2(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 Fhe(e){if(c(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=lU[n];!c(i)||i.isDestroyed()?(i=new df,lU[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}D2.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,Kt.GEODESIC),t._groundGeometryOptions.granularity=J.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(c(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)||!c(r)||r.length<2)return;let f=t.fillMaterialProperty,p;if(f instanceof Ut)p=new es;else{let y=qo.getValue(e,f,this._material);p=new ua({material:y,translucent:y.isTranslucent()}),this._material=y}this._groundPolylinePrimitive=s.add(new Am({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),J.getValueOrUndefined(t.zIndex,e)),c(this._line)&&(this._line.show=!1);return}let a=Fhe(this);if(!n.isShowing||!n.isAvailable(e)||!J.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!c(r)||r.length<2){a.show=!1;return}let l=Kt.GEODESIC;l=J.getValueOrDefault(i._arcType,e,l);let d=t._scene.globe,u=t._scene.ellipsoid;l!==Kt.NONE&&c(d)&&(SV.ellipsoid=u,SV.positions=r,SV.granularity=J.getValueOrUndefined(i._granularity,e),SV.height=vi.extractHeights(r,u),l===Kt.GEODESIC?r=vi.generateCartesianArc(SV):r=vi.generateCartesianRhumbArc(SV)),a.show=!0,a.positions=r.slice(),a.material=qo.getValue(e,t.fillMaterialProperty,a.material),a.width=J.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=J.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};D2.prototype.getBoundingSphere=function(e){if(C.defined("result",e),this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(c(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(c(n)&&c(n.boundingSphere))return ue.clone(n.boundingSphere,e),ut.DONE}return c(t)&&!t.ready?ut.PENDING:ut.DONE}else{let t=Fhe(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),ut.DONE}return ut.FAILED};D2.prototype.isDestroyed=function(){return!1};D2.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=lU[t];c(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete lU[t])),c(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),he(this)};var B2=Gf;var tgi=_(T(),1);var _tt=new Y,Ttt=new vt,Stt=new vt;function Ef(e,t,n,i,o){let r;n instanceof Ut?r=es:r=ua,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Ef.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt,this.zIndex=i,this._asynchronous=o}Ef.prototype.onMaterialChanged=function(){this.invalidated=!0};Ef.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Ef.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,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ef.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 c(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Ef.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)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Am({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===ua&&(this.material=qo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===ua&&(this.material=qo.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 l=s[r],d=l.entity,u=this.geometry.get(l.id),f=this.attributes.get(u.id.id);if(c(f)||(f=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,f)),!l.fillMaterialProperty.isConstant){let g=l.fillMaterialProperty.color,x=J.getValueOrDefault(g,e,Y.WHITE,_tt);Y.equals(f._lastColor,x)||(f._lastColor=Y.clone(x,f._lastColor),f.color=Yt.toValue(x,f.color))}let p=d.isShowing&&(l.hasConstantFill||l.isFilled(e)),y=f.show[0]===1;p!==y&&(f.show=Tn.toValue(p,f.show));let h=l.distanceDisplayConditionProperty;if(!J.isConstant(h)){let g=J.getValueOrDefault(h,e,Stt,Ttt);vt.equals(g,f._lastDistanceDisplayCondition)||(f._lastDistanceDisplayCondition=vt.clone(g,f._lastDistanceDisplayCondition),f.distanceDisplayCondition=kn.toValue(g,f.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Ef.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);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,d=a.show[0]===1;l!==d&&(a.show=Tn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ef.prototype.contains=function(e){return this.updaters.contains(e.id)};Ef.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ut.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?ut.FAILED:(i.boundingSphere.clone(t),ut.DONE)};Ef.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function CV(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}CV.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 l=n[a];if(l.isMaterial(t)&&l.zIndex===r){l.add(e,t,o);return}}let s=new Ef(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};CV.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}}};CV.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 l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};CV.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 ut.FAILED};CV.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 Y2=CV;var Ctt=[];function Ahe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function Mhe(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;c(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;c(i)&&(r=i+o*Sn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Nh(e,t,n,i){C.defined("scene",e),C.defined("entityCollection",t),i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Zt,this._removedObjects=new Zt,this._changedObjects=new Zt;let o,r=Sn.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 nm(n,es,void 0,!1,o),this._materialBatches[o]=new im(n,ua,void 0,!1,o),this._colorBatches[o+r]=new nm(n,es,es,!1,o),this._materialBatches[o+r]=new im(n,ua,es,!1,o),this._colorBatches[o+r*2]=new nm(n,es,ua,!1,o),this._materialBatches[o+r*2]=new im(n,ua,ua,!1,o);this._dynamicBatch=new aT(n,i);let s=Un.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new Y2(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Zt,this._updaters=new Zt,this._entityCollection=t,t.collectionChanged.addEventListener(Nh.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Ctt)}Nh.prototype.update=function(e){C.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,d,u;for(a=s.length-1;a>-1;a--)l=s[a],d=l.id,u=this._updaters.get(d),u.entity===l?(Ahe(this,u),Mhe(this,e,u)):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],d=l.id,u=this._updaters.get(d),Ahe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)l=n[a],d=l.id,u=new B2(l,this._scene),this._updaters.set(d,u),Mhe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(Nh._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let f=!0,p=this._batches,y=p.length;for(a=0;a<y;a++)f=p[a].update(e)&&f;return f};var Vtt=[],Ltt=new ue;Nh.prototype.getBoundingSphere=function(e,t){C.defined("entity",e),C.defined("result",t);let n=Vtt,i=Ltt,o=0,r=ut.DONE,s=this._batches,a=s.length,l=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(l,i),r===ut.PENDING)return ut.PENDING;r===ut.DONE&&(n[o]=ue.clone(i,n[o]),o++)}return o===0?ut.FAILED:(n.length=o,ue.fromBoundingSpheres(n,t),ut.DONE)};Nh.prototype.isDestroyed=function(){return!1};Nh.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Nh.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(),he(this)};Nh._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Nh.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var H2=Nh;function zl(e){C.typeOf.object("options",e),C.typeOf.object("options.scene",e.scene),C.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),kc.initializeTerrainHeights(),Am.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new hr,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??zl.defaultVisualizersCallback;let i=!1,o=new al,r=new al;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new JP;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,l;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),l(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),l=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=l,this._ready=!1}var VV=[];zl.registerVisualizer=function(e){VV.includes(e)||VV.push(e)};zl.unregisterVisualizer=function(e){if(VV.includes(e)){let t=VV.indexOf(e);VV.splice(t,1)}};zl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new yE(t,i),new v2(e,i,n._primitives,n._groundPrimitives),new F2(t,i),new A2(e,i),new PP(e,i),new U2(t,i),new N2(e,i),new H2(e,i,n._primitives,n._groundPrimitives),...VV.map(o=>new o(e,i))]};Object.defineProperties(zl.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}}});zl.prototype.isDestroyed=function(){return!1};zl.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),c(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),he(this)};zl.prototype.update=function(e){if(C.defined("time",e),!ui.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 l=s.get(n);for(c(l.update)&&(t=l.update(e)&&t),o=l._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};zl.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;c(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)e.creditDisplay.addCreditToNextFrame(s[l])}}};var Ztt=[],Rtt=new ue;zl.prototype.getBoundingSphere=function(e,t,n){if(C.defined("entity",e),C.typeOf.bool("allowPartial",t),C.defined("result",n),!this._ready)return ut.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let y=p.get(i);if(y.entities.contains(e)){r=y;break}}}if(!c(r))return ut.FAILED;let s=Ztt,a=Rtt,l=0,d=ut.DONE,u=r._visualizers,f=u.length;for(i=0;i<f;i++){let p=u[i];if(c(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===ut.PENDING)return ut.PENDING;d===ut.DONE&&(s[l]=ue.clone(a,s[l]),l++)}}return l===0?ut.FAILED:(s.length=l,ue.fromBoundingSpheres(s,n),ut.DONE)};zl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new al),s=o.add(new d2);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};zl.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,l=a.length;for(let d=0;d<l;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};zl.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 z2=zl;var sxi=_(T(),1);var Bgi=_(T(),1);function YJ(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}YJ.clone=function(e,t){if(c(e))return c(t)||(t=new YJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var rm=YJ;var Nhe=new te,khe=new te,Uhe=new te,Gtt=new M,dU=new m,Ohe=new m,HJ=new m,zJ=new m,Dhe=new m,Bhe=new m,Ett=new Fe,Xtt=new m,Itt=new te,LV=new ee,Wtt=1.25;function wtt(e,t,n,i,o,r,s,a,l,d){let u=e.scene.mode,f=o.getValue(l,e._lastCartesian);if(c(f)){let p=!1,y=!1,h,g,x;if(u===se.SCENE3D){ee.addSeconds(l,.001,LV);let v=o.getValue(LV,dU);if(c(v)||(ee.addSeconds(l,-.001,LV),v=o.getValue(LV,dU),y=!0),c(v)){let P=wt.computeFixedToIcrfMatrix(l,Nhe),F=wt.computeFixedToIcrfMatrix(LV,khe),N;!c(P)||!c(F)?(N=wt.computeTemeToPseudoFixedMatrix(l,Uhe),P=te.transpose(N,Nhe),F=wt.computeTemeToPseudoFixedMatrix(LV,khe),te.transpose(F,F)):N=te.transpose(P,Uhe);let b=te.multiplyByVector(P,f,Dhe),G=te.multiplyByVector(F,v,Bhe);m.subtract(b,G,zJ);let X=m.magnitude(zJ)*1e3,W=w.GRAVITATIONALPARAMETER,A=-W/(X*X-2*W/m.magnitude(b));A<0||A>Wtt*d.maximumRadius?(h=Ohe,m.normalize(f,h),m.negate(h,h),x=m.clone(m.UNIT_Z,HJ),g=m.cross(x,h,dU),m.magnitude(g)>w.EPSILON7&&(m.normalize(h,h),m.normalize(g,g),x=m.cross(h,g,HJ),m.normalize(x,x),p=!0)):m.equalsEpsilon(f,v,w.EPSILON7)||(x=Ohe,m.normalize(b,x),m.normalize(G,G),g=m.cross(x,G,HJ),y&&(g=m.multiplyByScalar(g,-1,g)),m.equalsEpsilon(g,m.ZERO,w.EPSILON7)||(h=m.cross(g,x,dU),te.multiplyByVector(N,h,h),te.multiplyByVector(N,g,g),te.multiplyByVector(N,x,x),m.normalize(h,h),m.normalize(g,g),m.normalize(x,x),p=!0))}}c(e.boundingSphere)&&(f=e.boundingSphere.center);let S,V,Z;i&&(S=m.clone(t.position,zJ),V=m.clone(t.direction,Dhe),Z=m.clone(t.up,Bhe));let R=Gtt,E;c(s)&&(E=s.getValue(l,Ett));let I=r.getValue(l,Xtt);if(a===vp.INERTIAL&&c(E))M.fromTranslationQuaternionRotationScale(f,E,m.ONE,R);else if(a===vp.VELOCITY&&c(I)){let v=wt.rotationMatrixFromPositionVelocity(f,I,d,Itt);M.fromRotationTranslation(v,f,R)}else a===vp.ENU||!p?wt.eastNorthUpToFixedFrame(f,d,R):(R[0]=h.x,R[1]=h.y,R[2]=h.z,R[3]=0,R[4]=g.x,R[5]=g.y,R[6]=g.z,R[7]=0,R[8]=x.x,R[9]=x.y,R[10]=x.z,R[11]=0,R[12]=f.x,R[13]=f.y,R[14]=f.z,R[15]=0);t._setTransform(R),i&&(m.clone(S,t.position),m.clone(V,t.direction),m.clone(Z,t.up),m.cross(V,Z,t.right))}if(n){let p=u===se.SCENE2D||m.equals(e._offset3D,m.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function K2(e,t,n){C.defined("entity",e),C.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=n??re.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new m,this._defaultOffset3D=void 0,this._velocityProperty=new Kb(e.position,!0),this._offset3D=new m}Object.defineProperties(K2,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=m.clone(e,new m)}}});K2.defaultOffset3D=new m(-14e3,3500,3500);var uU=new rm,Ptt=new m;K2.prototype.update=function(e,t){C.defined("time",e);let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===se.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!c(a))return;let l=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,f=o!==this._mode,p=n.camera,y=u||f,h=!0;if(u){let g=r.viewFrom,x=c(g);if(!x&&c(t)){uU.pitch=-w.PI_OVER_FOUR,uU.range=0;let S=a.getValue(e,Ptt);if(c(S)){let V=2-1/Math.max(1,m.magnitude(S)/i.maximumRadius);uU.pitch*=V}p.viewBoundingSphere(t,uU),this.boundingSphere=t,y=!1,h=!1}else(!x||!c(g.getValue(e,this._offset3D)))&&m.clone(K2._defaultOffset3D,this._offset3D)}else!f&&this._mode!==se.SCENE2D&&m.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,wtt(this,p,y,h,a,l,d,s,e,i)};var J2=K2;var ETi=_(T(),1);var J_i=_(T(),1);var cxi=_(T(),1);function gU(e){return xU(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function xU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?xU(n):n),[])}var Yhe=[0,1,2,3].concat(...gU([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function br(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,f,p,y,h,g,x=0;for(y=0;y<=15;y++)o.bl_count[y]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)f=o.heap[u],y=r[r[f*2+1]*2+1]+1,y>d&&(y=d,x++),r[f*2+1]=y,!(f>e.max_code)&&(o.bl_count[y]++,h=0,f>=l&&(h=a[f-l]),g=r[f*2],o.opt_len+=g*(y+h),s&&(o.static_len+=g*(s[f*2+1]+h)));if(x!==0){do{for(y=d-1;o.bl_count[y]===0;)y--;o.bl_count[y]--,o.bl_count[y+1]+=2,o.bl_count[d]--,x-=2}while(x>0);for(y=d;y!==0;y--)for(f=o.bl_count[y];f!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=y&&(o.opt_len+=(y-r[p*2+1])*r[p*2],r[p*2+1]=y),f--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],l=0,d,u,f;for(d=1;d<=15;d++)a[d]=l=l+s[d-1]<<1;for(u=0;u<=r;u++)f=o[u*2+1],f!==0&&(o[u*2]=n(a[f]++,f))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,l,d,u=-1,f;for(o.heap_len=0,o.heap_max=573,l=0;l<a;l++)r[l*2]!==0?(o.heap[++o.heap_len]=u=l,o.depth[l]=0):r[l*2+1]=0;for(;o.heap_len<2;)f=o.heap[++o.heap_len]=u<2?++u:0,r[f*2]=1,o.depth[f]=0,o.opt_len--,s&&(o.static_len-=s[f*2+1]);for(e.max_code=u,l=Math.floor(o.heap_len/2);l>=1;l--)o.pqdownheap(r,l);f=a;do l=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=l,o.heap[--o.heap_max]=d,r[f*2]=r[l*2]+r[d*2],o.depth[f]=Math.max(o.depth[l],o.depth[d])+1,r[l*2+1]=r[d*2+1]=f,o.heap[1]=f++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}br._length_code=[0,1,2,3,4,5,6,7].concat(...gU([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));br.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];br.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];br.d_code=function(e){return e<256?Yhe[e]:Yhe[256+(e>>>7)]};br.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];br.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];br.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];br.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function ka(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var vtt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Ftt=gU([[144,8],[112,9],[24,7],[8,8]]);ka.static_ltree=xU(vtt.map((e,t)=>[e,Ftt[t]]));var Att=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Mtt=gU([[30,5]]);ka.static_dtree=xU(Att.map((e,t)=>[e,Mtt[t]]));ka.static_l_desc=new ka(ka.static_ltree,br.extra_lbits,257,286,15);ka.static_d_desc=new ka(ka.static_dtree,br.extra_dbits,0,30,15);ka.static_bl_desc=new ka(null,br.extra_blbits,0,19,7);var Ntt=9,ktt=8;function kh(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var zhe=0,bU=1,ST=2,Xf=[new kh(0,0,0,0,zhe),new kh(4,4,8,4,bU),new kh(4,5,16,8,bU),new kh(4,6,32,32,bU),new kh(4,4,16,16,ST),new kh(8,16,32,32,ST),new kh(8,16,128,128,ST),new kh(8,32,128,256,ST),new kh(32,128,258,1024,ST),new kh(32,258,258,4096,ST)],mU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],sm=0,fU=1,Q2=2,hU=3,Utt=32,KJ=42,pU=113,j2=666,JJ=8,Ott=0,QJ=1,Dtt=2,Xr=3,yU=258,Ud=yU+Xr+1;function Hhe(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Btt(){let e=this,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g,x,S,V,Z,R,E,I,v,P,F,N,b,G,X,W,A,k,B,O=new br,H=new br,U=new br;e.depth=[];let K,Q,ie,j,$,ne;e.bl_count=[],e.heap=[],A=[],k=[],B=[];function be(){d=2*r,f[y-1]=0;for(let Ae=0;Ae<y-1;Ae++)f[Ae]=0;N=Xf[b].max_lazy,X=Xf[b].good_length,W=Xf[b].nice_length,F=Xf[b].max_chain,E=0,S=0,v=0,V=P=Xr-1,R=0,p=0}function Ce(){let Ae;for(Ae=0;Ae<286;Ae++)A[Ae*2]=0;for(Ae=0;Ae<30;Ae++)k[Ae*2]=0;for(Ae=0;Ae<19;Ae++)B[Ae*2]=0;A[256*2]=1,e.opt_len=e.static_len=0,Q=ie=0}function me(){O.dyn_tree=A,O.stat_desc=ka.static_l_desc,H.dyn_tree=k,H.stat_desc=ka.static_d_desc,U.dyn_tree=B,U.stat_desc=ka.static_bl_desc,$=0,ne=0,j=8,Ce()}e.pqdownheap=function(Ae,st){let Qe=e.heap,$e=Qe[st],yt=st<<1;for(;yt<=e.heap_len&&(yt<e.heap_len&&Hhe(Ae,Qe[yt+1],Qe[yt],e.depth)&&yt++,!Hhe(Ae,$e,Qe[yt],e.depth));)Qe[st]=Qe[yt],st=yt,yt<<=1;Qe[st]=$e};function _e(Ae,st){let Qe=-1,$e,yt=Ae[0*2+1],Bt=0,Ln=7,Io=4;yt===0&&(Ln=138,Io=3),Ae[(st+1)*2+1]=65535;for(let To=0;To<=st;To++)$e=yt,yt=Ae[(To+1)*2+1],!(++Bt<Ln&&$e==yt)&&(Bt<Io?B[$e*2]+=Bt:$e!==0?($e!=Qe&&B[$e*2]++,B[16*2]++):Bt<=10?B[17*2]++:B[18*2]++,Bt=0,Qe=$e,yt===0?(Ln=138,Io=3):$e==yt?(Ln=6,Io=3):(Ln=7,Io=4))}function Ve(){let Ae;for(_e(A,O.max_code),_e(k,H.max_code),U.build_tree(e),Ae=18;Ae>=3&&B[br.bl_order[Ae]*2+1]===0;Ae--);return e.opt_len+=3*(Ae+1)+5+5+4,Ae}function Ie(Ae){e.pending_buf[e.pending++]=Ae}function Ze(Ae){Ie(Ae&255),Ie(Ae>>>8&255)}function De(Ae){Ie(Ae>>8&255),Ie(Ae&255&255)}function Ke(Ae,st){let Qe,$e=st;ne>16-$e?(Qe=Ae,$|=Qe<<ne&65535,Ze($),$=Qe>>>16-ne,ne+=$e-16):($|=Ae<<ne&65535,ne+=$e)}function rt(Ae,st){let Qe=Ae*2;Ke(st[Qe]&65535,st[Qe+1]&65535)}function Xt(Ae,st){let Qe,$e=-1,yt,Bt=Ae[0*2+1],Ln=0,Io=7,To=4;for(Bt===0&&(Io=138,To=3),Qe=0;Qe<=st;Qe++)if(yt=Bt,Bt=Ae[(Qe+1)*2+1],!(++Ln<Io&&yt==Bt)){if(Ln<To)do rt(yt,B);while(--Ln!==0);else yt!==0?(yt!=$e&&(rt(yt,B),Ln--),rt(16,B),Ke(Ln-3,2)):Ln<=10?(rt(17,B),Ke(Ln-3,3)):(rt(18,B),Ke(Ln-11,7));Ln=0,$e=yt,Bt===0?(Io=138,To=3):yt==Bt?(Io=6,To=3):(Io=7,To=4)}}function Ht(Ae,st,Qe){let $e;for(Ke(Ae-257,5),Ke(st-1,5),Ke(Qe-4,4),$e=0;$e<Qe;$e++)Ke(B[br.bl_order[$e]*2+1],3);Xt(A,Ae-1),Xt(k,st-1)}function qe(){ne==16?(Ze($),$=0,ne=0):ne>=8&&(Ie($&255),$>>>=8,ne-=8)}function mn(){Ke(QJ<<1,3),rt(256,ka.static_ltree),qe(),1+j+10-ne<9&&(Ke(QJ<<1,3),rt(256,ka.static_ltree),qe()),j=7}function Dt(Ae,st){let Qe,$e,yt;if(e.dist_buf[Q]=Ae,e.lc_buf[Q]=st&255,Q++,Ae===0?A[st*2]++:(ie++,Ae--,A[(br._length_code[st]+256+1)*2]++,k[br.d_code(Ae)*2]++),!(Q&8191)&&b>2){for(Qe=Q*8,$e=E-S,yt=0;yt<30;yt++)Qe+=k[yt*2]*(5+br.extra_dbits[yt]);if(Qe>>>=3,ie<Math.floor(Q/2)&&Qe<Math.floor($e/2))return!0}return Q==K-1}function Lt(Ae,st){let Qe,$e,yt=0,Bt,Ln;if(Q!==0)do Qe=e.dist_buf[yt],$e=e.lc_buf[yt],yt++,Qe===0?rt($e,Ae):(Bt=br._length_code[$e],rt(Bt+256+1,Ae),Ln=br.extra_lbits[Bt],Ln!==0&&($e-=br.base_length[Bt],Ke($e,Ln)),Qe--,Bt=br.d_code(Qe),rt(Bt,st),Ln=br.extra_dbits[Bt],Ln!==0&&(Qe-=br.base_dist[Bt],Ke(Qe,Ln)));while(yt<Q);rt(256,Ae),j=Ae[256*2+1]}function Vi(){ne>8?Ze($):ne>0&&Ie($&255),$=0,ne=0}function ln(Ae,st,Qe){Vi(),j=8,Qe&&(Ze(st),Ze(~st)),e.pending_buf.set(l.subarray(Ae,Ae+st),e.pending),e.pending+=st}function ge(Ae,st,Qe){Ke((Ott<<1)+(Qe?1:0),3),ln(Ae,st,!0)}function Le(Ae,st,Qe){let $e,yt,Bt=0;b>0?(O.build_tree(e),H.build_tree(e),Bt=Ve(),$e=e.opt_len+3+7>>>3,yt=e.static_len+3+7>>>3,yt<=$e&&($e=yt)):$e=yt=st+5,st+4<=$e&&Ae!=-1?ge(Ae,st,Qe):yt==$e?(Ke((QJ<<1)+(Qe?1:0),3),Lt(ka.static_ltree,ka.static_dtree)):(Ke((Dtt<<1)+(Qe?1:0),3),Ht(O.max_code+1,H.max_code+1,Bt+1),Lt(A,k)),Ce(),Qe&&Vi()}function yn(Ae){Le(S>=0?S:-1,E-S,Ae),S=E,t.flush_pending()}function bt(){let Ae,st,Qe,$e;do{if($e=d-v-E,$e===0&&E===0&&v===0)$e=r;else if($e==-1)$e--;else if(E>=r+r-Ud){l.set(l.subarray(r,r+r),0),I-=r,E-=r,S-=r,Ae=y,Qe=Ae;do st=f[--Qe]&65535,f[Qe]=st>=r?st-r:0;while(--Ae!==0);Ae=r,Qe=Ae;do st=u[--Qe]&65535,u[Qe]=st>=r?st-r:0;while(--Ae!==0);$e+=r}if(t.avail_in===0)return;Ae=t.read_buf(l,E+v,$e),v+=Ae,v>=Xr&&(p=l[E]&255,p=(p<<x^l[E+1]&255)&g)}while(v<Ud&&t.avail_in!==0)}function ro(Ae){let st=65535,Qe;for(st>i-5&&(st=i-5);;){if(v<=1){if(bt(),v===0&&Ae==0)return sm;if(v===0)break}if(E+=v,v=0,Qe=S+st,(E===0||E>=Qe)&&(v=E-Qe,E=Qe,yn(!1),t.avail_out===0)||E-S>=r-Ud&&(yn(!1),t.avail_out===0))return sm}return yn(Ae==4),t.avail_out===0?Ae==4?Q2:sm:Ae==4?hU:fU}function Xo(Ae){let st=F,Qe=E,$e,yt,Bt=P,Ln=E>r-Ud?E-(r-Ud):0,Io=W,To=a,Ka=E+yU,Ja=l[Qe+Bt-1],Li=l[Qe+Bt];P>=X&&(st>>=2),Io>v&&(Io=v);do if($e=Ae,!(l[$e+Bt]!=Li||l[$e+Bt-1]!=Ja||l[$e]!=l[Qe]||l[++$e]!=l[Qe+1])){Qe+=2,$e++;do;while(l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&l[++Qe]==l[++$e]&&Qe<Ka);if(yt=yU-(Ka-Qe),Qe=Ka-yU,yt>Bt){if(I=Ae,Bt=yt,yt>=Io)break;Ja=l[Qe+Bt-1],Li=l[Qe+Bt]}}while((Ae=u[Ae&To]&65535)>Ln&&--st!==0);return Bt<=v?Bt:v}function ra(Ae){let st=0,Qe;for(;;){if(v<Ud){if(bt(),v<Ud&&Ae==0)return sm;if(v===0)break}if(v>=Xr&&(p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E),st!==0&&(E-st&65535)<=r-Ud&&G!=2&&(V=Xo(st)),V>=Xr)if(Qe=Dt(E-I,V-Xr),v-=V,V<=N&&v>=Xr){V--;do E++,p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E;while(--V!==0);E++}else E+=V,V=0,p=l[E]&255,p=(p<<x^l[E+1]&255)&g;else Qe=Dt(0,l[E]&255),v--,E++;if(Qe&&(yn(!1),t.avail_out===0))return sm}return yn(Ae==4),t.avail_out===0?Ae==4?Q2:sm:Ae==4?hU:fU}function Wr(Ae){let st=0,Qe,$e;for(;;){if(v<Ud){if(bt(),v<Ud&&Ae==0)return sm;if(v===0)break}if(v>=Xr&&(p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E),P=V,Z=I,V=Xr-1,st!==0&&P<N&&(E-st&65535)<=r-Ud&&(G!=2&&(V=Xo(st)),V<=5&&(G==1||V==Xr&&E-I>4096)&&(V=Xr-1)),P>=Xr&&V<=P){$e=E+v-Xr,Qe=Dt(E-1-Z,P-Xr),v-=P-1,P-=2;do++E<=$e&&(p=(p<<x^l[E+(Xr-1)]&255)&g,st=f[p]&65535,u[E&a]=f[p],f[p]=E);while(--P!==0);if(R=0,V=Xr-1,E++,Qe&&(yn(!1),t.avail_out===0))return sm}else if(R!==0){if(Qe=Dt(0,l[E-1]&255),Qe&&yn(!1),E++,v--,t.avail_out===0)return sm}else R=1,E++,v--}return R!==0&&(Qe=Dt(0,l[E-1]&255),R=0),yn(Ae==4),t.avail_out===0?Ae==4?Q2:sm:Ae==4?hU:fU}function _s(Ae){return Ae.total_in=Ae.total_out=0,Ae.msg=null,e.pending=0,e.pending_out=0,n=pU,o=0,me(),be(),0}e.deflateInit=function(Ae,st,Qe,$e,yt,Bt){return $e||($e=JJ),yt||(yt=ktt),Bt||(Bt=0),Ae.msg=null,st==-1&&(st=6),yt<1||yt>Ntt||$e!=JJ||Qe<9||Qe>15||st<0||st>9||Bt<0||Bt>2?-2:(Ae.dstate=e,s=Qe,r=1<<s,a=r-1,h=yt+7,y=1<<h,g=y-1,x=Math.floor((h+Xr-1)/Xr),l=new Uint8Array(r*2),u=[],f=[],K=1<<yt+6,e.pending_buf=new Uint8Array(K*4),i=K*4,e.dist_buf=new Uint16Array(K),e.lc_buf=new Uint8Array(K),b=st,G=Bt,_s(Ae))},e.deflateEnd=function(){return n!=KJ&&n!=pU&&n!=j2?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,f=null,u=null,l=null,e.dstate=null,n==pU?-3:0)},e.deflateParams=function(Ae,st,Qe){let $e=0;return st==-1&&(st=6),st<0||st>9||Qe<0||Qe>2?-2:(Xf[b].func!=Xf[st].func&&Ae.total_in!==0&&($e=Ae.deflate(1)),b!=st&&(b=st,N=Xf[b].max_lazy,X=Xf[b].good_length,W=Xf[b].nice_length,F=Xf[b].max_chain),G=Qe,$e)},e.deflateSetDictionary=function(Ae,st,Qe){let $e=Qe,yt,Bt=0;if(!st||n!=KJ)return-2;if($e<Xr)return 0;for($e>r-Ud&&($e=r-Ud,Bt=Qe-$e),l.set(st.subarray(Bt,Bt+$e),0),E=$e,S=$e,p=l[0]&255,p=(p<<x^l[1]&255)&g,yt=0;yt<=$e-Xr;yt++)p=(p<<x^l[yt+(Xr-1)]&255)&g,u[yt&a]=f[p],f[p]=yt;return 0},e.deflate=function(Ae,st){let Qe,$e,yt,Bt,Ln;if(st>4||st<0)return-2;if(!Ae.next_out||!Ae.next_in&&Ae.avail_in!==0||n==j2&&st!=4)return Ae.msg=mU[4],-2;if(Ae.avail_out===0)return Ae.msg=mU[7],-5;if(t=Ae,Bt=o,o=st,n==KJ&&($e=JJ+(s-8<<4)<<8,yt=(b-1&255)>>1,yt>3&&(yt=3),$e|=yt<<6,E!==0&&($e|=Utt),$e+=31-$e%31,n=pU,De($e)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&st<=Bt&&st!=4)return t.msg=mU[7],-5;if(n==j2&&t.avail_in!==0)return Ae.msg=mU[7],-5;if(t.avail_in!==0||v!==0||st!=0&&n!=j2){switch(Ln=-1,Xf[b].func){case zhe:Ln=ro(st);break;case bU:Ln=ra(st);break;case ST:Ln=Wr(st);break;default:}if((Ln==Q2||Ln==hU)&&(n=j2),Ln==sm||Ln==Q2)return t.avail_out===0&&(o=-1),0;if(Ln==fU){if(st==1)mn();else if(ge(0,0,!1),st==3)for(Qe=0;Qe<y;Qe++)f[Qe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return st!=4?0:1}}function Khe(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}Khe.prototype={deflateInit(e,t){let n=this;return n.dstate=new Btt,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Jhe(e){let t=this,n=new Khe,i=Ytt(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,l){let d,u,f=0,p=0,y=0,h=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,d=n.deflate(o),d!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?h.push(new Uint8Array(r)):h.push(r.subarray(0,n.next_out_index))),y+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=f&&(l(n.next_in_index),f=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return h.length>1?(u=new Uint8Array(y),h.forEach(function(g){u.set(g,p),p+=g.length})):u=h[0]?new Uint8Array(h[0]):new Uint8Array,u}},t.flush=function(){let a,l,d=0,u=0,f=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&f.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),l=new Uint8Array(u),f.forEach(function(p){l.set(p,d),d+=p.length}),l}}function Ytt(e){return e+5*(Math.floor(e/16383)+1)}var dxi=_(T(),1);var Od=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ppe=1440,Htt=0,ztt=4,Ktt=9,Jtt=5,Qtt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],jtt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],qtt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],$tt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],ent=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],tnt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],lg=15;function eQ(){let e=this,t,n,i,o,r,s;function a(d,u,f,p,y,h,g,x,S,V,Z){let R,E,I,v,P,F,N,b,G,X,W,A,k,B,O;X=0,P=f;do i[d[u+X]]++,X++,P--;while(P!==0);if(i[0]==f)return g[0]=-1,x[0]=0,0;for(b=x[0],F=1;F<=lg&&i[F]===0;F++);for(N=F,b<F&&(b=F),P=lg;P!==0&&i[P]===0;P--);for(I=P,b>P&&(b=P),x[0]=b,B=1<<F;F<P;F++,B<<=1)if((B-=i[F])<0)return-3;if((B-=i[P])<0)return-3;for(i[P]+=B,s[1]=F=0,X=1,k=2;--P!==0;)s[k]=F+=i[X],k++,X++;P=0,X=0;do(F=d[u+X])!==0&&(Z[s[F]++]=P),X++;while(++P<f);for(f=s[I],s[0]=P=0,X=0,v=-1,A=-b,r[0]=0,W=0,O=0;N<=I;N++)for(R=i[N];R--!==0;){for(;N>A+b;){if(v++,A+=b,O=I-A,O=O>b?b:O,(E=1<<(F=N-A))>R+1&&(E-=R+1,k=N,F<O))for(;++F<O&&!((E<<=1)<=i[++k]);)E-=i[k];if(O=1<<F,V[0]+O>ppe)return-3;r[v]=W=V[0],V[0]+=O,v!==0?(s[v]=P,o[0]=F,o[1]=b,F=P>>>A-b,o[2]=W-r[v-1]-F,S.set(o,(r[v-1]+F)*3)):g[0]=W}for(o[1]=N-A,X>=f?o[0]=192:Z[X]<p?(o[0]=Z[X]<256?0:96,o[2]=Z[X++]):(o[0]=h[Z[X]-p]+16+64,o[2]=y[Z[X++]-p]),E=1<<N-A,F=P>>>A;F<O;F+=E)S.set(o,(W+F)*3);for(F=1<<N-1;P&F;F>>>=1)P^=F;for(P^=F,G=(1<<A)-1;(P&G)!=s[v];)v--,A-=b,G=(1<<A)-1}return B!==0&&I!=1?-5:0}function l(d){let u;for(t||(t=[],n=[],i=new Int32Array(lg+1),o=[],r=new Int32Array(lg),s=new Int32Array(lg+1)),n.length<d&&(n=[]),u=0;u<d;u++)n[u]=0;for(u=0;u<lg+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,lg),0),s.set(i.subarray(0,lg+1),0)}e.inflate_trees_bits=function(d,u,f,p,y){let h;return l(19),t[0]=0,h=a(d,0,19,19,null,null,f,u,p,t,n),h==-3?y.msg="oversubscribed dynamic bit lengths tree":(h==-5||u[0]===0)&&(y.msg="incomplete dynamic bit lengths tree",h=-3),h},e.inflate_trees_dynamic=function(d,u,f,p,y,h,g,x,S){let V;return l(288),t[0]=0,V=a(f,0,d,257,qtt,$tt,h,p,x,t,n),V!=0||p[0]===0?(V==-3?S.msg="oversubscribed literal/length tree":V!=-4&&(S.msg="incomplete literal/length tree",V=-3),V):(l(288),V=a(f,d,u,0,ent,tnt,g,y,x,t,n),V!=0||y[0]===0&&d>257?(V==-3?S.msg="oversubscribed distance tree":V==-5?(S.msg="incomplete distance tree",V=-3):V!=-4&&(S.msg="empty distance tree with lengths",V=-3),V):0)}}eQ.inflate_trees_fixed=function(e,t,n,i){return e[0]=Ktt,t[0]=Jtt,n[0]=Qtt,i[0]=jtt,0};var _U=0,Qhe=1,jhe=2,qhe=3,$he=4,epe=5,tpe=6,jJ=7,npe=8,TU=9;function nnt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,l=0,d=0,u=0,f,p=0,y,h=0;function g(x,S,V,Z,R,E,I,v){let P,F,N,b,G,X,W,A,k,B,O,H,U,K,Q,ie;W=v.next_in_index,A=v.avail_in,G=I.bitb,X=I.bitk,k=I.write,B=k<I.read?I.read-k-1:I.end-k,O=Od[x],H=Od[S];do{for(;X<20;)A--,G|=(v.read_byte(W++)&255)<<X,X+=8;if(P=G&O,F=V,N=Z,ie=(N+P)*3,(b=F[ie])===0){G>>=F[ie+1],X-=F[ie+1],I.win[k++]=F[ie+2],B--;continue}do{if(G>>=F[ie+1],X-=F[ie+1],b&16){for(b&=15,U=F[ie+2]+(G&Od[b]),G>>=b,X-=b;X<15;)A--,G|=(v.read_byte(W++)&255)<<X,X+=8;P=G&H,F=R,N=E,ie=(N+P)*3,b=F[ie];do if(G>>=F[ie+1],X-=F[ie+1],b&16){for(b&=15;X<b;)A--,G|=(v.read_byte(W++)&255)<<X,X+=8;if(K=F[ie+2]+(G&Od[b]),G>>=b,X-=b,B-=U,k>=K)Q=k-K,k-Q>0&&2>k-Q?(I.win[k++]=I.win[Q++],I.win[k++]=I.win[Q++],U-=2):(I.win.set(I.win.subarray(Q,Q+2),k),k+=2,Q+=2,U-=2);else{Q=k-K;do Q+=I.end;while(Q<0);if(b=I.end-Q,U>b){if(U-=b,k-Q>0&&b>k-Q)do I.win[k++]=I.win[Q++];while(--b!==0);else I.win.set(I.win.subarray(Q,Q+b),k),k+=b,Q+=b,b=0;Q=0}}if(k-Q>0&&U>k-Q)do I.win[k++]=I.win[Q++];while(--U!==0);else I.win.set(I.win.subarray(Q,Q+U),k),k+=U,Q+=U,U=0;break}else if(!(b&64))P+=F[ie+2],P+=G&Od[b],ie=(N+P)*3,b=F[ie];else return v.msg="invalid distance code",U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,-3;while(!0);break}if(b&64)return b&32?(U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,1):(v.msg="invalid literal/length code",U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,-3);if(P+=F[ie+2],P+=G&Od[b],ie=(N+P)*3,(b=F[ie])===0){G>>=F[ie+1],X-=F[ie+1],I.win[k++]=F[ie+2],B--;break}}while(!0)}while(B>=258&&A>=10);return U=v.avail_in-A,U=X>>3<U?X>>3:U,A+=U,W-=U,X-=U<<3,I.bitb=G,I.bitk=X,v.avail_in=A,v.total_in+=W-v.next_in_index,v.next_in_index=W,I.write=k,0}e.init=function(x,S,V,Z,R,E){t=_U,d=x,u=S,f=V,p=Z,y=R,h=E,i=null},e.proc=function(x,S,V){let Z,R,E,I=0,v=0,P=0,F,N,b,G;for(P=S.next_in_index,F=S.avail_in,I=x.bitb,v=x.bitk,N=x.write,b=N<x.read?x.read-N-1:x.end-N;;)switch(t){case _U:if(b>=258&&F>=10&&(x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,V=g(d,u,f,p,y,h,x,S),P=S.next_in_index,F=S.avail_in,I=x.bitb,v=x.bitk,N=x.write,b=N<x.read?x.read-N-1:x.end-N,V!=0)){t=V==1?jJ:TU;break}r=d,i=f,o=p,t=Qhe;case Qhe:for(Z=r;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}if(R=(o+(I&Od[Z]))*3,I>>>=i[R+1],v-=i[R+1],E=i[R],E===0){s=i[R+2],t=tpe;break}if(E&16){a=E&15,n=i[R+2],t=jhe;break}if(!(E&64)){r=E,o=R/3+i[R+2];break}if(E&32){t=jJ;break}return t=TU,S.msg="invalid literal/length code",V=-3,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);case jhe:for(Z=a;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}n+=I&Od[Z],I>>=Z,v-=Z,r=u,i=y,o=h,t=qhe;case qhe:for(Z=r;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}if(R=(o+(I&Od[Z]))*3,I>>=i[R+1],v-=i[R+1],E=i[R],E&16){a=E&15,l=i[R+2],t=$he;break}if(!(E&64)){r=E,o=R/3+i[R+2];break}return t=TU,S.msg="invalid distance code",V=-3,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);case $he:for(Z=a;v<Z;){if(F!==0)V=0;else return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);F--,I|=(S.read_byte(P++)&255)<<v,v+=8}l+=I&Od[Z],I>>=Z,v-=Z,t=epe;case epe:for(G=N-l;G<0;)G+=x.end;for(;n!==0;){if(b===0&&(N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0&&(x.write=N,V=x.inflate_flush(S,V),N=x.write,b=N<x.read?x.read-N-1:x.end-N,N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0)))return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);x.win[N++]=x.win[G++],b--,G==x.end&&(G=0),n--}t=_U;break;case tpe:if(b===0&&(N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0&&(x.write=N,V=x.inflate_flush(S,V),N=x.write,b=N<x.read?x.read-N-1:x.end-N,N==x.end&&x.read!==0&&(N=0,b=N<x.read?x.read-N-1:x.end-N),b===0)))return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);V=0,x.win[N++]=s,b--,t=_U;break;case jJ:if(v>7&&(v-=8,F++,P--),x.write=N,V=x.inflate_flush(S,V),N=x.write,b=N<x.read?x.read-N-1:x.end-N,x.read!=x.write)return x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);t=npe;case npe:return V=1,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);case TU:return V=-3,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V);default:return V=-2,x.bitb=I,x.bitk=v,S.avail_in=F,S.total_in+=P-S.next_in_index,S.next_in_index=P,x.write=N,x.inflate_flush(S,V)}},e.free=function(){}}var ipe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ZV=0,qJ=1,ope=2,rpe=3,spe=4,ape=5,SU=6,CU=7,cpe=8,CT=9;function int(e,t){let n=this,i=ZV,o=0,r=0,s=0,a,l=[0],d=[0],u=new nnt,f=0,p=new Int32Array(ppe*3),y=0,h=new eQ;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(g,x){x&&(x[0]=y),i==SU&&u.free(g),i=ZV,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(g,x){let S,V,Z;return V=g.next_out_index,Z=n.read,S=(Z<=n.write?n.write:n.end)-Z,S>g.avail_out&&(S=g.avail_out),S!==0&&x==-5&&(x=0),g.avail_out-=S,g.total_out+=S,g.next_out.set(n.win.subarray(Z,Z+S),V),V+=S,Z+=S,Z==n.end&&(Z=0,n.write==n.end&&(n.write=0),S=n.write-Z,S>g.avail_out&&(S=g.avail_out),S!==0&&x==-5&&(x=0),g.avail_out-=S,g.total_out+=S,g.next_out.set(n.win.subarray(Z,Z+S),V),V+=S,Z+=S),g.next_out_index=V,n.read=Z,x},n.proc=function(g,x){let S,V,Z,R,E,I,v,P;for(R=g.next_in_index,E=g.avail_in,V=n.bitb,Z=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I;;){let F,N,b,G,X,W,A,k;switch(i){case ZV:for(;Z<3;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}switch(S=V&7,f=S&1,S>>>1){case 0:V>>>=3,Z-=3,S=Z&7,V>>>=S,Z-=S,i=qJ;break;case 1:F=[],N=[],b=[[]],G=[[]],eQ.inflate_trees_fixed(F,N,b,G),u.init(F[0],N[0],b[0],0,G[0],0),V>>>=3,Z-=3,i=SU;break;case 2:V>>>=3,Z-=3,i=rpe;break;case 3:return V>>>=3,Z-=3,i=CT,g.msg="invalid block type",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x)}break;case qJ:for(;Z<32;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if((~V>>>16&65535)!=(V&65535))return i=CT,g.msg="invalid stored block lengths",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);o=V&65535,V=Z=0,i=o!==0?ope:f!==0?CU:ZV;break;case ope:if(E===0||v===0&&(I==n.end&&n.read!==0&&(I=0,v=I<n.read?n.read-I-1:n.end-I),v===0&&(n.write=I,x=n.inflate_flush(g,x),I=n.write,v=I<n.read?n.read-I-1:n.end-I,I==n.end&&n.read!==0&&(I=0,v=I<n.read?n.read-I-1:n.end-I),v===0)))return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);if(x=0,S=o,S>E&&(S=E),S>v&&(S=v),n.win.set(g.read_buf(R,S),I),R+=S,E-=S,I+=S,v-=S,(o-=S)!==0)break;i=f!==0?CU:ZV;break;case rpe:for(;Z<14;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if(r=S=V&16383,(S&31)>29||(S>>5&31)>29)return i=CT,g.msg="too many length or distance symbols",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);if(S=258+(S&31)+(S>>5&31),!a||a.length<S)a=[];else for(P=0;P<S;P++)a[P]=0;V>>>=14,Z-=14,s=0,i=spe;case spe:for(;s<4+(r>>>10);){for(;Z<3;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}a[ipe[s++]]=V&7,V>>>=3,Z-=3}for(;s<19;)a[ipe[s++]]=0;if(l[0]=7,S=h.inflate_trees_bits(a,l,d,p,g),S!=0)return x=S,x==-3&&(a=null,i=CT),n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);s=0,i=ape;case ape:for(;S=r,!(s>=258+(S&31)+(S>>5&31));){let B,O;for(S=l[0];Z<S;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if(S=p[(d[0]+(V&Od[S]))*3+1],O=p[(d[0]+(V&Od[S]))*3+2],O<16)V>>>=S,Z-=S,a[s++]=O;else{for(P=O==18?7:O-14,B=O==18?11:3;Z<S+P;){if(E!==0)x=0;else return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);E--,V|=(g.read_byte(R++)&255)<<Z,Z+=8}if(V>>>=S,Z-=S,B+=V&Od[P],V>>>=P,Z-=P,P=s,S=r,P+B>258+(S&31)+(S>>5&31)||O==16&&P<1)return a=null,i=CT,g.msg="invalid bit length repeat",x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);O=O==16?a[P-1]:0;do a[P++]=O;while(--B!==0);s=P}}if(d[0]=-1,X=[],W=[],A=[],k=[],X[0]=9,W[0]=6,S=r,S=h.inflate_trees_dynamic(257+(S&31),1+(S>>5&31),a,X,W,A,k,p,g),S!=0)return S==-3&&(a=null,i=CT),x=S,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);u.init(X[0],W[0],p,A[0],p,k[0]),i=SU;case SU:if(n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,(x=u.proc(n,g,x))!=1)return n.inflate_flush(g,x);if(x=0,u.free(g),R=g.next_in_index,E=g.avail_in,V=n.bitb,Z=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I,f===0){i=ZV;break}i=CU;case CU:if(n.write=I,x=n.inflate_flush(g,x),I=n.write,v=I<n.read?n.read-I-1:n.end-I,n.read!=n.write)return n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);i=cpe;case cpe:return x=1,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);case CT:return x=-3,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x);default:return x=-2,n.bitb=V,n.bitk=Z,g.avail_in=E,g.total_in+=R-g.next_in_index,g.next_in_index=R,n.write=I,n.inflate_flush(g,x)}}},n.free=function(g){n.reset(g,null),n.win=null,p=null},n.set_dictionary=function(g,x,S){n.win.set(g.subarray(x,x+S),0),n.read=n.write=S},n.sync_point=function(){return i==qJ?1:0}}var ont=32,rnt=8,snt=0,lpe=1,dpe=2,upe=3,mpe=4,fpe=5,$J=6,q2=7,hpe=12,dg=13,ant=[0,0,255,255];function cnt(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=q2,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new int(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==ztt?-5:0,o=-5;;)switch(s.mode){case snt:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=rnt){s.mode=dg,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=dg,n.msg="invalid win size",s.marker=5;break}s.mode=lpe;case lpe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=dg,n.msg="incorrect header check",s.marker=5;break}if(!(r&ont)){s.mode=q2;break}s.mode=dpe;case dpe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=upe;case upe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=mpe;case mpe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=fpe;case fpe:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=$J,2);case $J:return s.mode=dg,n.msg="need dictionary",s.marker=0,-2;case q2:if(o=s.blocks.proc(n,o),o==-3){s.mode=dg,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=hpe;case hpe:return n.avail_in=0,1;case dg:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=$J)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=q2,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let l=n.istate;if(l.mode!=dg&&(l.mode=dg,l.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=l.marker;i!==0&&r<4;)n.read_byte(o)==ant[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,l.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,l.mode=q2,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function bpe(){}bpe.prototype={inflateInit(e){let t=this;return t.istate=new cnt,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function ype(e){let t=this,n=new bpe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Htt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,l){let d=[],u,f,p=0,y=0,h=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),u=n.inflate(o),s&&u===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==0&&u!==1)throw new Error("inflating: "+n.msg);if((s||u===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?d.push(new Uint8Array(r)):d.push(r.subarray(0,n.next_out_index))),h+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=p&&(l(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(f=new Uint8Array(h),d.forEach(function(g){f.set(g,y),y+=g.length})):f=d[0]?new Uint8Array(d[0]):new Uint8Array,f}},t.flush=function(){n.inflateEnd()}}var xxi=_(T(),1);var mxi=_(T(),1);var RV="/",tQ=new Date(2107,11,31),nQ=new Date(1980,0,1),Ei=void 0,Dd="undefined",t0="function";var hxi=_(T(),1);var $2=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var lnt=64,gpe=2;try{typeof navigator!=Dd&&navigator.hardwareConcurrency&&(gpe=navigator.hardwareConcurrency)}catch{}var dnt={chunkSize:512*1024,maxWorkers:gpe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Ei,CompressionStreamNative:typeof CompressionStream!=Dd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Dd&&DecompressionStream},mg=Object.assign({},dnt);function ev(){return mg}function VU(e){return Math.max(e.chunkSize,lnt)}function GV(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:d,DecompressionStream:u,workerScripts:f}=e;if(ug("baseURL",t),ug("chunkSize",n),ug("maxWorkers",i),ug("terminateWorkerTimeout",o),ug("useCompressionStream",r),ug("useWebWorkers",s),a&&(mg.CompressionStream=new $2(a)),l&&(mg.DecompressionStream=new $2(l)),ug("CompressionStream",d),ug("DecompressionStream",u),f!==Ei){let{deflate:p,inflate:y}=f;if((p||y)&&(mg.workerScripts||(mg.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");mg.workerScripts.deflate=p}if(y){if(!Array.isArray(y))throw new Error("workerScripts.inflate must be an array");mg.workerScripts.inflate=y}}}function ug(e,t){t!==Ei&&(mg[e]=t)}var Txi=_(T(),1);var f_i=_(T(),1);var o_i=_(T(),1);var t_i=_(T(),1);var Zxi=_(T(),1);var Cxi=_(T(),1),xpe=[];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;xpe[e]=t}var n0=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^xpe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var tv=class extends TransformStream{constructor(){let t,n=new n0;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var Yxi=_(T(),1);var Exi=_(T(),1);function EV(e){if(typeof TextEncoder==Dd){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 Ixi=_(T(),1),ll={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=ll.getPartial(n);return i===32?e.concat(t):ll._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+ll.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]=ll.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=ll.getPartial(o);return i.push(ll.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},nv={bytes:{fromBits(e){let n=ll.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(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(ll.partial(8*(n&3),i)),t}}},_pe={};_pe.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=nv.utf8String.toBits(e));let n=t._buffer=ll.concat(t._buffer,e),i=t._length,o=t._length=i+ll.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=ll.concat(t,[ll.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],l=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+l+i[d]+t._key[Math.floor(d/20)]|0;l=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0}};var iQ={};iQ.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,l=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^l<<24,l=l<<1^(l>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,l,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let f=s^s<<1^s<<2^s<<3^s<<4;f=f>>8^f&255^99,n[u]=f,i[f]=u,d=o[l=o[a=o[u]]];let p=d*16843009^l*65537^a*257^u*16843008,y=o[f]*257^f*16843008;for(let h=0;h<4;h++)e[h][u]=y=y<<24^y>>>8,t[h][f]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],l=r[2],d=r[3],u=r[4],f=e[0]^n[0],p=e[t?3:1]^n[1],y=e[2]^n[2],h=e[t?1:3]^n[3],g=4,x,S,V;for(let Z=0;Z<i;Z++)x=s[f>>>24]^a[p>>16&255]^l[y>>8&255]^d[h&255]^n[g],S=s[p>>>24]^a[y>>16&255]^l[h>>8&255]^d[f&255]^n[g+1],V=s[y>>>24]^a[h>>16&255]^l[f>>8&255]^d[p&255]^n[g+2],h=s[h>>>24]^a[f>>16&255]^l[p>>8&255]^d[y&255]^n[g+3],g+=4,f=x,p=S,y=V;for(let Z=0;Z<4;Z++)o[t?3&-Z:Z]=u[f>>>24]<<24^u[p>>16&255]<<16^u[y>>8&255]<<8^u[h&255]^n[g++],x=f,f=p,p=y,y=h,h=x;return o}};var Tpe={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}},oQ={};oQ.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=ll.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 ll.clamp(t,o)}};var fg={importKey(e){return new fg.hmacSha1(nv.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,l,d,u=new ArrayBuffer(o),f=new DataView(u),p=0,y=ll;for(t=nv.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(y.concat(t,[d])),a=1;a<n;a++)for(s=e.encrypt(s),l=0;l<s.length;l++)r[l]^=s[l];for(a=0;p<(o||1)&&a<r.length;a++)f.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};fg.hmacSha1=class{constructor(e){let t=this,n=t._hash=_pe.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 Nxi=_(T(),1);var unt=typeof crypto!=Dd&&typeof crypto.getRandomValues==t0,hg="Invalid password",VT="Invalid signature",i0="zipjs-abort-check-password";function LU(e){return unt?crypto.getRandomValues(e):Tpe.getRandomValues(e)}var XV=16,mnt="raw",Vpe={name:"PBKDF2"},fnt={name:"HMAC"},hnt="SHA-1",pnt=Object.assign({hash:fnt},Vpe),rQ=Object.assign({iterations:1e3,hash:{name:hnt}},Vpe),bnt=["deriveBits"],ov=[8,12,16],iv=[16,24,32],pg=10,ynt=[0,0,0,0],GU=typeof crypto!=Dd,av=GU&&crypto.subtle,Lpe=GU&&typeof av!=Dd,Uh=nv.bytes,gnt=iQ.aes,xnt=oQ.ctrGladman,_nt=fg.hmacSha1,Spe=GU&&Lpe&&typeof av.importKey==t0,Cpe=GU&&Lpe&&typeof av.deriveBits==t0,ZU=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:Gpe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let l=this,{password:d,strength:u,resolveReady:f,ready:p}=l;d?(await Tnt(l,u,d,am(s,0,ov[u]+2)),s=am(s,ov[u]+2),r?a.error(new Error(i0)):f()):await p;let y=new Uint8Array(s.length-pg-(s.length-pg)%XV);a.enqueue(Zpe(l,s,y,0,pg,!0))},async flush(s){let{signed:a,ctr:l,hmac:d,pending:u,ready:f}=this;if(d&&l){await f;let p=am(u,0,u.length-pg),y=am(u,u.length-pg),h=new Uint8Array;if(p.length){let g=sv(Uh,p);d.update(g);let x=l.update(g);h=rv(Uh,x)}if(a){let g=am(rv(Uh,d.digest()),0,pg);for(let x=0;x<pg;x++)if(g[x]!=y[x])throw new Error(VT)}s.enqueue(h)}}})}},RU=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:Gpe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:l,strength:d,resolveReady:u,ready:f}=a,p=new Uint8Array;l?(p=await Snt(a,d,l),u()):await f;let y=new Uint8Array(p.length+r.length-r.length%XV);y.set(p,0),s.enqueue(Zpe(a,r,y,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:l,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(l.length){let f=s.update(sv(Uh,l));a.update(f),u=rv(Uh,f)}o.signature=rv(Uh,a.digest()).slice(0,pg),r.enqueue(sQ(u,o.signature))}}}),o=this}};function Zpe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:l}=e,d=t.length-o;l.length&&(t=sQ(l,t),n=Lnt(n,d-d%XV));let u;for(u=0;u<=d-XV;u+=XV){let f=sv(Uh,am(t,u,u+XV));r&&a.update(f);let p=s.update(f);r||a.update(p),n.set(rv(Uh,p),u+i)}return e.pending=am(t,u),n}async function Tnt(e,t,n,i){let o=await Rpe(e,t,n,am(i,0,ov[t])),r=am(i,ov[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(hg)}async function Snt(e,t,n){let i=LU(new Uint8Array(ov[t])),o=await Rpe(e,t,n,i);return sQ(i,o)}async function Rpe(e,t,n,i){e.password=null;let o=await Cnt(mnt,n,pnt,!1,bnt),r=await Vnt(Object.assign({salt:i},rQ),o,8*(iv[t]*2+2)),s=new Uint8Array(r),a=sv(Uh,am(s,0,iv[t])),l=sv(Uh,am(s,iv[t],iv[t]*2)),d=am(s,iv[t]*2);return Object.assign(e,{keys:{key:a,authentication:l,passwordVerification:d},ctr:new xnt(new gnt(a),Array.from(ynt)),hmac:new _nt(l)}),d}async function Cnt(e,t,n,i,o){if(Spe)try{return await av.importKey(e,t,n,i,o)}catch{return Spe=!1,fg.importKey(t)}else return fg.importKey(t)}async function Vnt(e,t,n){if(Cpe)try{return await av.deriveBits(e,t,n)}catch{return Cpe=!1,fg.pbkdf2(t,e.salt,rQ.iterations,n)}else return fg.pbkdf2(t,e.salt,rQ.iterations,n)}function Gpe(e,t){return t===Ei?EV(e):t}function sQ(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 Lnt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function am(e,t,n){return e.subarray(t,n)}function rv(e,t){return e.fromBits(t)}function sv(e,t){return e.toBits(t)}var Jxi=_(T(),1);var IV=12,EU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Wpe(this,t)},transform(o,r){let s=this;if(s.password){let a=Epe(s,o.subarray(0,IV));if(s.password=null,a[IV-1]!=s.passwordVerification)throw new Error(hg);o=o.subarray(IV)}i?r.error(new Error(i0)):r.enqueue(Epe(s,o))}})}},XU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Wpe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let l=LU(new Uint8Array(IV));l[IV-1]=r.passwordVerification,s=new Uint8Array(i.length+l.length),s.set(Xpe(r,l),0),a=IV}else s=new Uint8Array(i.length),a=0;s.set(Xpe(r,i),a),o.enqueue(s)}})}};function Epe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=wpe(e)^t[i],aQ(e,n[i]);return n}function Xpe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=wpe(e)^t[i],aQ(e,t[i]);return n}function Wpe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new n0(n[0]),crcKey2:new n0(n[2])});for(let i=0;i<t.length;i++)aQ(e,t.charCodeAt(i))}function aQ(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Ipe(Math.imul(Ipe(i+Ppe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function wpe(e){let t=e.keys[2]|2;return Ppe(Math.imul(t,t^1)>>>8)}function Ppe(e){return e&255}function Ipe(e){return e&4294967295}var vpe="deflate-raw",IU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:d,level:u}=t,f=this,p,y,h=Fpe(super.readable);(!s||l)&&d&&(p=new tv,h=Oh(h,p)),r&&(h=Mpe(h,a,{level:u,chunkSize:n},o,i)),s&&(l?h=Oh(h,new XU(t)):(y=new RU(t),h=Oh(h,y))),Ape(f,h,()=>{let g;s&&!l&&(g=y.signature),(!s||l)&&d&&(g=new DataView(p.value.buffer).getUint32(0)),f.signature=g})}},WU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:l,compressed:d,useCompressionStream:u}=t,f,p,y=Fpe(super.readable);s&&(r?y=Oh(y,new EU(t)):(p=new ZU(t),y=Oh(y,p))),d&&(y=Mpe(y,u,{chunkSize:n},o,i)),(!s||r)&&a&&(f=new tv,y=Oh(y,f)),Ape(this,y,()=>{if((!s||r)&&a){let h=new DataView(f.value.buffer);if(l!=h.getUint32(0,!1))throw new Error(VT)}})}};function Fpe(e){return Oh(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Ape(e,t,n){t=Oh(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function Mpe(e,t,n,i,o){try{let r=t&&i?i:o;e=Oh(e,new r(vpe,n))}catch{if(t)try{e=Oh(e,new o(vpe,n))}catch{return e}else return e}return e}function Oh(e,t){return e.pipeThrough(t)}var Npe="message",kpe="start",Upe="pull",cQ="data",Ope="ack",lQ="close",vU="deflate",FU="inflate";var wU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(vU)?r=IU:o.startsWith(FU)&&(r=WU);let s=0,a=0,l=new r(t,n),d=super.readable,u=new TransformStream({transform(p,y){p&&p.length&&(a+=p.length,y.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),f=new TransformStream({transform(p,y){p&&p.length&&(s+=p.length,y.enqueue(p))},flush(){let{signature:p}=l;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(l).pipeThrough(f)}})}},PU=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var c_i=_(T(),1);var Ype=typeof Worker!=Dd;var WV=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:d},u){let{signal:f}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new PU(r.chunkSize)).pipeThrough(new uQ(n,s),{signal:f}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:l,terminate(){return new Promise(p=>{let{worker:y,busy:h}=t;y?(h?t.resolveTerminated=p:(y.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),(a&&Ype?Znt:Hpe)(t,r)}},uQ=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await dQ(n,o)},async transform(a,l){s+=a.length,i&&await dQ(i,s,o),l.enqueue(a)},async flush(){t.size=s,r&&await dQ(r,s)}})}};async function dQ(e,...t){try{await e(...t)}catch{}}function Hpe(e,t){return{run:()=>Rnt(e,t)}}function Znt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Xnt(e.scripts[0],n,e)}catch{return Ype=!1,Hpe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Gnt(e,{chunkSize:i})}})}return e.interface}async function Rnt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new wU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:l}=r;return{signature:s,inputSize:a,outputSize:l}}finally{i()}}async function Gnt(e,t){let n,i,o=new Promise((p,y)=>{n=p,i=y});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:l,closed:d}=Ent(e.writable),u=AU({type:kpe,scripts:a.slice(1),options:s,config:t,readable:r,writable:l},e);u||Object.assign(e,{reader:r.getReader(),writer:l.getWriter()});let f=await o;return u||await l.getWriter().close(),await d,f}function Ent(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 Dpe=!0,Bpe=!0;function Xnt(e,t,n){let i={type:"module"},o,r;typeof e==t0&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Dpe)try{r=new Worker(o)}catch{Dpe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Npe,s=>Int(s,n)),r}function AU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,l=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,l.push(e.value)),o&&Bpe?(s&&l.push(s),a&&l.push(a)):e.readable=e.writable=null,l.length)try{return t.postMessage(e,l),!0}catch{Bpe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Int({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:l,resolveResult:d,rejectResult:u,onTaskFinished:f}=t;try{if(s){let{message:y,stack:h,code:g,name:x}=s,S=new Error(y);Object.assign(S,{stack:h,code:g,name:x}),p(S)}else{if(n==Upe){let{value:y,done:h}=await a.read();AU({type:cQ,value:y,done:h,messageId:o},t)}n==cQ&&(await l.ready,await l.write(new Uint8Array(i)),AU({type:Ope,messageId:o},t)),n==lQ&&p(null,r)}}catch(y){AU({type:lQ,messageId:o},t),p(y)}function p(y,h){y?u(y):d(h),l&&l.releaseLock(),f()}}var LT=[],mQ=[];var zpe=0;async function MU(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:l,signed:d,encrypted:u}=n,{workerScripts:f,maxWorkers:p}=i;t.transferStreams=o||o===Ei;let y=!l&&!d&&!u&&!t.transferStreams;return t.useWebWorkers=!y&&(r||r===Ei&&i.useWebWorkers),t.scripts=t.useWebWorkers&&f?f[a]:[],n.useCompressionStream=s||s===Ei&&i.useCompressionStream,(await h()).run();async function h(){let x=LT.find(S=>!S.busy);if(x)return Kpe(x),new WV(x,e,t,g);if(LT.length<p){let S={indexWorker:zpe};return zpe++,LT.push(S),new WV(S,e,t,g)}else return new Promise(S=>mQ.push({resolve:S,stream:e,workerOptions:t}))}function g(x){if(mQ.length){let[{resolve:S,stream:V,workerOptions:Z}]=mQ.splice(0,1);S(new WV(x,V,Z,g))}else x.worker?(Kpe(x),Wnt(x,t)):LT=LT.filter(S=>S!=x)}}function Wnt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{LT=LT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Kpe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var y_i=_(T(),1);var wnt="Writer iterator completed too soon",Pnt="text/plain";var vnt="Content-Type";var Fnt=64*1024,pQ="writable",wV=class{constructor(){this.size=0}init(){this.initialized=!0}},NU=class extends wV{get readable(){let t=this,{chunkSize:n=Fnt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:l}=this;o.enqueue(await Ua(t,r+l,Math.min(n,s-l),a)),l+n>s?o.close():this.chunkOffset+=n}});return i}},fQ=class extends wV{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,pQ,{get(){return n}})}writeUint8Array(){}};var kU=class extends fQ{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>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},o0=class extends NU{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)}},cv=class extends wV{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([vnt,t]),Object.defineProperty(n,pQ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},UU=class extends o0{constructor(t){super(new Blob([t],{type:Pnt}))}},OU=class extends cv{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 hQ=class extends NU{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 l=t;for(;l>=r[a].size;)l-=r[a].size,a++;let d=r[a],u=d.size;if(l+n<=u)s=await Ua(d,l,n);else{let f=u-l;s=new Uint8Array(n),s.set(await Ua(d,l,f)),s.set(await o.readUint8Array(t+f,n-f,i),f)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},DU=class extends wV{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:f}=i;if(s)u.length>=f?(await l(u.slice(0,f)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(f))):await l(u);else{let{value:p,done:y}=await t.next();if(y&&!p)throw new Error(wnt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Bh(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,pQ,{get(){return a}});async function l(u){let f=u.length;f&&(await s.ready,await s.write(u),o.size+=f,i.size+=f,i.availableSize-=f)}async function d(){r.size=o.size,await s.close()}}};async function Bh(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function BU(e){return Array.isArray(e)&&(e=new hQ(e)),e instanceof ReadableStream&&(e={readable:e}),e}function YU(e){e.writable===Ei&&typeof e.next==t0&&(e=new DU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Ei&&(t.size=0),e instanceof DU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ua(e,t,n,i){return e.readUint8Array(t,n,i)}var w_i=_(T(),1);var S_i=_(T(),1);var x_i=_(T(),1),Jpe="\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(""),Ant=Jpe.length==256;function Qpe(e){if(Ant){let t="";for(let n=0;n<e.length;n++)t+=Jpe[e[n]];return t}else return new TextDecoder().decode(e)}function lv(e,t){return t&&t.trim().toLowerCase()=="cp437"?Qpe(e):new TextDecoder(t).decode(e)}var V_i=_(T(),1),bQ="filename",yQ="rawFilename",gQ="comment",xQ="rawComment",_Q="uncompressedSize",TQ="compressedSize",SQ="offset",HU="diskNumberStart",PV="lastModDate",zU="rawLastModDate",dv="lastAccessDate",jpe="rawLastAccessDate",uv="creationDate",qpe="rawCreationDate",CQ="internalFileAttribute",VQ="externalFileAttribute",LQ="msDosCompatible",KU="zip64",ZQ="encrypted",RQ="version",GQ="versionMadeBy",EQ="zipCrypto",Mnt=[bQ,yQ,TQ,_Q,PV,zU,gQ,xQ,dv,uv,SQ,HU,HU,CQ,VQ,LQ,KU,ZQ,RQ,GQ,EQ,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],bg=class{constructor(t){Mnt.forEach(n=>this[n]=t[n])}};var XQ="File format is not recognized",Ont="End of central directory not found",Dnt="End of Zip64 central directory locator not found",Bnt="Central directory header not found",Ynt="Local file header not found",Hnt="Zip64 extra field not found",znt="File contains encrypted entry",Knt="Encryption method not supported",$pe="Compression method not supported",ebe="Split zip file",tbe="utf-8",nbe="cp437",Jnt=[[_Q,4294967295],[TQ,4294967295],[SQ,4294967295],[HU,65535]],Qnt={[65535]:{getValue:gs,bytes:4},[4294967295]:{getValue:JU,bytes:8}},nO=class{constructor(t,n={}){Object.assign(this,{reader:BU(t),options:n,config:ev()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Bh(i),(i.size===Ei||!i.readUint8Array)&&(i=new o0(await new Response(i.readable).blob()),await Bh(i)),i.size<22)throw new Error(XQ);i.chunkSize=VU(o);let r=await tit(i,101010256,i.size,22,65535*16);if(!r){let N=await Ua(i,0,4),b=Sa(N);throw gs(b)==134695760?new Error(ebe):new Error(Ont)}let s=Sa(r),a=gs(s,12),l=gs(s,16),d=r.offset,u=Ta(s,20),f=d+22+u,p=Ta(s,4),y=i.lastDiskNumber||0,h=Ta(s,6),g=Ta(s,8),x=0,S=0;if(l==4294967295||a==4294967295||g==65535||h==65535){let N=await Ua(i,r.offset-20,20),b=Sa(N);if(gs(b,0)==117853008){l=JU(b,8);let G=await Ua(i,l,56,-1),X=Sa(G),W=r.offset-20-56;if(gs(X,0)!=101075792&&l!=W){let A=l;l=W,x=l-A,G=await Ua(i,l,56,-1),X=Sa(G)}if(gs(X,0)!=101075792)throw new Error(Dnt);p==65535&&(p=gs(X,16)),h==65535&&(h=gs(X,20)),g==65535&&(g=JU(X,32)),a==4294967295&&(a=JU(X,40)),l-=a}}if(l>=i.size&&(x=i.size-l-a-22,l=i.size-a-22),y!=p)throw new Error(ebe);if(l<0)throw new Error(XQ);let V=0,Z=await Ua(i,l,a,h),R=Sa(Z);if(a){let N=r.offset-a;if(gs(R,V)!=33639248&&l!=N){let b=l;l=N,x+=l-b,Z=await Ua(i,l,a,h),R=Sa(Z)}}let E=r.offset-l-(i.lastDiskOffset||0);if(a!=E&&E>=0&&(a=E,Z=await Ua(i,l,a,h),R=Sa(Z)),l<0||l>=i.size)throw new Error(XQ);let I=dl(n,t,"filenameEncoding"),v=dl(n,t,"commentEncoding");for(let N=0;N<g;N++){let b=new WQ(i,o,n.options);if(gs(R,V)!=33639248)throw new Error(Bnt);obe(b,R,V+6);let G=!!b.bitFlag.languageEncodingFlag,X=V+46,W=X+b.filenameLength,A=W+b.extraFieldLength,k=Ta(R,V+4),B=(k&0)==0,O=Z.subarray(X,W),H=Ta(R,V+32),U=A+H,K=Z.subarray(A,U),Q=G,ie=G,j=B&&(vV(R,V+38)&16)==16,$=gs(R,V+42)+x;Object.assign(b,{versionMadeBy:k,msDosCompatible:B,compressedSize:0,uncompressedSize:0,commentLength:H,directory:j,offset:$,diskNumberStart:Ta(R,V+34),internalFileAttribute:Ta(R,V+36),externalFileAttribute:gs(R,V+38),rawFilename:O,filenameUTF8:Q,commentUTF8:ie,rawExtraField:Z.subarray(W,A)});let ne=dl(n,t,"decodeText")||lv,be=Q?tbe:I||nbe,Ce=ie?tbe:v||nbe,me=ne(O,be);me===Ei&&(me=lv(O,be));let _e=ne(K,Ce);_e===Ei&&(_e=lv(K,Ce)),Object.assign(b,{rawComment:K,filename:me,comment:_e,directory:j||me.endsWith(RV)}),S=Math.max($,S),rbe(b,b,R,V+6),b.zipCrypto=b.encrypted&&!b.extraFieldAES;let Ve=new bg(b);Ve.getData=(Ze,De)=>b.getData(Ze,Ve,De),V=U;let{onprogress:Ie}=t;if(Ie)try{await Ie(N+1,g,new bg(b))}catch{}yield Ve}let P=dl(n,t,"extractPrependedData"),F=dl(n,t,"extractAppendedData");return P&&(n.prependedData=S>0?await Ua(i,0,S):new Uint8Array),n.comment=u?await Ua(i,d+22,u):new Uint8Array,F&&(n.appendedData=f<i.size?await Ua(i,f,i.size-f):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var WQ=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:l,compressionMethod:d,config:u,bitFlag:f,signature:p,rawLastModDate:y,uncompressedSize:h,compressedSize:g}=o,x=n.localDirectory={},S=await Ua(r,s,30,a),V=Sa(S),Z=dl(o,i,"password"),R=dl(o,i,"rawPassword"),E=dl(o,i,"passThrough");if(Z=Z&&Z.length&&Z,R=R&&R.length&&R,l&&l.originalCompressionMethod!=99)throw new Error($pe);if(d!=0&&d!=8&&!E)throw new Error($pe);if(gs(V,0)!=67324752)throw new Error(Ynt);obe(x,V,4),x.rawExtraField=x.extraFieldLength?await Ua(r,s+30+x.filenameLength,x.extraFieldLength,a):new Uint8Array,rbe(o,x,V,4,!0),Object.assign(n,{lastAccessDate:x.lastAccessDate,creationDate:x.creationDate});let I=o.encrypted&&x.encrypted&&!E,v=I&&!l;if(E||(n.zipCrypto=v),I){if(!v&&l.strength===Ei)throw new Error(Knt);if(!Z&&!R)throw new Error(znt)}let P=s+30+x.filenameLength+x.extraFieldLength,F=g,N=r.readable;Object.assign(N,{diskNumberStart:a,offset:P,size:F});let b=dl(o,i,"signal"),G=dl(o,i,"checkPasswordOnly");G&&(t=new WritableStream),t=YU(t),await Bh(t,E?g:h);let{writable:X}=t,{onstart:W,onprogress:A,onend:k}=i,B={options:{codecType:FU,password:Z,rawPassword:R,zipCrypto:v,encryptionStrength:l&&l.strength,signed:dl(o,i,"checkSignature")&&!E,passwordVerification:v&&(f.dataDescriptor?y>>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!E,encrypted:o.encrypted&&!E,useWebWorkers:dl(o,i,"useWebWorkers"),useCompressionStream:dl(o,i,"useCompressionStream"),transferStreams:dl(o,i,"transferStreams"),checkPasswordOnly:G},config:u,streamOptions:{signal:b,size:F,onstart:W,onprogress:A,onend:k}},O=0;try{({outputSize:O}=await MU({readable:N,writable:X},B))}catch(H){if(!G||H.message!=i0)throw H}finally{let H=dl(o,i,"preventClose");X.size+=O,!H&&!X.locked&&await X.getWriter().close()}return G?Ei:t.getData?t.getData():X}};function obe(e,t,n){let i=e.rawBitFlag=Ta(t,n+2),o=(i&1)==1,r=gs(t,n+6);Object.assign(e,{encrypted:o,version:Ta(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:nit(r),filenameLength:Ta(t,n+22),extraFieldLength:Ta(t,n+24)})}function rbe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=Sa(new Uint8Array(r)),l=0;try{for(;l<r.length;){let S=Ta(a,l),V=Ta(a,l+2);s.set(S,{type:S,data:r.slice(l+4,l+4+V)}),l+=4+V}}catch{}let d=Ta(n,i+4);Object.assign(t,{signature:gs(n,i+10),uncompressedSize:gs(n,i+18),compressedSize:gs(n,i+14)});let u=s.get(1);u&&(jnt(u,t),t.extraFieldZip64=u);let f=s.get(28789);f&&(ibe(f,bQ,yQ,t,e),t.extraFieldUnicodePath=f);let p=s.get(25461);p&&(ibe(p,gQ,xQ,t,e),t.extraFieldUnicodeComment=p);let y=s.get(39169);y?(qnt(y,t,d),t.extraFieldAES=y):t.compressionMethod=d;let h=s.get(10);h&&($nt(h,t),t.extraFieldNTFS=h);let g=s.get(21589);g&&(eit(g,t,o),t.extraFieldExtendedTimestamp=g);let x=s.get(6534);x&&(t.extraFieldUSDZ=x)}function jnt(e,t){t.zip64=!0;let n=Sa(e.data),i=Jnt.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 l=Qnt[a];t[s]=e[s]=l.getValue(n,r),r+=l.bytes}else if(e[s])throw new Error(Hnt)}}function ibe(e,t,n,i,o){let r=Sa(e.data),s=new n0;s.append(o[n]);let a=Sa(new Uint8Array(4));a.setUint32(0,s.get(),!0);let l=gs(r,1);Object.assign(e,{version:vV(r,0),[t]:lv(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==gs(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function qnt(e,t,n){let i=Sa(e.data),o=vV(i,4);Object.assign(e,{vendorVersion:vV(i,0),vendorId:vV(i,2),strength:o,originalCompressionMethod:n,compressionMethod:Ta(i,5)}),t.compressionMethod=e.compressionMethod}function $nt(e,t){let n=Sa(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=Ta(n,i),s=Ta(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=Sa(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});let d=IQ(s),u=IQ(a),f=IQ(l),p={lastModDate:d,lastAccessDate:u,creationDate:f};Object.assign(e,p),Object.assign(t,p)}}catch{}}function eit(e,t,n){let i=Sa(e.data),o=vV(i,0),r=[],s=[];n?((o&1)==1&&(r.push(PV),s.push(zU)),(o&2)==2&&(r.push(dv),s.push(jpe)),(o&4)==4&&(r.push(uv),s.push(qpe))):e.data.length>=5&&(r.push(PV),s.push(zU));let a=1;r.forEach((l,d)=>{if(e.data.length>=a+4){let u=gs(i,a);t[l]=e[l]=new Date(u*1e3);let f=s[d];e[f]=u}a+=4})}async function tit(e,t,n,i,o){let r=new Uint8Array(4),s=Sa(r);iit(s,0,t);let a=i+o;return await l(i)||await l(Math.min(a,n));async function l(d){let u=n-d,f=await Ua(e,u,d);for(let p=f.length-i;p>=0;p--)if(f[p]==r[0]&&f[p+1]==r[1]&&f[p+2]==r[2]&&f[p+3]==r[3])return{offset:u+p,buffer:f.slice(p,p+i).buffer}}}function dl(e,t,n){return t[n]===Ei?e.options[n]:t[n]}function nit(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 IQ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function vV(e,t){return e.getUint8(t)}function Ta(e,t){return e.getUint16(t,!0)}function gs(e,t){return e.getUint32(t,!0)}function JU(e,t){return Number(e.getBigUint64(t,!0))}function iit(e,t,n){e.setUint32(t,n,!0)}function Sa(e){return new DataView(e.buffer)}var U_i=_(T(),1);var ait="File already exists",cit="Zip file comment exceeds 64KB",lit="File entry comment exceeds 64KB",dit="File entry name exceeds 64KB",cbe="Version exceeds 65535",uit="The strength must equal 1, 2, or 3",mit="Extra field type exceeds 65535",fit="Extra field data exceeds 64KB",HQ="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",hit="Undefined uncompressed size",lbe=new Uint8Array([7,0,2,0,65,69,3,0,0]),BQ=0,dbe=[],rO=class{constructor(t,n={}){t=YU(t);let i=t.availableSize!==Ei&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Ei&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:ev(),files:new Map,filenames:new Set,offset:n.offset===Ei?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;BQ<s.maxWorkers?BQ++:await new Promise(l=>dbe.push(l));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(ait);return o.filenames.add(t),a=pit(o,t,n,i),r.add(a),await a}catch(l){throw o.filenames.delete(t),l}finally{r.delete(a);let l=dbe.shift();l?l():BQ--}}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 Vit(this,t,n),ho(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function pit(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(RV)?t+=RV:i.directory=t.endsWith(RV);let o=ho(e,i,"encodeText",EV),r=o(t);if(r===Ei&&(r=EV(t)),ji(r)>65535)throw new Error(dit);let s=i.comment||"",a=o(s);if(a===Ei&&(a=EV(s)),ji(a)>65535)throw new Error(lit);let l=ho(e,i,RQ,20);if(l>65535)throw new Error(cbe);let d=ho(e,i,GQ,20);if(d>65535)throw new Error(cbe);let u=ho(e,i,PV,new Date),f=ho(e,i,dv),p=ho(e,i,uv),y=ho(e,i,LQ,!0),h=ho(e,i,CQ,0),g=ho(e,i,VQ,0),x=ho(e,i,"passThrough"),S,V;x||(S=ho(e,i,"password"),V=ho(e,i,"rawPassword"));let Z=ho(e,i,"encryptionStrength",3),R=ho(e,i,EQ),E=ho(e,i,"extendedTimestamp",!0),I=ho(e,i,"keepOrder",!0),v=ho(e,i,"level"),P=ho(e,i,"useWebWorkers"),F=ho(e,i,"bufferedWrite"),N=ho(e,i,"dataDescriptorSignature",!1),b=ho(e,i,"signal"),G=ho(e,i,"useUnicodeFileNames",!0),X=ho(e,i,"useCompressionStream"),W=ho(e,i,"compressionMethod"),A=ho(e,i,"dataDescriptor",!0),k=ho(e,i,KU);if(!R&&(S!==Ei||V!==Ei)&&!(Z>=1&&Z<=3))throw new Error(uit);let B=new Uint8Array,{extraField:O}=i;if(O){let Xt=0,Ht=0;O.forEach(qe=>Xt+=4+ji(qe)),B=new Uint8Array(Xt),O.forEach((qe,mn)=>{if(mn>65535)throw new Error(mit);if(ji(qe)>65535)throw new Error(fit);Xs(B,new Uint16Array([mn]),Ht),Xs(B,new Uint16Array([ji(qe)]),Ht+2),Xs(B,qe,Ht+4),Ht+=4+ji(qe)})}let H=0,U=0,K=0;if(x&&({uncompressedSize:K}=i,K===Ei))throw new Error(hit);let Q=k===!0;n&&(n=BU(n),await Bh(n),x?H=ube(K):n.size===Ei?(A=!0,(k||k===Ei)&&(k=!0,K=H=4294967296)):(K=n.size,H=ube(K)));let{diskOffset:ie,diskNumber:j,maxSize:$}=e.writer,ne=Q||K>4294967295,be=Q||H>4294967295,Ce=Q||e.offset+e.pendingEntriesSize-ie>4294967295,_e=ho(e,i,"supportZip64SplitFile",!0)&&Q||j+Math.ceil(e.pendingEntriesSize/$)>65535;if(Ce||ne||be||_e){if(k===!1||!I)throw new Error(HQ);k=!0}k=k||!1;let Ve=ho(e,i,ZQ),{signature:Ie}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:l,versionMadeBy:d,lastModDate:u,lastAccessDate:f,creationDate:p,rawExtraField:B,zip64:k,zip64UncompressedSize:ne,zip64CompressedSize:be,zip64Offset:Ce,zip64DiskNumberStart:_e,password:S,rawPassword:V,level:!X&&e.config.CompressionStream===Ei&&e.config.CompressionStreamNative===Ei?0:v,useWebWorkers:P,encryptionStrength:Z,extendedTimestamp:E,zipCrypto:R,bufferedWrite:F,keepOrder:I,useUnicodeFileNames:G,dataDescriptor:A,dataDescriptorSignature:N,signal:b,msDosCompatible:y,internalFileAttribute:h,externalFileAttribute:g,useCompressionStream:X,passThrough:x,encrypted:!!(S&&ji(S)||V&&ji(V))||x&&Ve,signature:Ie,compressionMethod:W});let Ze=git(i),De=_it(i),Ke=ji(Ze.localHeaderArray,De.dataDescriptorArray);U=Ke+H,e.options.usdz&&(U+=U+64),e.pendingEntriesSize+=U;let rt;try{rt=await bit(e,t,n,{headerInfo:Ze,dataDescriptorInfo:De,metadataSize:Ke},i)}finally{e.pendingEntriesSize-=U}return Object.assign(rt,{name:t,comment:s,extraField:O}),new bg(rt)}async function bit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:l,signal:d}=o,{headerInfo:u}=i,{usdz:f}=e.options,p=Array.from(r.values()).pop(),y={},h,g,x,S,V,Z,R;r.set(t,y);try{let P;a&&(P=p&&p.lock,E()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!l)&&!f?(Z=new TransformStream,R=new Response(Z.readable).blob(),Z.writable.size=0,h=!0,e.bufferedWrites++,await Bh(s)):(Z=s,await I()),await Bh(Z);let{writable:F}=s,{diskOffset:N}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let G=new Uint8Array(4),X=Oa(G);Qi(X,0,134695760),await Yh(F,G),e.offset+=4}f&&xit(i,e.offset-N),h||(await P,await v(F));let{diskNumber:b}=s;if(V=!0,y.diskNumberStart=b,y=await yit(n,Z,y,i,e.config,o),V=!1,r.set(t,y),y.filename=t,h){await Z.writable.getWriter().close();let G=await R;await P,await I(),S=!0,l||(G=await Sit(y,G,F,o)),await v(F),y.diskNumberStart=s.diskNumber,N=s.diskOffset,await G.stream().pipeTo(F,{preventClose:!0,preventAbort:!0,signal:d}),F.size+=G.size,S=!1}if(y.offset=e.offset-N,y.zip64)Cit(y,o);else if(y.offset>4294967295)throw new Error(HQ);return e.offset+=y.size,y}catch(P){if(h&&S||!h&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}h?e.offset+=Z.writable.size:e.offset=Z.writable.size}throw r.delete(t),P}finally{h&&e.bufferedWrites--,x&&x(),g&&g()}function E(){y.lock=new Promise(P=>x=P)}async function I(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(F=>g=()=>{e.writerLocked=!1,F()}),await P}async function v(P){ji(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Yh(P,new Uint8Array))}}async function yit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:l,metadataSize:d}=o,{localHeaderArray:u,headerArray:f,lastModDate:p,rawLastModDate:y,encrypted:h,compressed:g,version:x,compressionMethod:S,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:Z,rawExtraFieldNTFS:R,rawExtraFieldAES:E}=a,{dataDescriptorArray:I}=l,{rawFilename:v,lastAccessDate:P,creationDate:F,password:N,rawPassword:b,level:G,zip64:X,zip64UncompressedSize:W,zip64CompressedSize:A,zip64Offset:k,zip64DiskNumberStart:B,zipCrypto:O,dataDescriptor:H,directory:U,versionMadeBy:K,rawComment:Q,rawExtraField:ie,useWebWorkers:j,onstart:$,onprogress:ne,onend:be,signal:Ce,encryptionStrength:me,extendedTimestamp:_e,msDosCompatible:Ve,internalFileAttribute:Ie,externalFileAttribute:Ze,useCompressionStream:De,passThrough:Ke}=s,rt={lock:i,versionMadeBy:K,zip64:X,directory:!!U,filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:Q,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:R,rawExtraFieldAES:E,rawExtraField:ie,extendedTimestamp:_e,msDosCompatible:Ve,internalFileAttribute:Ie,externalFileAttribute:Ze,diskNumberStart:n},{signature:Xt,uncompressedSize:Ht}=s,qe=0;Ke||(Ht=0);let{writable:mn}=t;if(e){e.chunkSize=VU(r),await Yh(mn,u);let Lt=e.readable,Vi=Lt.size=e.size,ln={options:{codecType:vU,level:G,rawPassword:b,password:N,encryptionStrength:me,zipCrypto:h&&O,passwordVerification:h&&O&&y>>8&255,signed:!Ke,compressed:g&&!Ke,encrypted:h&&!Ke,useWebWorkers:j,useCompressionStream:De,transferStreams:!1},config:r,streamOptions:{signal:Ce,size:Vi,onstart:$,onprogress:ne,onend:be}},ge=await MU({readable:Lt,writable:mn},ln);qe=ge.outputSize,Ke||(Ht=ge.inputSize,Xt=ge.signature),mn.size+=Ht}else await Yh(mn,u);let Dt;if(X){let Lt=4;W&&(Lt+=8),A&&(Lt+=8),k&&(Lt+=8),B&&(Lt+=4),Dt=new Uint8Array(Lt)}else Dt=new Uint8Array;return Tit({signature:Xt,rawExtraFieldZip64:Dt,compressedSize:qe,uncompressedSize:Ht,headerInfo:a,dataDescriptorInfo:l},s),H&&await Yh(mn,I),Object.assign(rt,{uncompressedSize:Ht,compressedSize:qe,lastModDate:p,rawLastModDate:y,creationDate:F,lastAccessDate:P,encrypted:h,zipCrypto:O,size:d+qe,compressionMethod:S,version:x,headerArray:f,signature:Xt,rawExtraFieldZip64:Dt,extraFieldExtendedTimestampFlag:Z,zip64UncompressedSize:W,zip64CompressedSize:A,zip64Offset:k,zip64DiskNumberStart:B}),rt}function git(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:l,dataDescriptor:d,directory:u,rawExtraField:f,encryptionStrength:p,extendedTimestamp:y,encrypted:h}=e,{version:g,compressionMethod:x}=e,S=!u&&(r>0||r===Ei&&x!==0),V;if(h&&!a){V=new Uint8Array(ji(lbe)+2);let k=Oa(V);io(k,0,39169),Xs(V,lbe,2),sO(k,8,p)}else V=new Uint8Array;let Z,R,E;if(y){R=new Uint8Array(9+(i?4:0)+(o?4:0));let k=Oa(R);io(k,0,21589),io(k,2,ji(R)-4),E=1+(i?2:0)+(o?4:0),sO(k,4,E);let B=5;Qi(k,B,Math.floor(n.getTime()/1e3)),B+=4,i&&(Qi(k,B,Math.floor(i.getTime()/1e3)),B+=4),o&&Qi(k,B,Math.floor(o.getTime()/1e3));try{Z=new Uint8Array(36);let O=Oa(Z),H=YQ(n);io(O,0,10),io(O,2,32),io(O,8,1),io(O,10,24),Kl(O,12,H),Kl(O,20,YQ(i)||H),Kl(O,28,YQ(o)||H)}catch{Z=new Uint8Array}}else Z=R=new Uint8Array;let I=0;l&&(I=I|2048),d&&(I=I|8),x===Ei&&(x=S?8:0),x==8&&(r>=1&&r<3&&(I=I|6),r>=3&&r<5&&(I=I|1),r===9&&(I=I|2)),s&&(g=g>45?g:45),h&&(I=I|1,a||(g=g>51?g:51,V[9]=x,x=99));let v=new Uint8Array(26),P=Oa(v);io(P,0,g),io(P,2,I),io(P,4,x);let F=new Uint32Array(1),N=Oa(F),b;n<nQ?b=nQ:n>tQ?b=tQ:b=n,io(N,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),io(N,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let G=F[0];Qi(P,6,G),io(P,22,ji(t));let X=ji(V,R,Z,f);io(P,24,X);let W=new Uint8Array(30+ji(t)+X),A=Oa(W);return Qi(A,0,67324752),Xs(W,v,4),Xs(W,t,30),Xs(W,V,30+ji(t)),Xs(W,R,30+ji(t,V)),Xs(W,Z,30+ji(t,V,R)),Xs(W,f,30+ji(t,V,R,Z)),{localHeaderArray:W,headerArray:v,headerView:P,lastModDate:n,rawLastModDate:G,encrypted:h,compressed:S,version:g,compressionMethod:x,extraFieldExtendedTimestampFlag:E,rawExtraFieldExtendedTimestamp:R,rawExtraFieldNTFS:Z,rawExtraFieldAES:V,extraFieldLength:X}}function xit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Oa(i),s=64-(t+ji(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),l=Oa(a);io(l,0,6534),io(l,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(ji(d)+s),Xs(i,d),Xs(i,a,ji(d)),r=Oa(i),io(r,28,o+s),e.metadataSize+=s}function _it(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Oa(o),i&&(s=4,Qi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function Tit(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:l,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:f}=a,{zip64:p,zip64UncompressedSize:y,zip64CompressedSize:h,zipCrypto:g,dataDescriptor:x}=t;if((!d||g)&&n!==Ei&&(Qi(l,10,n),x&&Qi(u,f,n)),p){let S=Oa(i);io(S,0,1),io(S,2,ji(i)-4);let V=4;y&&(Qi(l,18,4294967295),Kl(S,V,BigInt(r)),V+=8),h&&(Qi(l,14,4294967295),Kl(S,V,BigInt(o))),x&&(Kl(u,f+4,BigInt(o)),Kl(u,f+12,BigInt(r)))}else Qi(l,14,o),Qi(l,18,r),x&&(Qi(u,f+4,o),Qi(u,f+8,r))}async function Sit(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&Qi(r,14,e.signature),e.zip64?(Qi(r,18,4294967295),Qi(r,22,4294967295)):(Qi(r,18,e.compressedSize),Qi(r,22,e.uncompressedSize)),await Yh(n,new Uint8Array(o)),t.slice(o.byteLength)}function Cit(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:l}=t,d=Oa(n),u=4;r&&(u+=8),s&&(u+=8),a&&(Kl(d,u,BigInt(i)),u+=8),l&&Qi(d,u,o)}async function Vit(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,l=0,d=0,u=e.offset-r,f=i.size;for(let[,E]of i){let{rawFilename:I,rawExtraFieldZip64:v,rawExtraFieldAES:P,rawComment:F,rawExtraFieldNTFS:N,rawExtraField:b,extendedTimestamp:G,extraFieldExtendedTimestampFlag:X,lastModDate:W}=E,A;if(G){A=new Uint8Array(9);let k=Oa(A);io(k,0,21589),io(k,2,5),sO(k,4,X),Qi(k,5,Math.floor(W.getTime()/1e3))}else A=new Uint8Array;E.rawExtraFieldCDExtendedTimestamp=A,d+=46+ji(I,F,v,P,N,A,b)}let p=new Uint8Array(d),y=Oa(p);await Bh(o);let h=0;for(let[E,I]of Array.from(i.values()).entries()){let{offset:v,rawFilename:P,rawExtraFieldZip64:F,rawExtraFieldAES:N,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:G,rawExtraField:X,rawComment:W,versionMadeBy:A,headerArray:k,directory:B,zip64:O,zip64UncompressedSize:H,zip64CompressedSize:U,zip64DiskNumberStart:K,zip64Offset:Q,msDosCompatible:ie,internalFileAttribute:j,externalFileAttribute:$,diskNumberStart:ne,uncompressedSize:be,compressedSize:Ce}=I,me=ji(F,N,b,G,X);Qi(y,l,33639248),io(y,l+4,A);let _e=Oa(k);H||Qi(_e,18,be),U||Qi(_e,14,Ce),Xs(p,k,l+6),io(y,l+30,me),io(y,l+32,ji(W)),io(y,l+34,O&&K?65535:ne),io(y,l+36,j),$?Qi(y,l+38,$):B&&ie&&sO(y,l+38,16),Qi(y,l+42,O&&Q?4294967295:v),Xs(p,P,l+46),Xs(p,F,l+46+ji(P)),Xs(p,N,l+46+ji(P,F)),Xs(p,b,l+46+ji(P,F,N)),Xs(p,G,l+46+ji(P,F,N,b)),Xs(p,X,l+46+ji(P,F,N,b,G)),Xs(p,W,l+46+ji(P)+me);let Ve=46+ji(P,W)+me;if(l-h>o.availableSize&&(o.availableSize=0,await Yh(s,p.slice(h,l)),h=l),l+=Ve,n.onprogress)try{await n.onprogress(E+1,i.size,new bg(I))}catch{}}await Yh(s,h?p.slice(h):p);let g=o.diskNumber,{availableSize:x}=o;x<22&&g++;let S=ho(e,n,KU);if(u>4294967295||d>4294967295||f>65535||g>65535){if(S===!1)throw new Error(HQ);S=!0}let V=new Uint8Array(S?98:22),Z=Oa(V);l=0,S&&(Qi(Z,0,101075792),Kl(Z,4,BigInt(44)),io(Z,12,45),io(Z,14,45),Qi(Z,16,g),Qi(Z,20,a),Kl(Z,24,BigInt(f)),Kl(Z,32,BigInt(f)),Kl(Z,40,BigInt(d)),Kl(Z,48,BigInt(u)),Qi(Z,56,117853008),Kl(Z,64,BigInt(u)+BigInt(d)),Qi(Z,72,g+1),ho(e,n,"supportZip64SplitFile",!0)&&(g=65535,a=65535),f=65535,u=4294967295,d=4294967295,l+=76),Qi(Z,l,101010256),io(Z,l+4,g),io(Z,l+6,a),io(Z,l+8,f),io(Z,l+10,f),Qi(Z,l+12,d),Qi(Z,l+16,u);let R=ji(t);if(R)if(R<=65535)io(Z,l+20,R);else throw new Error(cit);await Yh(s,V),R&&await Yh(s,t)}async function Yh(e,t){let n=e.getWriter();try{await n.ready,e.size+=ji(t),await n.write(t)}finally{n.releaseLock()}}function YQ(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ho(e,t,n,i){let o=t[n]===Ei?e.options[n]:t[n];return o===Ei?i:o}function ube(e){return e+5*(Math.floor(e/16383)+1)}function sO(e,t,n){e.setUint8(t,n)}function io(e,t,n){e.setUint16(t,n,!0)}function Qi(e,t,n){e.setUint32(t,n,!0)}function Kl(e,t,n){e.setBigUint64(t,n,!0)}function Xs(e,t,n){e.set(t,n)}function Oa(e){return new DataView(e.buffer)}function ji(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}GV({Deflate:Jhe,Inflate:ype});var zQ=32,Lit="http://www.opengis.net/kml/2.2",Wf="http://www.google.com/kml/ext/2.2",Zit="http://www.w3.org/2000/xmlns/";function aO(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Rit=/^data:image\/([^,;]+)/;aO.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ge){if(e=Ge.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Rit);n=`texture_${++this._count}`,c(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 Git(e,t){return function(n){e._files[t]=n}}aO.prototype.model=function(e,t){let n=this._modelCallback;if(!c(n))throw new le("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(Git(this,r))}return o};Object.defineProperties(aO.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function cO(e){this._time=e}cO.prototype.get=function(e,t,n){let i;return c(e)&&(i=c(e.getValue)?e.getValue(this._time,n):e),i??t};cO.prototype.getColor=function(e,t){let n=this.get(e,t);if(c(n))return RT(n)};cO.prototype.getMaterialType=function(e){if(c(e))return e.getType(this._time)};function KQ(){this._ids={},this._styles={},this._count=0}KQ.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(c(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};KQ.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 pbe(){this._ids={}}pbe.prototype.get=function(e){if(!c(e))return this.get(Hn());let t=this._ids;return c(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function JQ(e){e=e??z.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1;if(!c(t))throw new L("entities is required.");let i=JQ._createState(e),o=t.values.filter(function(d){return!c(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Zit,"xmlns:gx",Wf);let a=r.createElement("Document");s.appendChild(a),ybe(i,a,o),i.styleCache.save(a);let l=i.externalFileHandler;return l.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?Eit(u,l.files):{kml:u,externalFiles:l.files}})}function Eit(e,t){let n=on("ThirdParty/Workers/z-worker-pako.js");GV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new cv,o=new rO(i);return o.add("doc.kml",new UU(e)).then(function(){let r=Object.keys(t);return bbe(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function bbe(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new o0(n[o])).then(function(){return bbe(e,t,n,i+1)})}JQ._createState=function(e){let t=e.entities,n=new KQ,i=t.computeAvailability(),o=c(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ye.MINIMUM_VALUE?r.stop===Ye.MAXIMUM_VALUE?r=new Zn:ee.addSeconds(r.stop,-10*s,r.start):r.stop===Ye.MAXIMUM_VALUE&&ee.addSeconds(r.start,10*s,r.stop);let a=new aO(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Lit,"kml"),ellipsoid:e.ellipsoid??re.default,idManager:new pbe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new cO(o),sampleDuration:s,defaultAvailability:new Yr([r])}};function ybe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,l,d,u;for(let f=0;f<a;++f){let p=n[f];l=[],d=[],u=[],Xit(e,p,d,u),Iit(e,p.polyline,d,u),hbe(e,p.rectangle,d,u,l),hbe(e,p.polygon,d,u,l),vit(e,p,p.model,d,u);let y,h=p.availability;c(h)&&(y=i.createElement("TimeSpan"),ee.equals(h.start,Ye.MINIMUM_VALUE)||y.appendChild(hn(i,"begin",ee.toIso8601(h.start))),ee.equals(h.stop,Ye.MAXIMUM_VALUE)||y.appendChild(hn(i,"end",ee.toIso8601(h.stop))));for(let S=0;S<l.length;++S){let V=l[S];V.setAttribute("id",s.get(p.id)),V.appendChild(hn(i,"name",p.name)),V.appendChild(hn(i,"visibility",p.show)),V.appendChild(hn(i,"description",p.description)),c(y)&&V.appendChild(y),t.appendChild(V)}let g=d.length;if(g>0){let S=i.createElement("Placemark");S.setAttribute("id",s.get(p.id));let V=p.name,Z=p.label;if(c(Z)){let E=i.createElement("LabelStyle"),I=r.get(Z.text);V=c(I)&&I.length>0?I:V;let v=r.getColor(Z.fillColor);c(v)&&(E.appendChild(hn(i,"color",v)),E.appendChild(hn(i,"colorMode","normal")));let P=r.get(Z.scale);c(P)&&E.appendChild(hn(i,"scale",P)),u.push(E)}S.appendChild(hn(i,"name",V)),S.appendChild(hn(i,"visibility",p.show)),S.appendChild(hn(i,"description",p.description)),c(y)&&S.appendChild(y),t.appendChild(S);let R=u.length;if(R>0){let E=i.createElement("Style");for(let I=0;I<R;++I)E.appendChild(u[I]);S.appendChild(hn(i,"styleUrl",o.get(E)))}if(d.length===1)S.appendChild(d[0]);else if(d.length>1){let E=i.createElement("MultiGeometry");for(let I=0;I<g;++I)E.appendChild(d[I]);S.appendChild(E)}}let x=p._children;if(x.length>0){let S=i.createElement("Folder");S.setAttribute("id",s.get(p.id)),S.appendChild(hn(i,"name",p.name)),S.appendChild(hn(i,"visibility",p.show)),S.appendChild(hn(i,"description",p.description)),t.appendChild(S),ybe(e,S,x)}}}var Jl=new m,ul=new pe,If=new ee;function Xit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!c(a)&&!c(t.path))return;let l=t.position;if(!l.isConstant){gbe(e,t,a,n,i);return}s.get(l,void 0,Jl);let d=hn(o,"coordinates",ZT(Jl,r)),u=o.createElement("Point"),f=o.createElement("altitudeMode");f.appendChild(GT(e,a.heightReference)),u.appendChild(f),u.appendChild(d),n.push(u);let p=a instanceof cc?_be(e,a):xbe(e,a);i.push(p)}function gbe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,l,d=t.position,u=!0;d instanceof ya?(l=d.intervals,u=!1):l=t.availability??e.defaultAvailability;let f=n instanceof Up,p,y,h,g=[];for(p=0;p<l.length;++p){let S=l.get(p),V=u?d:S.data,Z=r.createElement("altitudeMode");V instanceof Mh?(V=V._value,Z.appendChild(GT(e,ze.CLAMP_TO_GROUND))):c(n)?Z.appendChild(GT(e,n.heightReference)):Z.appendChild(GT(e,ze.NONE));let R=[],E=[];if(V.isConstant){a.get(V,void 0,Jl);let v=hn(r,"coordinates",ZT(Jl,s));R.push(ee.toIso8601(S.start)),E.push(v),R.push(ee.toIso8601(S.stop)),E.push(v)}else if(V instanceof xa)for(h=V._property._times,y=0;y<h.length;++y)R.push(ee.toIso8601(h[y])),V.getValueInReferenceFrame(h[y],Ui.FIXED,Jl),E.push(ZT(Jl,s));else if(V instanceof Fd){h=V._times;let v=V._values;for(y=0;y<h.length;++y)R.push(ee.toIso8601(h[y])),m.fromArray(v,y*3,Jl),E.push(ZT(Jl,s))}else{let v=e.sampleDuration;S.start.clone(If),S.isStartIncluded||ee.addSeconds(If,v,If);let P=S.stop;for(;ee.lessThan(If,P);)V.getValue(If,Jl),R.push(ee.toIso8601(If)),E.push(ZT(Jl,s)),ee.addSeconds(If,v,If);S.isStopIncluded&&ee.equals(If,P)&&(V.getValue(If,Jl),R.push(ee.toIso8601(If)),E.push(ZT(Jl,s)))}let I=r.createElementNS(Wf,"Track");I.appendChild(Z);for(let v=0;v<R.length;++v){let P=hn(r,"when",R[v]),F=hn(r,"coord",E[v],Wf);I.appendChild(P),I.appendChild(F)}f&&I.appendChild(Tbe(e,n)),g.push(I)}if(g.length===1)i.push(g[0]);else if(g.length>1){let S=r.createElementNS(Wf,"MultiTrack");for(p=0;p<g.length;++p)S.appendChild(g[p]);i.push(S)}if(c(n)&&!f){let S=n instanceof cc?_be(e,n):xbe(e,n);o.push(S)}let x=t.path;if(c(x)){let S=a.get(x.width),V=x.material;if(c(V)||c(S)){let Z=r.createElement("LineStyle");c(S)&&Z.appendChild(hn(r,"width",S)),QQ(e,V,Z),o.push(Z)}}}function xbe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);c(r)&&(o.appendChild(hn(n,"color",r)),o.appendChild(hn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return c(s)&&o.appendChild(hn(n,"scale",s/zQ)),o}function _be(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(c(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(hn(n,"href",s));let y=i.get(t.imageSubRegion);c(y)&&(p.appendChild(hn(n,"x",y.x,Wf)),p.appendChild(hn(n,"y",y.y,Wf)),p.appendChild(hn(n,"w",y.width,Wf)),p.appendChild(hn(n,"h",y.height,Wf))),r.appendChild(p)}let a=i.getColor(t.color);c(a)&&(r.appendChild(hn(n,"color",a)),r.appendChild(hn(n,"colorMode","normal")));let l=i.get(t.scale);c(l)&&r.appendChild(hn(n,"scale",l));let d=i.get(t.pixelOffset);if(c(d)){l=l??1,D.divideByScalar(d,l,d);let p=i.get(t.width,zQ),y=i.get(t.height,zQ),h=i.get(t.horizontalOrigin,xi.CENTER);h===xi.CENTER?d.x-=p*.5:h===xi.RIGHT&&(d.x-=p);let g=i.get(t.verticalOrigin,Mn.CENTER);g===Mn.TOP?d.y+=y:g===Mn.CENTER&&(d.y+=y*.5);let x=n.createElement("hotSpot");x.setAttribute("x",-d.x),x.setAttribute("y",d.y),x.setAttribute("xunits","pixels"),x.setAttribute("yunits","pixels"),r.appendChild(x)}let u=i.get(t.rotation),f=i.get(t.alignedAxis);return c(u)&&m.equals(m.UNIT_Z,f)&&(u=w.toDegrees(-u),u===0&&(u=360),r.appendChild(hn(n,"heading",u))),r}function Iit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!c(t))return;let a=o.createElement("LineString"),l=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(hn(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),l.appendChild(u),a.appendChild(l);let f=t.positions,p=s.get(f),y=hn(o,"coordinates",ZT(p,r));a.appendChild(y);let h=s.get(t.zIndex);d&&c(h)&&a.appendChild(hn(o,"drawOrder",h,Wf)),n.push(a);let g=o.createElement("LineStyle"),x=s.get(t.width);c(x)&&g.appendChild(hn(o,"width",x)),QQ(e,t.material,g),i.push(g)}function Wit(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),l=[],d=[de.northeast,de.southeast,de.southwest,de.northwest];for(let y=0;y<4;++y)d[y](a,ul),l.push(`${w.toDegrees(ul.longitude)},${w.toDegrees(ul.latitude)},${r}`);let u=hn(i,"coordinates",l.join(" ")),f=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),f.appendChild(p),[f]}function fbe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)pe.fromCartesian(t[u],r,ul),s.push(`${w.toDegrees(ul.longitude)},${w.toDegrees(ul.latitude)},${i?ul.height:n}`);let l=hn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(l),d}function wit(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=[],l=t.hierarchy,d=o.get(l),u=Array.isArray(d)?d:d.positions,f=i.createElement("outerBoundaryIs");f.appendChild(fbe(e,u,r,s)),a.push(f);let p=d.holes;if(c(p)){let y=p.length;for(let h=0;h<y;++h){let g=i.createElement("innerBoundaryIs");g.appendChild(fbe(e,p[h].positions,r,s)),a.push(g)}}return a}function hbe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!c(t))return;let a=t instanceof Um;if(a&&s.getMaterialType(t.material)==="Image"){Pit(e,t,o);return}let l=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&l.appendChild(hn(r,"extrude",!0));let u=a?Wit(e,t,d):wit(e,t,d),f=u.length;for(let x=0;x<f;++x)l.appendChild(u[x]);let p=r.createElement("altitudeMode");p.appendChild(GT(e,t.heightReference)),l.appendChild(p),n.push(l);let y=r.createElement("PolyStyle"),h=s.get(t.fill,!1);h&&y.appendChild(hn(r,"fill",h)),QQ(e,t.material,y);let g=s.get(t.outline,!1);if(g){y.appendChild(hn(r,"outline",g));let x=r.createElement("LineStyle"),S=s.get(t.outlineWidth,1);x.appendChild(hn(r,"width",S));let V=s.getColor(t.outlineColor,Y.BLACK);x.appendChild(hn(r,"color",V)),x.appendChild(hn(r,"colorMode","normal")),i.push(x)}i.push(y)}function Pit(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(GT(e,t.heightReference)),s.appendChild(a);let l=o.get(t.height);c(l)&&s.appendChild(hn(i,"altitude",l));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(hn(i,"north",w.toDegrees(d.north))),u.appendChild(hn(i,"south",w.toDegrees(d.south))),u.appendChild(hn(i,"east",w.toDegrees(d.east))),u.appendChild(hn(i,"west",w.toDegrees(d.west))),s.appendChild(u);let f=o.get(t.material),p=r.texture(f.image),y=i.createElement("Icon");y.appendChild(hn(i,"href",p)),s.appendChild(y);let h=f.color;c(h)&&s.appendChild(hn(i,"color",RT(f.color))),n.push(s)}function Tbe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(c(s)){let d=n.createElement("scale");d.appendChild(hn(n,"x",s)),d.appendChild(hn(n,"y",s)),d.appendChild(hn(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),l=o.model(t,e.time);return a.appendChild(hn(n,"href",l)),r.appendChild(a),r}function vit(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!c(n))return;let l=t.position;if(!l.isConstant){gbe(e,t,n,i,o);return}let d=Tbe(e,n),u=r.createElement("altitudeMode");u.appendChild(GT(e,n.heightReference)),d.appendChild(u),a.get(l,void 0,Jl),pe.fromCartesian(Jl,s,ul);let f=r.createElement("Location");f.appendChild(hn(r,"longitude",w.toDegrees(ul.longitude))),f.appendChild(hn(r,"latitude",w.toDegrees(ul.latitude))),f.appendChild(hn(r,"altitude",ul.height)),d.appendChild(f),i.push(d)}function QQ(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!c(t))return;let r=o.get(t);if(!c(r))return;let s,a=o.getMaterialType(t),l,d;switch(a){case"Image":s=RT(Y.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=RT(r.color);break;case"PolylineOutline":s=RT(r.color),l=RT(r.outlineColor),d=r.outlineWidth,n.appendChild(hn(i,"outerColor",l,Wf)),n.appendChild(hn(i,"outerWidth",d,Wf));break;case"Stripe":s=RT(r.oddColor);break}c(s)&&(n.appendChild(hn(i,"color",s)),n.appendChild(hn(i,"colorMode","normal")))}function GT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,ze.NONE),r;switch(o){case ze.NONE:r=n.createTextNode("absolute");break;case ze.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case ze.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function ZT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,ul),i.push(`${w.toDegrees(ul.longitude)},${w.toDegrees(ul.latitude)},${ul.height}`);return i.join(" ")}function hn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=c(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 RT(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 jQ=JQ;var lCi=_(T(),1);var ATi=_(T(),1);function pv(){this._cache={}}pv.prototype.fromColor=function(e,t){if(!c(e))throw new L("color is required");if(!c(t))throw new L("size is required");return lO(void 0,void 0,e,t,this._cache)};pv.prototype.fromUrl=function(e,t,n){if(!c(e))throw new L("url is required");if(!c(t))throw new L("color is required");if(!c(n))throw new L("size is required");return lO(e,void 0,t,n,this._cache)};pv.prototype.fromMakiIconId=function(e,t,n){if(!c(e))throw new L("id is required");if(!c(t))throw new L("color is required");if(!c(n))throw new L("size is required");return lO(on(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};pv.prototype.fromText=function(e,t,n){if(!c(e))throw new L("text is required");if(!c(t))throw new L("color is required");if(!c(n))throw new L("size is required");return lO(void 0,e,t,n,this._cache)};var Fit=new Y;function Ait(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Fit).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function Sbe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=Y.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=Y.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var hv=new Array(4);function lO(e,t,n,i,o){hv[0]=e,hv[1]=t,hv[2]=n,hv[3]=i;let r=JSON.stringify(hv),s=o[r];if(c(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let l=a.getContext("2d");if(Ait(l,n,i),c(e)){let u=Ge.createIfNeeded(e).fetchImage().then(function(f){return Sbe(l,f,i),o[r]=a,a});return o[r]=u,u}else if(c(t)){let d=v_(t,{font:`bold ${i}px sans-serif`});Sbe(l,d,i)}return o[r]=a,a}var r0=pv;var RSi=_(T());var YTi=_(T());var OTi=_(T());var NTi=_(T());function qQ(e){return e}function dO(e){if(e==null)return qQ;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var d=2,u=a.length,f=new Array(u);for(f[0]=(t+=a[0])*i+r,f[1]=(n+=a[1])*o+s;d<u;)f[d]=a[d],++d;return f}}var jTi=_(T());var zTi=_(T());function Cbe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function $Q(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Vbe(e,n)})}:Vbe(e,t)}function Vbe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=ej(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function ej(e,t){var n=dO(e.transform),i=e.arcs;function o(u,f){f.length&&f.pop();for(var p=i[u<0?~u:u],y=0,h=p.length;y<h;++y)f.push(n(p[y],y));u<0&&Cbe(f,h)}function r(u){return n(u)}function s(u){for(var f=[],p=0,y=u.length;p<y;++p)o(u[p],f);return f.length<2&&f.push(f[0]),f}function a(u){for(var f=s(u);f.length<4;)f.push(f[0]);return f}function l(u){return u.map(a)}function d(u){var f=u.type,p;switch(f){case"GeometryCollection":return{type:f,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=l(u.arcs);break;case"MultiPolygon":p=u.arcs.map(l);break;default:return null}return{type:f,coordinates:p}}return d(t)}var iSi=_(T());var $Ti=_(T());var aSi=_(T());var fSi=_(T());var lSi=_(T());var _Si=_(T());var bSi=_(T());function uO(e){return m.fromDegrees(e[0],e[1],e[2])}var tj={"urn:ogc:def:crs:OGC:1.3:CRS84":uO,"EPSG:4326":uO,"urn:ogc:def:crs:EPSG::4326":uO},Lbe={},Zbe={},nj=48,ij,oj=Y.ROYALBLUE,rj=Y.YELLOW,sj=2,aj=Y.fromBytes(255,255,0,100),cj=!1,Oit={small:24,medium:48,large:64},Dit=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Rbe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Dit.indexOf(i)!==-1)continue;let o=e[i];c(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Rbe(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 Bit(e,t,n){let i;return function(o,r){return c(i)||(i=e(t,n)),i}}function Yit(e,t){return new Om(Bit(Rbe,e,t),!0)}function mO(e,t,n){let i=e.id;if(!c(i)||e.type!=="Feature")i=Hn();else{let s=2,a=i;for(;c(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(c(r)){o.properties=r;let s,a=r.title;if(c(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let f=u.toLowerCase();if(d>1&&f==="title"){d=1,s=u;break}else d>2&&f==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}c(s)&&(o.name=r[s])}let l=r.description;l!==null&&(o.description=c(l)?new Qn(l):n(r,s))}return o}function lj(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Gbe={Feature:Xbe,FeatureCollection:Hit,GeometryCollection:Ibe,LineString:Fbe,MultiLineString:Abe,MultiPoint:Pbe,MultiPolygon:kbe,Point:wbe,Polygon:Nbe,Topology:Ube},Ebe={GeometryCollection:Ibe,LineString:Fbe,MultiLineString:Abe,MultiPoint:Pbe,MultiPolygon:kbe,Point:wbe,Polygon:Nbe,Topology:Ube};function Xbe(e,t,n,i,o){if(t.geometry===null){mO(t,e._entityCollection,o.describe);return}if(!c(t.geometry))throw new le("feature.geometry is required.");let r=t.geometry.type,s=Ebe[r];if(!c(s))throw new le(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Hit(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Xbe(e,r[s],void 0,i,o)}function Ibe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let l=r[s],d=l.type,u=Ebe[d];if(!c(u))throw new le(`Unknown geometry type: ${d}`);u(e,t,l,i,o)}}function Wbe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,l=t.properties;if(c(l)){let y=l["marker-color"];c(y)&&(s=Y.fromCssColorString(y)),a=Oit[l["marker-size"]]??a;let h=l["marker-symbol"];c(h)&&(r=h)}let d;c(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new cc;u.verticalOrigin=new Qn(Mn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=ze.CLAMP_TO_GROUND);let f=mO(t,e._entityCollection,o.describe);f.billboard=u,f.position=new Oc(n(i));let p=Promise.resolve(d).then(function(y){u.image=new Qn(y)}).catch(function(){u.image=new Qn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function wbe(e,t,n,i,o){Wbe(e,t,i,n.coordinates,o)}function Pbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Wbe(e,t,i,r[s],o)}function vbe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(c(a)){let u=a["stroke-width"];c(u)&&(s=new Qn(u));let f,p=a.stroke;c(p)&&(f=Y.fromCssColorString(p));let y=a["stroke-opacity"];c(y)&&y!==1&&(c(f)||(f=r.color.getValue().clone()),f.alpha=y),c(f)&&(r=new Ut(f))}let l=mO(t,e._entityCollection,o.describe),d=new uc;l.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new Qn(lj(i,n)),d.arcType=Kt.RHUMB}function Fbe(e,t,n,i,o){vbe(e,t,i,n.coordinates,o)}function Abe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)vbe(e,t,i,r[s],o)}function Mbe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,l=t.properties;if(c(l)){let y=l["stroke-width"];c(y)&&(a=new Qn(y));let h,g=l.stroke;c(g)&&(h=Y.fromCssColorString(g));let x=l["stroke-opacity"];c(x)&&x!==1&&(c(h)||(h=r.getValue().clone()),h.alpha=x),c(h)&&(r=new Qn(h));let S,V=l.fill,Z=s.color.getValue();c(V)&&(S=Y.fromCssColorString(V),S.alpha=Z.alpha),x=l["fill-opacity"],c(x)&&x!==Z.alpha&&(c(S)||(S=Z.clone()),S.alpha=x),c(S)&&(s=new Ut(S))}let d=new km;d.outline=new Qn(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=Kt.RHUMB;let u=[];for(let y=1,h=i.length;y<h;y++)u.push(new Fa(lj(i[y],n)));let f=i[0];d.hierarchy=new Qn(new Fa(lj(f,n),u)),f[0].length>2?d.perPositionHeight=new Qn(!0):o.clampToGround||(d.height=0);let p=mO(t,e._entityCollection,o.describe);p.polygon=d}function Nbe(e,t,n,i,o){Mbe(e,t,i,n.coordinates,o)}function kbe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Mbe(e,t,i,r[s],o)}function Ube(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=$Q(n,n.objects[r]),a=Gbe[s.type];a(e,s,s,i,o)}}function yg(e){this._name=e,this._changed=new ye,this._error=new ye,this._isLoading=!1,this._loading=new ye,this._entityCollection=new Ks(this),this._promises=[],this._pinBuilder=new r0,this._entityCluster=new wd,this._credit=void 0,this._resourceCredits=[]}yg.load=function(e,t){return new yg().load(e,t)};Object.defineProperties(yg,{markerSize:{get:function(){return nj},set:function(e){nj=e}},markerSymbol:{get:function(){return ij},set:function(e){ij=e}},markerColor:{get:function(){return oj},set:function(e){oj=e}},stroke:{get:function(){return rj},set:function(e){rj=e}},strokeWidth:{get:function(){return sj},set:function(e){sj=e}},fill:{get:function(){return aj},set:function(e){aj=e}},clampToGround:{get:function(){return cj},set:function(e){cj=e}},crsNames:{get:function(){return tj}},crsLinkHrefs:{get:function(){return Lbe}},crsLinkTypes:{get:function(){return Zbe}}});Object.defineProperties(yg.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});yg.prototype.load=function(e,t){return Obe(this,e,t,!0)};yg.prototype.process=function(e,t){return Obe(this,e,t,!1)};function Obe(e,t,n,i){if(!c(t))throw new L("data is required.");Hr.setLoading(e,!0),n=n??z.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Ct(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ge){t=Ge.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,l=t.credits;if(c(l)){let d=l.length;for(let u=0;u<d;u++)a.push(l[u])}}return n={describe:n.describe??Yit,markerSize:n.markerSize??nj,markerSymbol:n.markerSymbol??ij,markerColor:n.markerColor??oj,strokeWidthProperty:new Qn(n.strokeWidth??sj),strokeMaterialProperty:new Ut(n.stroke??rj),fillMaterialProperty:new Ut(n.fill??aj),clampToGround:n.clampToGround??cj},Promise.resolve(r).then(function(a){return zit(e,a,n,s,i)}).catch(function(a){throw Hr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}yg.prototype.update=function(e){return!0};function zit(e,t,n,i,o){let r;c(i)&&(r=Ob(i)),c(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Gbe[t.type];if(!c(s))throw new le(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,l=a!==null?uO:null;if(c(a)){if(!c(a.properties))throw new le("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(l=tj[d.name],!c(l))throw new le(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=Lbe[d.href];if(c(u)||(u=Zbe[d.type]),!c(u))throw new le(`Unable to resolve crs link: ${JSON.stringify(d)}`);l=u(d)}else if(a.type==="EPSG"){if(l=tj[`EPSG:${d.code}`],!c(l))throw new le(`Unknown crs EPSG code: ${d.code}`)}else throw new le(`Unknown crs type: ${a.type}`)}return Promise.resolve(l).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Hr.setLoading(e,!1),e})})}var gg=yg;var mCi=_(T(),1);function Kit(e){if(typeof e=="string"){let t=document.getElementById(e);if(t===null)throw new L(`Element with id "${e}" does not exist in the document.`);e=t}return e}var Wn=Kit;var nLi=_(T(),1);var bVi=_(T());var eVi=_(T());var hCi=_(T()),Dbe="4.1.0";var bCi=_(T());function Jit(e){return e===void 0}function Bd(e){return typeof e=="boolean"}function Bbe(e,t){for(var n in t)t.hasOwnProperty(n)&&Jit(e[n])&&(e[n]=t[n]);return e}function Ybe(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 Ko(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function xg(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Hh(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var vCi=_(T());var SCi=_(T());var xCi=_(T()),_g=/[A-Za-z]/,Qs=/[\d]/;var Yd=/\s/,fO=/['"]/,Hbe=/[\x00-\x1F\x7F]/,zbe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Qit=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,jit=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,qit=zbe+Qit+jit,Kbe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,yCi=new RegExp("[".concat(zbe+Kbe,"]")),dj=qit+Kbe,wf=new RegExp("[".concat(dj,"]"));var hO=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||(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(Yd):[],o=t.split(Yd),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(Yd):[],o=t.split(Yd),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(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var VCi=_(T());function Jbe(e,t,n){var i,o;n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var Z={},R=V,E=R.match(/^([a-z]+):\/\//i);return E&&(Z.scheme=E[1],R=R.substr(E[0].length)),E=R.match(/^(.*?)(?=(\?|#|\/|$))/i),E&&(Z.host=E[1],R=R.substr(E[0].length)),E=R.match(/^\/(.*?)(?=(\?|#|$))/i),E&&(Z.path=E[1],R=R.substr(E[0].length)),E=R.match(/^\?(.*?)(?=(#|$))/i),E&&(Z.query=E[1],R=R.substr(E[0].length)),E=R.match(/^#(.*?)$/i),E&&(Z.fragment=E[1]),Z},s=function(V){var Z="";return V.scheme&&V.host&&(Z+=V.scheme+"://"),V.host&&(Z+=V.host),V.path&&(Z+="/"+V.path),V.query&&(Z+="?"+V.query),V.fragment&&(Z+="#"+V.fragment),Z},a=function(V,Z){var R=Z/2,E=Math.ceil(R),I=-1*Math.floor(R),v="";return I<0&&(v=V.substr(I)),V.substr(0,E)+n+v};if(e.length<=t)return e;var l=t-o,d=r(e);if(d.query){var u=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(d.query=d.query.substr(0,u[1].length),e=s(d))}if(e.length<=t||(d.host&&(d.host=d.host.replace(/^www\./,""),e=s(d)),e.length<=t))return e;var f="";if(d.host&&(f+=d.host),f.length>=l)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,l+i):a(f,l).substr(0,l+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((f+p).length>=l){if((f+p).length==t)return(f+p).substr(0,t);var y=l-f.length;return(f+a(p,y)).substr(0,l+i)}else f+=p;if(d.fragment){var h="#"+d.fragment;if((f+h).length>=l){if((f+h).length==t)return(f+h).substr(0,t);var g=l-f.length;return(f+a(h,g)).substr(0,l+i)}else f+=h}if(d.scheme&&d.host){var x=d.scheme+"://";if((f+x).length<l)return(x+f).substr(0,t)}if(f.length<=t)return f;var S="";return l>0&&(S=f.substr(-1*Math.floor(l/2))),(f.substr(0,Math.ceil(l/2))+n+S).substr(0,l+i)}var ZCi=_(T());function Qbe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="&hellip;",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var ECi=_(T());function jbe(e,t,n){return Ybe(e,t,n)}var qbe=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 hO({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&&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||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?Jbe(t,i):o==="middle"?Qbe(t,i):jbe(t,i)},e}();var N1i=_(T());var QCi=_(T());var ACi=_(T(),1),uj=function(e,t){return uj=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])},uj(e,t)};function zh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");uj(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var js=function(){return js=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},js.apply(this,arguments)};var NCi=_(T()),Kh=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var YCi=_(T());var UCi=_(T()),$it="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|kerrylogistics|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|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|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|lancaster|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|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|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|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bentley|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|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|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|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|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|lipsy|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|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|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|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|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|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u98DE\u5229\u6D66|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|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",$be=new RegExp("^"+$it+"$");var eot=/[\/?#]/,tot=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,e0e=/[?!:,.;^]/,mj=/https?:\/\//i,t0e=new RegExp("^"+mj.source,"i"),n0e=new RegExp(e0e.source+"$"),not=/^(javascript|vbscript):/i,iot=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,oot=/^(?:\/\/)?([^/#?:]+)/;function FV(e){return _g.test(e)}function fj(e){return _g.test(e)||Qs.test(e)||e==="+"||e==="-"||e==="."}function s0(e){return wf.test(e)}function pO(e){return e==="_"||s0(e)}function hj(e){return wf.test(e)||tot.test(e)||e0e.test(e)}function bO(e){return eot.test(e)}function pj(e){return $be.test(e.toLowerCase())}function i0e(e){if(not.test(e))return!1;var t=e.match(iot);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!_g.test(i))}function o0e(e){var t=e.match(oot);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!pj(o)}var rot=/^(?:(?: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]?)$/,sot=/[:/?#]/;function r0e(e){var t=e.split(sot,1)[0];return rot.test(t)}var aot=/^(https?:\/\/)?(www\.)?/i,cot=/^\/\//,s0e=function(e){zh(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=uot(n)),this.stripPrefix.scheme&&(n=lot(n)),this.stripPrefix.www&&(n=dot(n)),this.stripTrailingSlash&&(n=mot(n)),this.decodePercentEncoding&&(n=fot(n)),n},t}(Kh);function lot(e){return e.replace(t0e,"")}function dot(e){return e.replace(aot,"$1")}function uot(e){return e.replace(cot,"")}function mot(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function fot(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch{return t}}var e1i=_(T());var a0e=/^mailto:/i,hot=new RegExp("[".concat(dj,"!#$%&'*+/=?^_`{|}~-]"));function c0e(e){return wf.test(e)}function yO(e){return hot.test(e)}function l0e(e){var t=e.split(".").pop()||"";return pj(t)}var o1i=_(T());var d0e=function(e){zh(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}(Kh);var a1i=_(T());function bj(e){return e==="_"||wf.test(e)}function u0e(e){return e.length<=140}var m0e=["twitter","facebook","instagram","tiktok","youtube"];var m1i=_(T());var f0e=function(e){zh(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:throw Hh(n),new Error("Invalid hashtag service: ".concat(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}(Kh);var h1i=_(T()),pot={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},bot=/[-\w.]/;function yj(e){return bot.test(e)}function h0e(e,t){var n=pot[t];return n.test(e)}var p0e=["twitter","instagram","soundcloud","tiktok","youtube"];var x1i=_(T());var b0e=function(e){zh(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:throw Hh(this.serviceName),new Error("Unknown service name to point mention to: "+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}(Kh);var T1i=_(T()),yot=/[-. ]/,got=/[-. ()]/,xot=/[,;]/,_ot=/(?:(?:(?:(\+)?\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]+#?)*/,Tot=/(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})/,Sot=new RegExp("^".concat(_ot.source,"|").concat(Tot.source,"$"));function gj(e){return yot.test(e)}function gO(e){return xot.test(e)}function y0e(e){var t=e.charAt(0)==="+"||got.test(e);return t&&Sot.test(e)}var L1i=_(T());var g0e=function(e){zh(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}(Kh);function T0e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,l=[],d=e.length,u=[],f=0;f<d;f++){var p=e.charAt(f);if(u.length===0)S(p);else{for(var y=u.length-1;y>=0;y--){var h=u[y];switch(h.state){case 11:v(h,p);break;case 12:P(h,p);break;case 0:V(h,p);break;case 1:Z(h,p);break;case 2:R(h,p);break;case 3:E(h,p);break;case 4:I(h,p);break;case 5:F(h,p);break;case 6:N(h,p);break;case 7:b(h,p);break;case 13:G(h,p);break;case 14:X(h,p);break;case 8:W(h,p);break;case 9:A(h,p);break;case 10:k(h,p);break;case 15:B(h,p);break;case 16:O(h,p);break;case 17:H(h,p);break;case 18:U(h,p);break;case 19:K(h,p);break;case 20:Q(h,p);break;case 21:ie(h,p);break;case 22:j(h,p);break;case 23:$(h,p);break;case 24:ne(h,p);break;case 25:be(h,p);break;case 26:Ce(h,p);break;case 27:me(h,p);break;case 28:_e(h,p);break;case 29:Ve(h,p);break;case 30:Ie(h,p);break;case 31:Ze(h,p);break;case 32:Ke(h,p);break;case 33:rt(h,p);break;case 34:Xt(h,p);break;case 35:Ht(h,p);break;case 36:qe(h,p);break;case 37:De(h,p);break;case 38:mn(h,p);break;case 39:Dt(h,p);break;case 40:Lt(h,p);break;case 41:Vi(h,p);break;default:Hh(h.state)}}if(f>0&&FV(p)){var g=e.charAt(f-1);!FV(g)&&!u.some(Eot)&&u.push(xO(f,0))}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(ge){return ln(ge)});return l;function S(ge){if(ge==="#")u.push(Rot(f,28));else if(ge==="@")u.push(Got(f,30));else if(ge==="/")u.push(xj(f,11));else if(ge==="+")u.push(_j(f,37));else if(ge==="(")u.push(_j(f,32));else{if(Qs.test(ge)&&(u.push(_j(f,38)),u.push(Lot(f,13))),c0e(ge)){var Le=ge.toLowerCase()==="m"?15:22;u.push(Zot(f,Le))}FV(ge)&&u.push(xO(f,0)),wf.test(ge)&&u.push(xj(f,5))}}function V(ge,Le){Le===":"?ge.state=2:Le==="-"?ge.state=1:fj(Le)||Ko(u,ge)}function Z(ge,Le){Le==="-"||(Le==="/"?(Ko(u,ge),u.push(xj(f,11))):fj(Le)?ge.state=0:Ko(u,ge))}function R(ge,Le){Le==="/"?ge.state=3:Le==="."?Ko(u,ge):s0(Le)?(ge.state=5,FV(Le)&&u.push(xO(f,0))):Ko(u,ge)}function E(ge,Le){Le==="/"?ge.state=4:hj(Le)?(ge.state=10,ge.acceptStateReached=!0):ln(ge)}function I(ge,Le){Le==="/"?ge.state=10:s0(Le)?(ge.state=5,ge.acceptStateReached=!0):Ko(u,ge)}function v(ge,Le){Le==="/"?ge.state=12:Ko(u,ge)}function P(ge,Le){s0(Le)?ge.state=5:Ko(u,ge)}function F(ge,Le){Le==="."?ge.state=7:Le==="-"?ge.state=6:Le===":"?ge.state=8:bO(Le)?ge.state=10:pO(Le)||ln(ge)}function N(ge,Le){Le==="-"||(Le==="."?ln(ge):s0(Le)?ge.state=5:ln(ge))}function b(ge,Le){Le==="."?ln(ge):s0(Le)?(ge.state=5,ge.acceptStateReached=!0):ln(ge)}function G(ge,Le){Le==="."?ge.state=14:Le===":"?ge.state=8:Qs.test(Le)||(bO(Le)?ge.state=10:wf.test(Le)?Ko(u,ge):ln(ge))}function X(ge,Le){Qs.test(Le)?(ge.octetsEncountered++,ge.octetsEncountered===4&&(ge.acceptStateReached=!0),ge.state=13):ln(ge)}function W(ge,Le){Qs.test(Le)?ge.state=9:ln(ge)}function A(ge,Le){Qs.test(Le)||(bO(Le)?ge.state=10:ln(ge))}function k(ge,Le){hj(Le)||ln(ge)}function B(ge,Le){Le.toLowerCase()==="a"?ge.state=16:j(ge,Le)}function O(ge,Le){Le.toLowerCase()==="i"?ge.state=17:j(ge,Le)}function H(ge,Le){Le.toLowerCase()==="l"?ge.state=18:j(ge,Le)}function U(ge,Le){Le.toLowerCase()==="t"?ge.state=19:j(ge,Le)}function K(ge,Le){Le.toLowerCase()==="o"?ge.state=20:j(ge,Le)}function Q(ge,Le){Le.toLowerCase()===":"?ge.state=21:j(ge,Le)}function ie(ge,Le){yO(Le)?ge.state=22:Ko(u,ge)}function j(ge,Le){Le==="."?ge.state=23:Le==="@"?ge.state=24:yO(Le)?ge.state=22:Ko(u,ge)}function $(ge,Le){Le==="."?Ko(u,ge):Le==="@"?Ko(u,ge):yO(Le)?ge.state=22:Ko(u,ge)}function ne(ge,Le){s0(Le)?ge.state=25:Ko(u,ge)}function be(ge,Le){Le==="."?ge.state=27:Le==="-"?ge.state=26:pO(Le)||ln(ge)}function Ce(ge,Le){Le==="-"||Le==="."?ln(ge):pO(Le)?ge.state=25:ln(ge)}function me(ge,Le){Le==="."||Le==="-"?ln(ge):s0(Le)?(ge.state=25,ge.acceptStateReached=!0):ln(ge)}function _e(ge,Le){bj(Le)?(ge.state=29,ge.acceptStateReached=!0):Ko(u,ge)}function Ve(ge,Le){bj(Le)||ln(ge)}function Ie(ge,Le){yj(Le)?(ge.state=31,ge.acceptStateReached=!0):Ko(u,ge)}function Ze(ge,Le){yj(Le)||(wf.test(Le)?Ko(u,ge):ln(ge))}function De(ge,Le){Qs.test(Le)?ge.state=38:(Ko(u,ge),S(Le))}function Ke(ge,Le){Qs.test(Le)?ge.state=33:Ko(u,ge),S(Le)}function rt(ge,Le){Qs.test(Le)?ge.state=34:Ko(u,ge)}function Xt(ge,Le){Qs.test(Le)?ge.state=35:Ko(u,ge)}function Ht(ge,Le){Le===")"?ge.state=36:Ko(u,ge)}function qe(ge,Le){Qs.test(Le)?ge.state=38:gj(Le)?ge.state=39:Ko(u,ge)}function mn(ge,Le){ge.acceptStateReached=!0,gO(Le)?ge.state=40:Le==="#"?ge.state=41:Qs.test(Le)||(Le==="("?ge.state=32:gj(Le)?ge.state=39:(ln(ge),FV(Le)&&u.push(xO(f,0))))}function Dt(ge,Le){Qs.test(Le)?ge.state=38:Le==="("?ge.state=32:(ln(ge),S(Le))}function Lt(ge,Le){gO(Le)||(Le==="#"?ge.state=41:Qs.test(Le)?ge.state=38:ln(ge))}function Vi(ge,Le){gO(Le)?ge.state=40:Qs.test(Le)?Ko(u,ge):ln(ge)}function ln(ge){if(Ko(u,ge),!!ge.acceptStateReached){var Le=ge.startIdx,yn=e.slice(ge.startIdx,f);if(yn=Vot(yn),ge.type==="url"){var bt=e.charAt(ge.startIdx-1);if(bt==="@")return;var ro=ge.matchType;if(ro==="scheme"){var Xo=mj.exec(yn);if(Xo&&(Le=Le+Xo.index,yn=yn.slice(Xo.index)),!i0e(yn))return}else if(ro==="tld"){if(!o0e(yn))return}else if(ro==="ipV4"){if(!r0e(yn))return}else Hh(ro);l.push(new s0e({tagBuilder:n,matchedText:yn,offset:Le,urlMatchType:ro,url:yn,protocolRelativeMatch:yn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(ge.type==="email")l0e(yn)&&l.push(new d0e({tagBuilder:n,matchedText:yn,offset:Le,email:yn.replace(a0e,"")}));else if(ge.type==="hashtag")u0e(yn)&&l.push(new f0e({tagBuilder:n,matchedText:yn,offset:Le,serviceName:s,hashtag:yn.slice(1)}));else if(ge.type==="mention")h0e(yn,a)&&l.push(new b0e({tagBuilder:n,matchedText:yn,offset:Le,serviceName:a,mention:yn.slice(1)}));else if(ge.type==="phone"){if(yn=yn.replace(/ +$/g,""),y0e(yn)){var ra=yn.replace(/[^0-9,;#]/g,"");l.push(new g0e({tagBuilder:n,matchedText:yn,offset:Le,number:ra,plusSign:yn.charAt(0)==="+"}))}}else Hh(ge)}}}var Cot=/[\(\{\[]/,x0e=/[\)\}\]]/,_0e={")":"(","}":"{","]":"["};function Vot(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Cot.test(i)?t[i]++:x0e.test(i)&&t[_0e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),x0e.test(r)){var s=_0e[r];if(t[s]<0)t[s]++,o--;else break}else if(n0e.test(r))o--;else break;return e.slice(0,o+1)}function xO(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function xj(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Lot(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Zot(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Rot(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Got(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function _j(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Eot(e){return e.type==="url"&&e.matchType==="scheme"}var B1i=_(T());function S0e(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Jh,l=0,d=e.length,u=0,f=0,p=a;l<d;){var y=e.charAt(l);switch(u){case 0:h(y);break;case 1:g(y);break;case 2:S(y);break;case 3:x(y);break;case 4:V(y);break;case 5:Z(y);break;case 6:R(y);break;case 7:E(y);break;case 8:I(y);break;case 9:v(y);break;case 10:P(y);break;case 11:F(y);break;case 12:N(y);break;case 13:b(y);break;case 14:G(y);break;case 15:X(y);break;case 16:W(y);break;case 17:A(y);break;case 18:k(y);break;case 19:B(y);break;case 20:O(y);break;default:Hh(u)}l++}f<l&&Q();function h($){$==="<"&&U()}function g($){$==="!"?u=13:$==="/"?(u=2,p=new Jh(js(js({},p),{isClosing:!0}))):$==="<"?U():_g.test($)?(u=3,p=new Jh(js(js({},p),{isOpening:!0}))):(u=0,p=a)}function x($){Yd.test($)?(p=new Jh(js(js({},p),{name:ie()})),u=4):$==="<"?U():$==="/"?(p=new Jh(js(js({},p),{name:ie()})),u=12):$===">"?(p=new Jh(js(js({},p),{name:ie()})),K()):!_g.test($)&&!Qs.test($)&&$!==":"&&H()}function S($){$===">"?H():_g.test($)?u=3:H()}function V($){Yd.test($)||($==="/"?u=12:$===">"?K():$==="<"?U():$==="="||fO.test($)||Hbe.test($)?H():u=5)}function Z($){Yd.test($)?u=6:$==="/"?u=12:$==="="?u=7:$===">"?K():$==="<"?U():fO.test($)&&H()}function R($){Yd.test($)||($==="/"?u=12:$==="="?u=7:$===">"?K():$==="<"?U():fO.test($)?H():u=5)}function E($){Yd.test($)||($==='"'?u=8:$==="'"?u=9:/[>=`]/.test($)?H():$==="<"?U():u=10)}function I($){$==='"'&&(u=11)}function v($){$==="'"&&(u=11)}function P($){Yd.test($)?u=4:$===">"?K():$==="<"&&U()}function F($){Yd.test($)?u=4:$==="/"?u=12:$===">"?K():$==="<"?U():(u=4,j())}function N($){$===">"?(p=new Jh(js(js({},p),{isClosing:!0})),K()):u=4}function b($){e.substr(l,2)==="--"?(l+=2,p=new Jh(js(js({},p),{type:"comment"})),u=14):e.substr(l,7).toUpperCase()==="DOCTYPE"?(l+=7,p=new Jh(js(js({},p),{type:"doctype"})),u=20):H()}function G($){$==="-"?u=15:$===">"?H():u=16}function X($){$==="-"?u=18:$===">"?H():u=16}function W($){$==="-"&&(u=17)}function A($){$==="-"?u=18:u=16}function k($){$===">"?K():$==="!"?u=19:$==="-"||(u=16)}function B($){$==="-"?u=17:$===">"?K():u=16}function O($){$===">"?K():$==="<"&&U()}function H(){u=0,p=a}function U(){u=1,p=new Jh({idx:l})}function K(){var $=e.slice(f,p.idx);$&&o($,f),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),H(),f=l+1}function Q(){var $=e.slice(f,l);o($,f),f=l+1}function ie(){var $=p.idx+(p.isClosing?2:1);return e.slice($,l).toLowerCase()}function j(){l--}}var Jh=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}();var Xot=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=Iot(t.urls),this.email=Bd(t.email)?t.email:this.email,this.phone=Bd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Bd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Wot(t.stripPrefix),this.stripTrailingSlash=Bd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Bd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&p0e.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&m0e.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=wot(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 S0e(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var l=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,d=s.split(l),u=a;d.forEach(function(f,p){if(p%2===0){var y=n.parseText(f,u);r.push.apply(r,y)}u+=f.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(l,d){return l.getOffset()-d.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||xg(t,function(n){return n.getType()==="hashtag"}),this.email||xg(t,function(n){return n.getType()==="email"}),this.phone||xg(t,function(n){return n.getType()==="phone"}),this.mention||xg(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||xg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||xg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||xg(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=T0e(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=[],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 hO)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new qbe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Dbe,e}(),C0e=Xot;function Iot(e){return e==null&&(e=!0),Bd(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Bd(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Bd(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Bd(e.ipV4Matches)?e.ipV4Matches:!0}}function Wot(e){return e==null&&(e=!0),Bd(e)?{scheme:e,www:e}:{scheme:Bd(e.scheme)?e.scheme:!0,www:Bd(e.www)?e.www:!0}}function wot(e){return typeof e=="number"?{length:e,location:"end"}:Bbe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var iVi=_(T());var tVi=_(T());var mVi=_(T());var _O=C0e;var W0e;typeof DOMParser<"u"&&(W0e=new DOMParser);var Pot=new _O({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),TO=32,V0e=2414016,L0e=1,Z0e=16093e3,R0e=.1,vot=[null,void 0,"http://www.topografix.com/GPX/1/1"],Zo={gpx:vot};function Fot(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 Tj(e,t){let n=gv(e,"id");return n=c(n)?n:Hn(),t.getOrCreateEntity(n)}function Sj(e){let t=G0e(e,"lon"),n=G0e(e,"lat"),i=bv(e,"ele",Zo.gpx);return m.fromDegrees(t,n,i)}function G0e(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function gv(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Tg(e,t,n){if(!c(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 Cj(e,t,n){if(!c(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 bv(e,t,n){let i=Tg(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Ql(e,t,n){let i=Tg(e,t,n);if(c(i))return i.textContent.trim()}function w0e(e){let t=new cc;return t.width=TO,t.height=TO,t.scaleByDistance=new Nt(V0e,L0e,Z0e,R0e),t.pixelOffsetScaleByDistance=new Nt(V0e,L0e,Z0e,R0e),t.verticalOrigin=new Qn(Mn.BOTTOM),t.image=e,t}function Aot(){let e=new Nm;return e.translucencyByDistance=new Nt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Yo.FILL_AND_OUTLINE,e}function P0e(e){let t=new uc;return t.width=4,t.material=new jy,t.material.color=c(e)?e:Y.RED,t.material.outlineWidth=2,t.material.outlineColor=Y.BLACK,t}var E0e={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"}},yv;typeof document<"u"&&(yv=document.createElement("div"));function Vj(e,t){let n,i="",o=Object.keys(E0e),r=o.length;for(n=0;n<r;n++){let u=o[n],f=E0e[u];f.value=Ql(e,f.tag,Zo.gpx)??"",c(f.value)&&f.value!==""&&(i=`${i}<p>${f.text}: ${f.value}</p>`)}if(!c(i)||i==="")return;i=Pot.link(i),yv.innerHTML=i;let s=yv.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=Y.WHITE,l=Y.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${l.toCssColorString()};`,d+='">',d+=`${yv.innerHTML}</div>`,yv.innerHTML="",d}function v0e(e,t,n,i){let o=Sj(t),r=Tj(t,n);r.position=o;let s=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",Y.RED,TO);r.billboard=w0e(s);let a=Ql(t,"name",Zo.gpx);r.name=a,r.label=Aot(),r.label.text=a,r.description=Vj(t,r),i.clampToGround&&(r.billboard.heightReference=ze.CLAMP_TO_GROUND,r.label.heightReference=ze.CLAMP_TO_GROUND)}function Mot(e,t,n,i){let o=Tj(t,n);o.description=Vj(t,o);let r=Cj(t,"rtept",Zo.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)v0e(e,r[a],n,i),s[a]=Sj(r[a]);o.polyline=P0e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Not(e,t,n,i){let o=Tj(t,n);o.description=Vj(t,o);let r=Cj(t,"trkseg",Zo.gpx),s=[],a=[],l,d=!0,u=new xa;for(let f=0;f<r.length;f++)l=kot(r[f]),s=s.concat(l.positions),l.times.length>0?(a=a.concat(l.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let f=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",Y.RED,TO);o.billboard=w0e(f),o.position=u,i.clampToGround&&(o.billboard.heightReference=ze.CLAMP_TO_GROUND),o.availability=new Yr,o.availability.addInterval(new Zn({start:a[0],stop:a[a.length-1]}))}o.polyline=P0e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function kot(e){let t={positions:[],times:[]},n=Cj(e,"trkpt",Zo.gpx),i;for(let o=0;o<n.length;o++){let r=Sj(n[o]);t.positions.push(r),i=Ql(n[o],"time",Zo.gpx),c(i)&&t.times.push(ee.fromIso8601(i))}return t}function Uot(e){let t=Tg(e,"metadata",Zo.gpx);if(c(t)){let n={name:Ql(t,"name",Zo.gpx),desc:Ql(t,"desc",Zo.gpx),author:Oot(t),copyright:Bot(t),link:F0e(t),time:Ql(t,"time",Zo.gpx),keywords:Ql(t,"keywords",Zo.gpx),bounds:Yot(t)};if(c(n.name)||c(n.desc)||c(n.author)||c(n.copyright)||c(n.link)||c(n.time)||c(n.keywords)||c(n.bounds))return n}}function Oot(e){let t=Tg(e,"author",Zo.gpx);if(c(t)){let n={name:Ql(t,"name",Zo.gpx),email:Dot(t),link:F0e(t)};if(c(n.name)||c(n.email)||c(n.link))return n}}function Dot(e){let t=Tg(e,"email",Zo.gpx);if(c(t)){let n=Ql(t,"id",Zo.gpx),i=Ql(t,"domain",Zo.gpx);return`${n}@${i}`}}function F0e(e){let t=Tg(e,"link",Zo.gpx);if(c(t)){let n={href:gv(t,"href"),text:Ql(t,"text",Zo.gpx),mimeType:Ql(t,"type",Zo.gpx)};if(c(n.href)||c(n.text)||c(n.mimeType))return n}}function Bot(e){let t=Tg(e,"copyright",Zo.gpx);if(c(t)){let n={author:gv(t,"author"),year:Ql(t,"year",Zo.gpx),license:Ql(t,"license",Zo.gpx)};if(c(n.author)||c(n.year)||c(n.license))return n}}function Yot(e){let t=Tg(e,"bounds",Zo.gpx);if(c(t)){let n={minLat:bv(t,"minlat",Zo.gpx),maxLat:bv(t,"maxlat",Zo.gpx),minLon:bv(t,"minlon",Zo.gpx),maxLon:bv(t,"maxlon",Zo.gpx)};if(c(n.minLat)||c(n.maxLat)||c(n.minLon)||c(n.maxLon))return n}}var X0e={wpt:v0e,rte:Mot,trk:Not};function Hot(e,t,n,i){let o=Object.keys(X0e),r=o.length;for(let s=0;s<r;s++){let a=o[s],l=X0e[a],d=t.childNodes,u=d.length;for(let f=0;f<u;f++){let p=d[f];p.localName===a&&Zo.gpx.indexOf(p.namespaceURI)!==-1&&l(e,p,n,i)}}}function I0e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=gv(o,"version"),s=gv(o,"creator"),a,l=Uot(o);c(l)&&(a=l.name),o.localName==="gpx"?Hot(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),f=u.start,p=u.stop,y=ee.equals(f,Ye.MINIMUM_VALUE),h=ee.equals(p,Ye.MAXIMUM_VALUE);if(!y||!h){let x;y&&(x=new Date,x.setHours(0,0,0,0),f=ee.fromDate(x)),h&&(x=new Date,x.setHours(24,0,0,0),p=ee.fromDate(x)),d=new Tf,d.startTime=f,d.stopTime=p,d.currentTime=ee.clone(f),d.clockRange=zr.LOOP_STOP,d.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(p,f)/60,1),31556900))}let g=!1;return e._name!==a&&(e._name=a,g=!0),e._creator!==s&&(e._creator=s,g=!0),zot(e._metadata,l)&&(e._metadata=l,g=!0),e._version!==r&&(e._version=r,g=!0),d!==e._clock&&(g=!0,e._clock=d),g&&e._changed.raiseEvent(e),Hr.setLoading(e,!1),e}function zot(e,t){return!c(e)&&!c(t)?!1:c(e)&&c(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 Kot(e,t,n,i){i=i??z.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof Ge){n=Ge.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)r.push(s[l])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?Fot(r).then(function(s){let a,l;try{a=W0e.parseFromString(s,"application/xml")}catch(d){l=d.toString()}if(c(l)||a.body||a.documentElement.tagName==="parsererror"){let d=c(l)?l:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new le(d)}return I0e(e,a,i)}):I0e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function AV(){this._changed=new ye,this._error=new ye,this._loading=new ye,this._clock=void 0,this._entityCollection=new Ks(this),this._entityCluster=new wd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new r0}AV.load=function(e,t){return new AV().load(e,t)};Object.defineProperties(AV.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){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}}});AV.prototype.update=function(e){return!0};AV.prototype.load=function(e,t){if(!c(e))throw new L("data is required.");t=t??z.EMPTY_OBJECT,Hr.setLoading(this,!0);let n=this._name,i=this;return Kot(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=ee.equals(s,Ye.MINIMUM_VALUE),d=ee.equals(a,Ye.MAXIMUM_VALUE);if(!l||!d){let f;l&&(f=new Date,f.setHours(0,0,0,0),s=ee.fromDate(f)),d&&(f=new Date,f.setHours(24,0,0,0),a=ee.fromDate(f)),o=new Tf,o.startTime=s,o.stopTime=a,o.currentTime=ee.clone(s),o.clockRange=zr.LOOP_STOP,o.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Hr.setLoading(i,!1),i}).catch(function(o){return Hr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var xv=AV;var oLi=_(T(),1);function Jot(e,t){this.position=e,this.headingPitchRoll=t}var _v=Jot;var YZi=_(T(),1);var Zv=_(cd(),1);var sLi=_(T(),1);function Qot(e,t){this.position=e,this.headingPitchRange=t}var Tv=Qot;var dLi=_(T(),1);function SO(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new ye,this.tourEnd=new ye,this.entryStart=new ye,this.entryEnd=new ye,this._activeEntries=[]}SO.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};SO.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;M0e.call(this,e,t,function(i){n.playlistIndex=0,i||A0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};SO.prototype.stop=function(){A0e(this._activeEntries)};function A0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function M0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=jot.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 c(n)&&n(!1)}function jot(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++,M0e.call(this,e,t,n)}}var Sv=SO;var RLi=_(T(),1);var TLi=_(T(),1);var gLi=_(T(),1),Ai=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-Ai.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?Ai.Bounce.In(e*2)*.5:Ai.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}}}}),Cv=function(){return performance.now()},qot=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=Cv()),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}(),MV={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=MV.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=MV.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=MV.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=MV.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,l=o*a;return(2*t-2*n+r+s)*l+(-3*t+3*n-2*r-s)*a+r*o+t}}},N0e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Lj=new qot,k0e=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=Ai.Linear.None,this._interpolationFunction=MV.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=N0e.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=Lj,Lj.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=Cv()),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],l=Array.isArray(a),d=l?"array":typeof a,u=!l&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var f=i[s];if(f.length===0)continue;for(var p=[a],y=0,h=f.length;y<h;y+=1){var g=this._handleRelativeValue(a,f[y]);if(isNaN(g)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(g)}u&&(i[s]=p)}if((d==="object"||l)&&a&&!u){n[s]=l?[]:{};var x=a;for(var S in x)n[s][S]=x[S];o[s]=l?[]:{};var f=i[s];if(!this._isDynamic){var V={};for(var S in f)V[S]=f[S];i[s]=f=V}this._setupProperties(x,n[s],f,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),l||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=Cv()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Cv()),!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=Ai.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=MV.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=Cv()),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),l=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>l)return 1;var g=Math.trunc(s/a),x=s-g*a,S=Math.min(x/i._duration,1);return S===0&&s===i._duration?1:S},u=d(),f=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,f),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var y=0,h=this._chainedTweens.length;y<h;y++)this._chainedTweens[y].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],l=Array.isArray(t[r]),d=Array.isArray(a),u=!l&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var uLi=N0e.nextId,Qh=Lj,mLi=Qh.getAll.bind(Qh),fLi=Qh.removeAll.bind(Qh),hLi=Qh.add.bind(Qh),pLi=Qh.remove.bind(Qh),bLi=Qh.update.bind(Qh);var $ot={LINEAR_NONE:Ai.Linear.None,QUADRATIC_IN:Ai.Quadratic.In,QUADRATIC_OUT:Ai.Quadratic.Out,QUADRATIC_IN_OUT:Ai.Quadratic.InOut,CUBIC_IN:Ai.Cubic.In,CUBIC_OUT:Ai.Cubic.Out,CUBIC_IN_OUT:Ai.Cubic.InOut,QUARTIC_IN:Ai.Quartic.In,QUARTIC_OUT:Ai.Quartic.Out,QUARTIC_IN_OUT:Ai.Quartic.InOut,QUINTIC_IN:Ai.Quintic.In,QUINTIC_OUT:Ai.Quintic.Out,QUINTIC_IN_OUT:Ai.Quintic.InOut,SINUSOIDAL_IN:Ai.Sinusoidal.In,SINUSOIDAL_OUT:Ai.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Ai.Sinusoidal.InOut,EXPONENTIAL_IN:Ai.Exponential.In,EXPONENTIAL_OUT:Ai.Exponential.Out,EXPONENTIAL_IN_OUT:Ai.Exponential.InOut,CIRCULAR_IN:Ai.Circular.In,CIRCULAR_OUT:Ai.Circular.Out,CIRCULAR_IN_OUT:Ai.Circular.InOut,ELASTIC_IN:Ai.Elastic.In,ELASTIC_OUT:Ai.Elastic.Out,ELASTIC_IN_OUT:Ai.Elastic.InOut,BACK_IN:Ai.Back.In,BACK_OUT:Ai.Back.Out,BACK_IN_OUT:Ai.Back.InOut,BOUNCE_IN:Ai.Bounce.In,BOUNCE_OUT:Ai.Bounce.Out,BOUNCE_IN_OUT:Ai.Bounce.InOut},Jr=Object.freeze($ot);function CO(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}CO.prototype.play=function(e,t,n){if(this.activeCamera=t,c(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(c(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ue(this.view.position);t.flyToBoundingSphere(o,i)}};CO.prototype.stop=function(){c(this.activeCamera)&&this.activeCamera.cancelFlight(),c(this.activeCallback)&&this.activeCallback(!0)};CO.prototype.getCameraOptions=function(e){let t={duration:this.duration};return c(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Jr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),c(e)&&(t=St(t,e)),t};var Vv=CO;var XLi=_(T(),1);function Zj(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Zj.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Zj.prototype.stop=function(){clearTimeout(this.timeout),c(this.activeCallback)&&this.activeCallback(!0)};var Lv=Zj;var Q0e={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=ox(t),Q0e[t]}},wj;typeof DOMParser<"u"&&(wj=new DOMParser);var ert=new _O({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Sg=32,U0e=2414016,O0e=1,D0e=16093e3,B0e=.1,Y0e=[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"],H0e=["http://www.google.com/kml/ext/2.2"],trt=["http://www.w3.org/2005/Atom"],Pe={kml:Y0e,gx:H0e,atom:trt,kmlgx:Y0e.concat(H0e)},Pj={Document:sye,Folder:_rt,Placemark:Trt,NetworkLink:Xrt,GroundOverlay:Rrt,PhotoOverlay:lye,ScreenOverlay:Zrt,Tour:Crt};function jh(e){this._dataSource=e,this._deferred=Cl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(jh.prototype,{dataSource:{get:function(){return this._dataSource}}});jh.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};jh.prototype.addPromise=function(e){this._promises.push(e)};jh.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};jh.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Kd._getTimestamp()),this._process(e)};jh.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Kd._getTimestamp(),e._process(!0)},0)};jh.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]};jh.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};jh.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;c(i);){let o=Pj[i.localName];if(c(o)&&(Pe.kml.indexOf(i.namespaceURI)!==-1||Pe.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Kd._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function nrt(e){let t=e.slice(0,Math.min(4,e.size)),n=Cl(),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 irt(e){let t=Cl(),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 j0e(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&&(c(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return c(n)&&(e=n+i),e}function q0e(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}function ort(e,t){return Promise.resolve(e.getData(new OU)).then(function(n){n=j0e(n),n=q0e(n),t.kml=wj.parseFromString(n,"application/xml")})}function Rj(e,t){let n=Q0e.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new kU(n))).then(function(i){t[e.filename]=i})}function Hd(e,t,n,i){let o=i.keys,r=new Zv.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let l=s[a],d=l.getAttribute(n);if(c(d)){let f=new Zv.default(d).absoluteTo(r).toString(),p=o.indexOf(f);if(p!==-1){let y=o[p];l.setAttribute(n,i[y]),t==="a"&&l.getAttribute("download")===null&&l.setAttribute("download",y)}}}}function zd(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),l=vj(a,i);c(l)&&s.setAttribute(n,l.url)}}function $0e(e,t,n){let i=Is(e,"id");i=c(i)&&i.length!==0?i:Hn(),c(n)&&(i=n+i);let o=t.getById(i);return c(o)&&(i=Hn(),c(n)&&(i=n+i)),o=t.add(new $o({id:i})),c(o.kml)||(o.addProperty("kml"),o.kml=new Prt),o}function Rv(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function RO(e,t){if(!c(e))return m.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!c(n))return m.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,m.fromDegrees(i,o,r,t)}function VO(e,t){if(!c(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!c(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=RO(n[s],t);return o}function Cg(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Is(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Mi(e,t,n){if(!c(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 z0e(e,t,n){if(!c(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 Pf(e,t,n){if(!c(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 ei(e,t,n){let i=Mi(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function wn(e,t,n){let i=Mi(e,t,n);if(c(i))return i.textContent.trim()}function vf(e,t,n){let i=Mi(e,t,n);if(c(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function vj(e,t,n){if(!c(e))return;let i;if(c(n)){e=e.replace(/\\/g,"/");let o=n[e];if(c(o))i=new Ge({url:o});else{let r=new Zv.default(t.getUrlComponent()),s=new Zv.default(e);o=n[s.absoluteTo(r)],c(o)&&(i=new Ge({url:o}))}}return c(i)||(i=t.getDerivedResource({url:e})),i}var jl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Ij(e,t){if(!c(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?(jl.maximumRed=r,jl.red=void 0):(jl.maximumRed=void 0,jl.red=0),o>0?(jl.maximumGreen=o,jl.green=void 0):(jl.maximumGreen=void 0,jl.green=0),i>0?(jl.maximumBlue=i,jl.blue=void 0):(jl.maximumBlue=void 0,jl.blue=0),jl.alpha=n,Y.fromRandom(jl)):new Y(r,o,i,n)}function ET(e,t,n){let i=wn(e,t,n);if(c(i))return Ij(i,wn(e,"colorMode",n)==="random")}function rrt(e){let t=Mi(e,"TimeStamp",Pe.kmlgx),n=wn(t,"when",Pe.kmlgx);if(!c(t)||!c(n)||n.length===0)return;let i=ee.fromIso8601(n),o=new Yr;return o.addInterval(new Zn({start:i,stop:Ye.MAXIMUM_VALUE})),o}function srt(e){let t=Mi(e,"TimeSpan",Pe.kmlgx);if(!c(t))return;let n,i=Mi(t,"begin",Pe.kmlgx),o=c(i)?ee.fromIso8601(i.textContent):void 0,r=Mi(t,"end",Pe.kmlgx),s=c(r)?ee.fromIso8601(r.textContent):void 0;if(c(o)&&c(s)){if(ee.lessThan(s,o)){let a=o;o=s,s=a}n=new Yr,n.addInterval(new Zn({start:o,stop:s}))}else c(o)?(n=new Yr,n.addInterval(new Zn({start:o,stop:Ye.MAXIMUM_VALUE}))):c(s)&&(n=new Yr,n.addInterval(new Zn({start:Ye.MINIMUM_VALUE,stop:s})));return n}function eye(){let e=new cc;return e.width=Sg,e.height=Sg,e.scaleByDistance=new Nt(U0e,O0e,D0e,B0e),e.pixelOffsetScaleByDistance=new Nt(U0e,O0e,D0e,B0e),e}function Fj(){let e=new km;return e.outline=!0,e.outlineColor=Y.WHITE,e}function tye(){let e=new Nm;return e.translucencyByDistance=new Nt(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Yo.FILL_AND_OUTLINE,e}function Aj(e,t,n,i,o){let r=wn(e,"href",Pe.kml);if(!c(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),l=ei(e,"x",Pe.gx)??0,d=ei(e,"y",Pe.gx)??0;l=Math.min(l/32,7),d=7-Math.min(d/32,7);let u=8*d+l;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=vj(r,n,i);if(o){let a=wn(e,"refreshMode",Pe.kml),l=wn(e,"viewRefreshMode",Pe.kml);a==="onInterval"||a==="onExpire"?ht(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(l==="onStop"||l==="onRegion")&&ht(`kml-refreshMode-${l}`,`KML - Unsupported Icon viewRefreshMode: ${l}`);let d=wn(e,"viewBoundScale",Pe.kml)??1,u=l==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",f=wn(e,"viewFormat",Pe.kml)??u,p=wn(e,"httpQuery",Pe.kml);c(f)&&s.setQueryParameters(ld(ZO(f))),c(p)&&s.setQueryParameters(ld(ZO(p)));let y=t._ellipsoid;return Nj(s,t.camera,t.canvas,d,t._lastCameraView.bbox,y),s}return s}function art(e,t,n,i,o){let r=ei(t,"scale",Pe.kml),s=ei(t,"heading",Pe.kml),a=ET(t,"color",Pe.kml),l=Mi(t,"Icon",Pe.kml),d=Aj(l,e,i,o,!1);c(l)&&!c(d)&&(d=!1);let u=ei(l,"x",Pe.gx),f=ei(l,"y",Pe.gx),p=ei(l,"w",Pe.gx),y=ei(l,"h",Pe.gx),h=Mi(t,"hotSpot",Pe.kml),g=Cg(h,"x"),x=Cg(h,"y"),S=Is(h,"xunits"),V=Is(h,"yunits"),Z=n.billboard;c(Z)||(Z=eye(),n.billboard=Z),Z.image=d,Z.scale=r,Z.color=a,(c(u)||c(f)||c(p)||c(y))&&(Z.imageSubRegion=new je(u,f,p,y)),c(s)&&s!==0&&(Z.rotation=w.toRadians(-s),Z.alignedAxis=m.UNIT_Z),r=r??1;let R,E;c(g)&&(S==="pixels"?R=-g*r:S==="insetPixels"?R=(g-Sg)*r:S==="fraction"&&(R=-g*Sg*r),R+=Sg*.5*r),c(x)&&(V==="pixels"?E=x*r:V==="insetPixels"?E=(-x+Sg)*r:V==="fraction"&&(E=x*Sg*r),E-=Sg*.5*r),(c(R)||c(E))&&(Z.pixelOffset=new D(R,E))}function LO(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")art(e,a,n,i,o);else if(a.localName==="LabelStyle"){let l=n.label;c(l)||(l=tye(),n.label=l),l.scale=ei(a,"scale",Pe.kml)??l.scale,l.fillColor=ET(a,"color",Pe.kml)??l.fillColor,l.text=n.name}else if(a.localName==="LineStyle"){let l=n.polyline;c(l)||(l=new uc,n.polyline=l),l.width=ei(a,"width",Pe.kml),l.material=ET(a,"color",Pe.kml),c(ET(a,"outerColor",Pe.gx))&&ht("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),c(ei(a,"outerWidth",Pe.gx))&&ht("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),c(ei(a,"physicalWidth",Pe.gx))&&ht("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),c(vf(a,"labelVisibility",Pe.gx))&&ht("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let l=n.polygon;c(l)||(l=Fj(),n.polygon=l),l.material=ET(a,"color",Pe.kml)??l.material,l.fill=vf(a,"fill",Pe.kml)??l.fill,l.outline=vf(a,"outline",Pe.kml)??l.outline}else if(a.localName==="BalloonStyle"){let l=Ij(wn(a,"bgColor",Pe.kml))??Y.WHITE,d=Ij(wn(a,"textColor",Pe.kml))??Y.BLACK,u=wn(a,"text",Pe.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:l,textColor:d,text:u}}else if(a.localName==="ListStyle"){let l=wn(a,"listItemType",Pe.kml);(l==="radioFolder"||l==="checkOffOnly")&&ht(`kml-listStyle-${l}`,`KML - Unsupported ListStyle with listItemType: ${l}`)}}}function crt(e,t,n,i,o){let r=new $o,s,a=-1,l=t.childNodes,d=l.length;for(let f=0;f<d;f++){let p=l[f];(p.localName==="Style"||p.localName==="StyleMap")&&(a=f)}if(a!==-1){let f=l[a];if(f.localName==="Style")LO(e,f,r,i,o);else{let p=Pf(f,"Pair",Pe.kml);for(let y=0;y<p.length;y++){let h=p[y],g=wn(h,"key",Pe.kml);if(g==="normal"){let x=wn(h,"styleUrl",Pe.kml);if(c(x))s=n.getById(x),c(s)||(s=n.getById(`#${x}`)),c(s)&&r.merge(s);else{let S=Mi(h,"Style",Pe.kml);LO(e,S,r,i,o)}}else ht(`kml-styleMap-${g}`,`KML - Unsupported StyleMap key: ${g}`)}}}let u=wn(t,"styleUrl",Pe.kml);if(c(u)){let f=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),y=p[0];f=`${i.getDerivedResource({url:y}).getUrlComponent()}#${p[1]}`}s=n.getById(f),c(s)||(s=n.getById(`#${f}`)),c(s)&&r.merge(s)}return r}function lrt(e,t,n){return t.fetchXML().then(function(i){return nye(e,i,n,t,!0)})}function nye(e,t,n,i,o,r){let s,a,l,d,u=z0e(t,"Style",Pe.kml);if(c(u)){let g=u.length;for(s=0;s<g;s++)d=u[s],a=Is(d,"id"),c(a)&&(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),c(n.getById(a))||(l=new $o({id:a}),n.add(l),LO(e,d,l,i,r)))}let f=z0e(t,"StyleMap",Pe.kml);if(c(f)){let g=f.length;for(s=0;s<g;s++){let x=f[s];if(a=Is(x,"id"),c(a)){let S=Pf(x,"Pair",Pe.kml);for(let V=0;V<S.length;V++){let Z=S[V],R=wn(Z,"key",Pe.kml);if(R==="normal"){if(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),!c(n.getById(a))){l=n.getOrCreateEntity(a);let E=wn(Z,"styleUrl",Pe.kml);if(c(E)){E[0]!=="#"&&(E=`#${E}`),o&&c(i)&&(E=i.getUrlComponent()+E);let I=n.getById(E);c(I)&&l.merge(I)}else d=Mi(Z,"Style",Pe.kml),LO(e,d,l,i,r)}}else ht(`kml-styleMap-${R}`,`KML - Unsupported StyleMap key: ${R}`)}}}}let p=[],y=t.getElementsByTagName("styleUrl"),h=y.length;for(s=0;s<h;s++){let g=y[s].textContent;if(g[0]!=="#"){let x=g.split("#");if(x.length===2){let S=x[0],V=i.getDerivedResource({url:S});p.push(lrt(e,V,n))}}}return p}function Mj(e,t,n){let i=new Yb(e,t.id,["position"]),o=new Mh(t.position);t.polyline=c(n.polyline)?n.polyline.clone():new uc,t.polyline.positions=new Bb([i,o])}function iye(e,t){return!c(e)&&!c(t)||e==="clampToGround"?ze.CLAMP_TO_GROUND:e==="relativeToGround"?ze.RELATIVE_TO_GROUND:e==="absolute"?ze.NONE:t==="clampToSeaFloor"?(ht("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),ze.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(ht("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),ze.RELATIVE_TO_GROUND):(c(e)?ht("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):ht("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),ze.CLAMP_TO_GROUND)}function drt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&ht("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new Mh(e))}function urt(e,t,n,i){if(!c(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&ht("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 GO(e,t,n,i){let o=t.label;c(o)||(o=c(n.label)?n.label.clone():tye(),t.label=o),o.text=t.name;let r=t.billboard;c(r)||(r=c(n.billboard)?n.billboard.clone():eye(),t.billboard=r),c(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(Y.YELLOW,64);let s=1;c(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new D(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function oye(e,t){let n=e.path;c(n)||(n=new Op,n.leadTime=0,e.path=n);let i=t.polyline;c(i)&&(n.material=i.material,n.width=i.width)}function mrt(e,t,n,i,o){let r=wn(n,"coordinates",Pe.kml),s=wn(n,"altitudeMode",Pe.kml),a=wn(n,"altitudeMode",Pe.gx),l=vf(n,"extrude",Pe.kml),d=e._ellipsoid,u=RO(r,d);return i.position=u,GO(e,i,o,iye(s,a)),l&&Rv(s,a)&&Mj(t,i,o),!0}function K0e(e,t,n,i,o){let r=Mi(n,"coordinates",Pe.kml),s=wn(n,"altitudeMode",Pe.kml),a=wn(n,"altitudeMode",Pe.gx),l=vf(n,"extrude",Pe.kml),d=vf(n,"tessellate",Pe.kml),u=Rv(s,a),f=ei(n,"drawOrder",Pe.gx),p=e._ellipsoid,y=VO(r,p),h=o.polyline;if(u&&l){let g=new Dp;i.wall=g,g.positions=y;let x=o.polygon;c(x)&&(g.fill=x.fill,g.material=x.material),g.outline=!0,c(h)?(g.outlineColor=c(h.material)?h.material.color:Y.WHITE,g.outlineWidth=h.width):c(x)&&(g.outlineColor=c(x.material)?x.material.color:Y.WHITE)}else if(e._clampToGround&&!u&&d){let g=new uc;g.clampToGround=!0,i.polyline=g,g.positions=y,c(h)?(g.material=c(h.material)?h.material.color.getValue(Ye.MINIMUM_VALUE):Y.WHITE,g.width=h.width??1):(g.material=Y.WHITE,g.width=1),g.zIndex=f}else c(f)&&ht("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&ht("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),h=c(h)?h.clone():new uc,i.polyline=h,h.positions=urt(y,s,a,p),(!d||u)&&(h.arcType=Kt.NONE);return!0}function frt(e,t,n,i,o){let r=Mi(n,"outerBoundaryIs",Pe.kml),s=Mi(r,"LinearRing",Pe.kml),a=Mi(s,"coordinates",Pe.kml),l=e._ellipsoid,d=VO(a,l),u=vf(n,"extrude",Pe.kml),f=wn(n,"altitudeMode",Pe.kml),p=wn(n,"altitudeMode",Pe.gx),y=Rv(f,p),h=c(o.polygon)?o.polygon.clone():Fj(),g=o.polyline;if(c(g)&&(h.outlineColor=c(g.material)?g.material.color:Y.WHITE,h.outlineWidth=g.width),i.polygon=h,y?(h.perPositionHeight=!0,h.extrudedHeight=u?0:void 0):e._clampToGround||(h.height=0),c(d)){let x=new Fa(d),S=Pf(n,"innerBoundaryIs",Pe.kml);for(let V=0;V<S.length;V++){s=Pf(S[V],"LinearRing",Pe.kml);for(let Z=0;Z<s.length;Z++)a=Mi(s[Z],"coordinates",Pe.kml),d=VO(a,l),c(d)&&x.holes.push(new Fa(d))}h.hierarchy=x}return!0}function hrt(e,t,n,i,o){let r=wn(n,"altitudeMode",Pe.kml),s=wn(n,"altitudeMode",Pe.gx),a=Pf(n,"coord",Pe.gx),l=Pf(n,"angles",Pe.gx),d=Pf(n,"when",Pe.kml),u=vf(n,"extrude",Pe.kml),f=Rv(r,s),p=e._ellipsoid;l.length>0&&ht("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let y=Math.min(a.length,d.length),h=[],g=[];for(let S=0;S<y;S++){let V=RO(a[S].textContent,p);h.push(V),g.push(ee.fromIso8601(d[S].textContent))}let x=new xa;return x.addSamples(g,h),i.position=x,GO(e,i,o,iye(r,s)),oye(i,o),i.availability=new Yr,d.length>0&&i.availability.addInterval(new Zn({start:g[0],stop:g[g.length-1]})),f&&u&&Mj(t,i,o),!0}function J0e(e,t,n,i,o,r,s,a,l){let d=e[0],u=e[e.length-1],f=new xa;f.addSamples(e,t),n.intervals.addInterval(new Zn({start:d,stop:u,isStartIncluded:l,isStopIncluded:l,data:drt(f,s,a)})),i.addInterval(new Zn({start:d,stop:u,isStartIncluded:l,isStopIncluded:l})),o.intervals.addInterval(new Zn({start:d,stop:u,isStartIncluded:l,isStopIncluded:l,data:r}))}function prt(e,t,n,i,o){let r=vf(n,"interpolate",Pe.gx),s=Pf(n,"Track",Pe.gx),a,l,d,u=!1,f=new zb,p=new Yr,y=new ya,h=e._ellipsoid;for(let g=0,x=s.length;g<x;g++){let S=s[g],V=Pf(S,"when",Pe.kml),Z=Pf(S,"coord",Pe.gx),R=wn(S,"altitudeMode",Pe.kml),E=wn(S,"altitudeMode",Pe.gx),I=Rv(R,E),v=vf(S,"extrude",Pe.kml),P=Math.min(Z.length,V.length),F=[];a=[];for(let N=0;N<P;N++){let b=RO(Z[N].textContent,h);F.push(b),a.push(ee.fromIso8601(V[N].textContent))}r&&(c(l)&&J0e([l,a[0]],[d,F[0]],y,p,f,!1,"absolute",void 0,!1),l=a[P-1],d=F[F.length-1]),J0e(a,F,y,p,f,I&&v,R,E,!0),u=u||I&&v}return i.availability=p,i.position=y,GO(e,i,o),oye(i,o),u&&(Mj(t,i,o),i.polyline.show=f),!0}var rye={Point:mrt,LineString:K0e,LinearRing:K0e,Polygon:frt,Track:hrt,MultiTrack:prt,MultiGeometry:brt,Model:yrt};function brt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let l=0,d=s.length;l<d;l++){let u=s.item(l),f=rye[u.localName];if(c(f)){let p=$0e(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,f(e,t,u,p,o)&&(a=!0)}}return a}function yrt(e,t,n,i,o){return ht("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function grt(e,t){let n=Mi(e,"ExtendedData",Pe.kml);if(!c(n))return;c(Mi(n,"SchemaData",Pe.kml))&&ht("kml-schemaData","KML - SchemaData is unsupported"),c(Is(n,"xmlns:prefix"))&&ht("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Pf(n,"Data",Pe.kml);if(c(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],l=Is(a,"name");c(l)&&(i[l]={displayName:wn(a,"displayName",Pe.kml),value:wn(a,"value",Pe.kml)})}}t.kml.extendedData=i}var po;typeof document<"u"&&(po=document.createElement("div"));function xrt(e,t,n,i,o){let r,s,a,l=t.kml,d=l.extendedData,u=wn(e,"description",Pe.kml),f=t.balloonStyle??n.balloonStyle,p=Y.WHITE,y=Y.BLACK,h=u;c(f)&&(p=f.bgColor??Y.WHITE,y=f.textColor??Y.BLACK,h=f.text??u);let g;if(c(h)){if(h=h.replace("$[name]",t.name??""),h=h.replace("$[description]",u??""),h=h.replace("$[address]",l.address??""),h=h.replace("$[Snippet]",l.snippet??""),h=h.replace("$[id]",t.id),h=h.replace("$[geDirections]",""),c(d)){let V=h.match(/\$\[.+?\]/g);if(V!==null)for(r=0;r<V.length;r++){let Z=V[r],R=Z.substr(2,Z.length-3),E=/\/displayName$/.test(R);R=R.replace(/\/displayName$/,""),g=d[R],c(g)&&(g=E?g.displayName:g.value),c(g)&&(h=h.replace(Z,g??""))}}}else if(c(d)&&(a=Object.keys(d),a.length>0)){for(h='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],g=d[s],h+=`<tr><th>${g.displayName??s}</th><td>${g.value??""}</td></tr>`;h+="</tbody></table>"}if(!c(h))return;h=ert.link(h),po.innerHTML=h;let x=po.querySelectorAll("a");for(r=0;r<x.length;r++)x[r].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(Hd(po,"a","href",i),Hd(po,"link","href",i),Hd(po,"area","href",i),Hd(po,"img","src",i),Hd(po,"iframe","src",i),Hd(po,"video","src",i),Hd(po,"audio","src",i),Hd(po,"source","src",i),Hd(po,"track","src",i),Hd(po,"input","src",i),Hd(po,"embed","src",i),Hd(po,"script","src",i),Hd(po,"video","poster",i)),zd(po,"a","href",o),zd(po,"link","href",o),zd(po,"area","href",o),zd(po,"img","src",o),zd(po,"iframe","src",o),zd(po,"video","src",o),zd(po,"audio","src",o),zd(po,"source","src",o),zd(po,"track","src",o),zd(po,"input","src",o),zd(po,"embed","src",o),zd(po,"script","src",o),zd(po,"video","poster",o);let S='<div class="cesium-infoBox-description-lighter" style="';S+="overflow:auto;",S+="word-wrap:break-word;",S+=`background-color:${p.toCssColorString()};`,S+=`color:${y.toCssColorString()};`,S+='">',S+=`${po.innerHTML}</div>`,po.innerHTML="",t.description=S}function EO(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=$0e(t,i,n.context),l=a.kml,d=crt(e,t,n.styleCollection,r,s),u=wn(t,"name",Pe.kml);a.name=u,a.parent=o;let f=srt(t);c(f)||(f=rrt(t)),a.availability=f,Uj(a);function p(Z){return Z?Z.show&&p(Z.parent):!0}let y=vf(t,"visibility",Pe.kml);a.show=p(o)&&(y??!0);let h=Mi(t,"author",Pe.atom),g=l.author;g.name=wn(h,"name",Pe.atom),g.uri=wn(h,"uri",Pe.atom),g.email=wn(h,"email",Pe.atom);let x=Mi(t,"link",Pe.atom),S=l.link;S.href=Is(x,"href"),S.hreflang=Is(x,"hreflang"),S.rel=Is(x,"rel"),S.type=Is(x,"type"),S.title=Is(x,"title"),S.length=Is(x,"length"),l.address=wn(t,"address",Pe.kml),l.phoneNumber=wn(t,"phoneNumber",Pe.kml),l.snippet=wn(t,"Snippet",Pe.kml),grt(t,a),xrt(t,a,d,s,r);let V=e._ellipsoid;return cye(t,a,V),aye(t,a,V),c(Mi(t,"Region",Pe.kml))&&ht("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function sye(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function _rt(e,t,n,i){let o=EO(e,t,n),r=He(n);r.parentEntity=o.entity,sye(e,t,r,i)}function Trt(e,t,n,i){let o=EO(e,t,n),r=o.entity,s=o.styleEntity,a=!1,l=t.childNodes;for(let d=0,u=l.length;d<u&&!a;d++){let f=l.item(d),p=rye[f.localName];c(p)&&(p(e,n.entityCollection,f,r,s,r.id),a=!0)}a||(r.merge(s),GO(e,r,s))}var Srt={FlyTo:Lrt,Wait:Vrt,SoundCue:Gj,AnimatedUpdate:Gj,TourControl:Gj};function Crt(e,t,n,i){let o=wn(t,"name",Pe.kml),r=Is(t,"id"),s=new Sv(o,r),a=Mi(t,"Playlist",Pe.gx);if(a){let l=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let f=d[u];if(f.localName){let p=Srt[f.localName];p?p(s,f,l):console.log(`Unknown KML Tour playlist entry type ${f.localName}`)}}}e._kmlTours.push(s)}function Gj(e,t){ht(`KML Tour unsupported node ${t.localName}`)}function Vrt(e,t){let n=ei(t,"duration",Pe.gx);e.addPlaylistEntry(new Lv(n))}function Lrt(e,t,n){let i=ei(t,"duration",Pe.gx),o=wn(t,"flyToMode",Pe.gx),r={kml:{}};cye(t,r,n),aye(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new Vv(i,o,s);e.addPlaylistEntry(a)}function aye(e,t,n){let i=Mi(e,"Camera",Pe.kml);if(c(i)){let o=ei(i,"longitude",Pe.kml)??0,r=ei(i,"latitude",Pe.kml)??0,s=ei(i,"altitude",Pe.kml)??0,a=ei(i,"heading",Pe.kml)??0,l=ei(i,"tilt",Pe.kml)??0,d=ei(i,"roll",Pe.kml)??0,u=m.fromDegrees(o,r,s,n),f=Ea.fromDegrees(a,l-90,d);t.kml.camera=new _v(u,f)}}function cye(e,t,n){let i=Mi(e,"LookAt",Pe.kml);if(c(i)){let o=ei(i,"longitude",Pe.kml)??0,r=ei(i,"latitude",Pe.kml)??0,s=ei(i,"altitude",Pe.kml)??0,a=ei(i,"heading",Pe.kml),l=ei(i,"tilt",Pe.kml),d=ei(i,"range",Pe.kml)??0;l=w.toRadians(l??0),a=w.toRadians(a??0);let u=new rm(a,l-w.PI_OVER_TWO,d),f=m.fromDegrees(o,r,s,n);t.kml.lookAt=new Tv(f,u)}}function Zrt(e,t,n,i){let o=n.screenOverlayContainer;if(!c(o))return;let r=n.sourceResource,s=n.uriResolver,a=Mi(t,"Icon",Pe.kml),l=Aj(a,e,r,s,!1);if(!c(l))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=l.url,d.onload=function(){let u=["position: absolute"],f=Mi(t,"screenXY",Pe.kml),p=Mi(t,"overlayXY",Pe.kml),y=Mi(t,"size",Pe.kml),h,g,x,S,V,Z;c(y)&&(h=Cg(y,"x"),g=Cg(y,"y"),x=Is(y,"xunits"),S=Is(y,"yunits"),c(h)&&h!==-1&&h!==0&&(x==="fraction"?V=`width: ${Math.floor(h*100)}%`:x==="pixels"&&(V=`width: ${h}px`),u.push(V)),c(g)&&g!==-1&&g!==0&&(S==="fraction"?Z=`height: ${Math.floor(g*100)}%`:S==="pixels"&&(Z=`height: ${g}px`),u.push(Z))),d.style=u.join(";");let R=0,E=d.height;c(p)&&(h=Cg(p,"x"),g=Cg(p,"y"),x=Is(p,"xunits"),S=Is(p,"yunits"),c(h)&&(x==="fraction"?R=h*d.width:(x==="pixels"||x==="insetPixels")&&(R=h)),c(g)&&(S==="fraction"?E=g*d.height:(S==="pixels"||S==="insetPixels")&&(E=g))),c(f)&&(h=Cg(f,"x"),g=Cg(f,"y"),x=Is(f,"xunits"),S=Is(f,"yunits"),c(h)&&(x==="fraction"?V=`left: calc(${Math.floor(h*100)}% - ${R}px)`:x==="pixels"?V=`left: ${h-R}px`:x==="insetPixels"&&(V=`right: ${h-R}px`),u.push(V)),c(g)&&(S==="fraction"?Z=`bottom: calc(${Math.floor(g*100)}% - ${E}px)`:S==="pixels"?Z=`bottom: ${g-E}px`:S==="insetPixels"&&(Z=`top: ${g-E}px`),u.push(Z))),d.style=u.join(";")},o.appendChild(d)}function Rrt(e,t,n,i){let r=EO(e,t,n).entity,s,a=!1,l=e._ellipsoid,d=VO(Mi(t,"LatLonQuad",Pe.gx),l),u=ei(t,"drawOrder",Pe.kml);if(c(d))s=Fj(),s.hierarchy=new Fa(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Um,s.zIndex=u,r.rectangle=s;let h=Mi(t,"LatLonBox",Pe.kml);if(c(h)){let g=ei(h,"west",Pe.kml),x=ei(h,"south",Pe.kml),S=ei(h,"east",Pe.kml),V=ei(h,"north",Pe.kml);c(g)&&(g=w.negativePiToPi(w.toRadians(g))),c(x)&&(x=w.clampToLatitudeRange(w.toRadians(x))),c(S)&&(S=w.negativePiToPi(w.toRadians(S))),c(V)&&(V=w.clampToLatitudeRange(w.toRadians(V))),s.coordinates=new de(g,x,S,V);let Z=ei(h,"rotation",Pe.kml);if(c(Z)){let R=w.toRadians(Z);s.rotation=R,s.stRotation=R}}}let f=Mi(t,"Icon",Pe.kml),p=Aj(f,e,n.sourceResource,n.uriResolver,!0);if(c(p)){a&&ht("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let h=ei(f,"x",Pe.gx),g=ei(f,"y",Pe.gx),x=ei(f,"w",Pe.gx),S=ei(f,"h",Pe.gx);(c(h)||c(g)||c(x)||c(S))&&ht("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=ET(t,"color",Pe.kml),s.material.transparent=!0}else s.material=ET(t,"color",Pe.kml);let y=wn(t,"altitudeMode",Pe.kml);c(y)?y==="absolute"?(s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):y!=="clampToGround"&&ht("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`):(y=wn(t,"altitudeMode",Pe.gx),y==="relativeToSeaFloor"?(ht("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=ei(t,"altitude",Pe.kml),s.zIndex=void 0):y==="clampToSeaFloor"?ht("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(y)&&ht("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y}`))}function lye(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),ht(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Vg={INTERVAL:0,EXPIRE:1,STOP:2};function ZO(e){if(!c(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Grt=new de,NV=new pe,Ej=new D,Ert=new m;function Nj(e,t,n,i,o,r){function s(d){return d<-w.PI_OVER_TWO?-w.PI_OVER_TWO:d>w.PI_OVER_TWO?w.PI_OVER_TWO:d}function a(d){return d>w.PI?d-w.TWO_PI:d<-w.PI?d+w.TWO_PI:d}let l=ax(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),c(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??Grt,c(n)&&(Ej.x=n.clientWidth*.5,Ej.y=n.clientHeight*.5,d=t.pickEllipsoid(Ej,r,Ert)),c(d)?u=r.cartesianToCartographic(d,NV):(u=de.center(o,NV),d=r.cartographicToCartesian(u)),c(i)&&!w.equalsEpsilon(i,1,w.EPSILON9)){let S=o.width*i*.5,V=o.height*i*.5;o=new de(a(u.longitude-S),s(u.latitude-V),a(u.longitude+S),s(u.latitude+V))}l=l.replace("[bboxWest]",w.toDegrees(o.west).toString()),l=l.replace("[bboxSouth]",w.toDegrees(o.south).toString()),l=l.replace("[bboxEast]",w.toDegrees(o.east).toString()),l=l.replace("[bboxNorth]",w.toDegrees(o.north).toString());let f=w.toDegrees(u.longitude).toString(),p=w.toDegrees(u.latitude).toString();l=l.replace("[lookatLon]",f),l=l.replace("[lookatLat]",p),l=l.replace("[lookatTilt]",w.toDegrees(t.pitch).toString()),l=l.replace("[lookatHeading]",w.toDegrees(t.heading).toString()),l=l.replace("[lookatRange]",m.distance(t.positionWC,d)),l=l.replace("[lookatTerrainLon]",f),l=l.replace("[lookatTerrainLat]",p),l=l.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,NV),l=l.replace("[cameraLon]",w.toDegrees(NV.longitude).toString()),l=l.replace("[cameraLat]",w.toDegrees(NV.latitude).toString()),l=l.replace("[cameraAlt]",w.toDegrees(NV.height).toString());let y=t.frustum,h=y.aspectRatio,g="",x="";if(c(h)){let S=w.toDegrees(y.fov);h>1?(g=S,x=S/h):(x=S,g=S*h)}l=l.replace("[horizFov]",g.toString()),l=l.replace("[vertFov]",x.toString())}else l=l.replace("[bboxWest]","-180"),l=l.replace("[bboxSouth]","-90"),l=l.replace("[bboxEast]","180"),l=l.replace("[bboxNorth]","90"),l=l.replace("[lookatLon]",""),l=l.replace("[lookatLat]",""),l=l.replace("[lookatRange]",""),l=l.replace("[lookatTilt]",""),l=l.replace("[lookatHeading]",""),l=l.replace("[lookatTerrainLon]",""),l=l.replace("[lookatTerrainLat]",""),l=l.replace("[lookatTerrainAlt]",""),l=l.replace("[cameraLon]",""),l=l.replace("[cameraLat]",""),l=l.replace("[cameraAlt]",""),l=l.replace("[horizFov]",""),l=l.replace("[vertFov]","");c(n)?(l=l.replace("[horizPixels]",n.clientWidth),l=l.replace("[vertPixels]",n.clientHeight)):(l=l.replace("[horizPixels]",""),l=l.replace("[vertPixels]","")),l=l.replace("[terrainEnabled]","1"),l=l.replace("[clientVersion]","1"),l=l.replace("[kmlVersion]","2.2"),l=l.replace("[clientName]","Cesium"),l=l.replace("[language]","English"),e.setQueryParameters(ld(l))}function Xrt(e,t,n,i){let r=EO(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,l=Mi(t,"Link",Pe.kml);if(c(l)||(l=Mi(t,"Url",Pe.kml)),c(l)){let d=wn(l,"href",Pe.kml),u,f;if(c(d)){let p=d;if(d=vj(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=wn(l,"viewRefreshMode",Pe.kml),u==="onRegion"){ht("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}f=wn(l,"viewBoundScale",Pe.kml)??1;let x=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",S=wn(l,"viewFormat",Pe.kml)??x,V=wn(l,"httpQuery",Pe.kml);c(S)&&d.setQueryParameters(ld(ZO(S))),c(V)&&d.setQueryParameters(ld(ZO(V)));let Z=e._ellipsoid;Nj(d,e.camera,e.canvas,f,e._lastCameraView.bbox,Z)}let y={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},h=new Ks,g=kj(e,h,d,y).then(function(x){let S=e._entityCollection,V=h.values;S.suspendEvents();for(let E=0;E<V.length;E++){let I=V[E];c(I.parent)||(I.parent=r,Uj(I)),S.add(I)}S.resumeEvents();let Z=wn(l,"refreshMode",Pe.kml),R=ei(l,"refreshInterval",Pe.kml)??0;if(Z==="onInterval"&&R>0||Z==="onExpire"||u==="onStop"){let E=Mi(x,"NetworkLinkControl",Pe.kml),I=c(E),v=ee.now(),P={id:Hn(),href:d,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:f,needsUpdate:!1,cameraUpdateTime:v},F=0;if(I&&(P.cookie=ld(wn(E,"cookie",Pe.kml)??""),F=ei(E,"minRefreshPeriod",Pe.kml)??0),Z==="onInterval")I&&(R=Math.max(F,R)),P.refreshMode=Vg.INTERVAL,P.time=R;else if(Z==="onExpire"){let N;if(I&&(N=wn(E,"expires",Pe.kml)),c(N))try{let b=ee.fromIso8601(N),G=ee.secondsDifference(b,v);G>0&&G<F&&ee.addSeconds(v,F,b),P.refreshMode=Vg.EXPIRE,P.time=b}catch{ht("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else ht("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else c(e.camera)?(P.refreshMode=Vg.STOP,P.time=ei(l,"viewRefreshTime",Pe.kml)??0):ht("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");c(P.refreshMode)&&e._networkLinks.set(P.id,P)}}).catch(function(x){ht(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,x)});i.addPromise(g)}}}function Irt(e,t,n,i){let o=Pj[t.localName];return c(o)?o(e,t,n,i):lye(e,t,n,i)}function Wj(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,l=a.localName==="Document"?a:Mi(a,"Document",Pe.kml),d=wn(l,"name",Pe.kml);c(d)||(d=Ob(i.getUrlComponent())),c(e._name)||(e._name=d);let u=new Kd._DeferredLoading(e),f=new Ks(e);return Promise.all(nye(e,n,f,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let h=p.childNodes;for(let g=0;g<h.length;g++){let x=h[g];if(c(Pj[x.localName])){p=x;break}}}let y={parentEntity:void 0,entityCollection:t,styleCollection:f,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),Irt(e,p,y,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function Wrt(e,t,n,i,o){let r=on("ThirdParty/Workers/z-worker-pako.js");GV({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new nO(new o0(n));return Promise.resolve(s.getEntries()).then(function(a){let l=[],d={},u;for(let f=0;f<a.length;f++){let p=a[f];p.directory||(/\.kml$/i.test(p.filename)&&(!c(u)||!/\//i.test(p.filename))?(c(u)&&l.push(Rj(u,d)),u=p):l.push(Rj(p,d)))}return c(u)&&l.push(ort(u,d)),Promise.all(l).then(function(){if(s.close(),!c(d.kml))throw new le("KMZ file does not contain a KML document.");return d.keys=Object.keys(d),Wj(e,t,d.kml,i,d,o)})})}function kj(e,t,n,i){i=i??z.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,l=n;if(typeof n=="string"||n instanceof Ge){n=Ge.createIfNeeded(n),l=n.fetchBlob(),o=o??n.clone();let d=e._resourceCredits,u=n.credits;if(c(u)){let f=u.length;for(let p=0;p<f;p++)d.push(u[p])}}else o=o??Ge.DEFAULT.clone();return o=Ge.createIfNeeded(o),c(a)&&(a=Wn(a)),Promise.resolve(l).then(function(d){return d instanceof Blob?nrt(d).then(function(u){return u?Wrt(e,t,d,o,a):irt(d).then(function(f){f=j0e(f),f=q0e(f);let p,y;try{p=wj.parseFromString(f,"application/xml")}catch(h){y=h.toString()}if(c(y)||p.body||p.documentElement.tagName==="parsererror"){let h=c(y)?y:p.documentElement.firstChild.nodeValue;throw h||(h=p.body.innerText),new le(h)}return Wj(e,t,p,o,r,a,s)})}):Wj(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function Kd(e){e=e??z.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new ye,this._error=new ye,this._loading=new ye,this._refresh=new ye,this._unsupportedNode=new ye,this._clock=void 0,this._entityCollection=new Ks(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new r0,this._networkLinks=new Zt,this._entityCluster=new wd,this.canvas=n,this.camera=t,this._lastCameraView={position:c(t)?m.clone(t.positionWC):void 0,direction:c(t)?m.clone(t.directionWC):void 0,up:c(t)?m.clone(t.upWC):void 0,bbox:c(t)?t.computeViewRectangle():de.clone(de.MAX_VALUE)},this._ellipsoid=e.ellipsoid??re.default;let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Kd.load=function(e,t){return t=t??z.EMPTY_OBJECT,new Kd(t).load(e,t)};Object.defineProperties(Kd.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){if(!c(e))throw new L("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Kd.prototype.load=function(e,t){if(!c(e))throw new L("data is required.");t=t??z.EMPTY_OBJECT,Hr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return kj(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=ee.equals(s,Ye.MINIMUM_VALUE),d=ee.equals(a,Ye.MAXIMUM_VALUE);if(!l||!d){let f;l&&(f=new Date,f.setHours(0,0,0,0),s=ee.fromDate(f)),d&&(f=new Date,f.setHours(24,0,0,0),a=ee.fromDate(f)),o=new Tf,o.startTime=s,o.stopTime=a,o.currentTime=ee.clone(s),o.clockRange=zr.LOOP_STOP,o.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(ee.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Hr.setLoading(i,!1),i}).catch(function(o){return Hr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Kd.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function Uj(e){let t=e.parent;if(c(t)){let n=t.availability;if(c(n)){let i=e.availability;c(i)?i.intersect(n):e.availability=n}}}function wrt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Mi(r,"NetworkLinkControl",Pe.kml),l=c(a),d=0;if(l){if(c(Mi(a,"Update",Pe.kml))){ht("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=ld(wn(a,"cookie",Pe.kml)??""),d=ei(a,"minRefreshPeriod",Pe.kml)??0}let u=ee.now(),f=t.refreshMode;if(f===Vg.INTERVAL)c(a)&&(t.time=Math.max(d,t.time));else if(f===Vg.EXPIRE){let v;if(c(a)&&(v=wn(a,"expires",Pe.kml)),c(v))try{let P=ee.fromIso8601(v),F=ee.secondsDifference(P,u);F>0&&F<d&&ee.addSeconds(u,d,P),t.time=P}catch{ht("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else ht("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,y=e._entityCollection,h=n.values;function g(v){y.remove(v);let P=v._children,F=P.length;for(let N=0;N<F;++N)g(P[N])}y.suspendEvents();let x=y.values.slice(),S;for(S=0;S<x.length;++S){let v=x[S];v.parent===p&&(v.parent=void 0,g(v))}for(y.resumeEvents(),y.suspendEvents(),S=0;S<h.length;S++){let v=h[S];c(v.parent)||(v.parent=p,Uj(v)),y.add(v)}y.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let V=y.computeAvailability(),Z=V.start,R=V.stop,E=ee.equals(Z,Ye.MINIMUM_VALUE),I=ee.equals(R,Ye.MAXIMUM_VALUE);if(!E||!I){let v=e._clock;(v.startTime!==Z||v.stopTime!==R)&&(v.startTime=Z,v.stopTime=R,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var Xj=new Zt;Kd.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=ee.now(),i=this;Xj.removeAll();function o(u){let f=u._children,p=f.length;for(let y=0;y<p;++y){let h=f[y];Xj.set(h.id,h),o(h)}}let r=!1,s=this._lastCameraView,a=this.camera;c(a)&&!(a.positionWC.equalsEpsilon(s.position,w.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,w.EPSILON7)&&a.upWC.equalsEpsilon(s.up,w.EPSILON7))&&(s.position=m.clone(a.positionWC),s.direction=m.clone(a.directionWC),s.up=m.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let l=new Zt,d=!1;return t.values.forEach(function(u){let f=u.entity;if(!Xj.contains(f.id)){if(!u.updating){let p=!1;if(u.refreshMode===Vg.INTERVAL?ee.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===Vg.EXPIRE?ee.greaterThan(n,u.time)&&(p=!0):u.refreshMode===Vg.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&ee.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(f),u.updating=!0;let y=new Ks,h=u.href.clone();h.setQueryParameters(u.cookie);let g=i._ellipsoid??re.default;Nj(h,i.camera,i.canvas,u.viewBoundScale,s.bbox,g),kj(i,y,h,{context:f.id}).then(wrt(i,u,y,l,h)).catch(function(x){let S=`NetworkLink ${u.href} refresh failed: ${x}`;console.log(S),i._error.raiseEvent(i,S)}),d=!0}}l.set(u.id,u)}}),d&&(this._networkLinks=l,this._changed.raiseEvent(this)),!0};function Prt(){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}Kd._DeferredLoading=jh;Kd._getTimestamp=Ti;var XT=Kd;var KZi=_(T(),1);function Gv(){L.throwInstantiationError()}Gv.prototype.update=L.throwInstantiationError;Gv.prototype.getBoundingSphere=L.throwInstantiationError;Gv.prototype.isDestroyed=L.throwInstantiationError;Gv.prototype.destroy=L.throwInstantiationError;var Oj=Gv;var QZi=_(T(),1),kV=`#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 qZi=_(T(),1),Ev=`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;
}
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;
}
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 eRi=_(T(),1),Xv=`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;
}
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);
}
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;
}
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;
}
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));
}
const float T0    = 0.6;
const float k     = 0.1;
const float C0    = 0.8;
const float FX0   = 0.6;
const float FY0   = 0.6;
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;
const float t = 0.4;
const float s = 0.25;
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);
float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);
float It = T(cloudPoint);
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;
float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
float TR = pow(ndDot, 3.0) - W;
TR *= 1.3;
float minusDot = 0.5 - ndDot;
TR -= min(minusDot * W2, 0.0);
TR -= 0.8 * (minusDot + 0.25) * W3;
float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
shading = clamp(shading + 0.2, 0.3, 1.0);
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
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 nRi=_(T(),1),Iv=`#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() {
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 oRi=_(T(),1),Wv=`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));
}
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 sRi=_(T(),1),wv=`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 cRi=_(T(),1),Pv=`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 dRi=_(T(),1),vv=`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 mRi=_(T(),1),Fv=`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);
vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x);
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 hRi=_(T(),1),Av=`in vec4 position;
out vec4 positionEC;
void main()
{
positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
}
`;var bRi=_(T(),1),UV=`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;
vec3 normalEC = normalize(czm_normal * normalMC);
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()
{
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;
}
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;
}
vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
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 gRi=_(T(),1),OV=`in vec3 position;
uniform vec3 u_radii;
out vec3 v_positionEC;
void main()
{
vec4 p = vec4(u_radii * position, 1.0);
v_positionEC = (czm_modelView * p).xyz;
gl_Position = czm_modelViewProjection * p;
gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
czm_vertexLogDepth();
}
`;var _Ri=_(T(),1);/**
 * @license
 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *  * Neither the name of NVIDIA CORPORATION nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */var Mv=`#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(
FxaaFloat2 pos,
FxaaTex tex,
FxaaFloat2 fxaaQualityRcpFrame,
FxaaFloat fxaaQualitySubpix,
FxaaFloat fxaaQualityEdgeThreshold,
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 SRi=_(T(),1),Nv=`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
#ifdef COLOR_CORRECT
uniform vec3 u_hsbShift;
#endif
#ifdef HIGHLIGHT_FILL_TILE
uniform vec4 u_fillHighlightColor;
#endif
#ifdef TRANSLUCENT
uniform vec4 u_frontFaceAlphaByDistance;
uniform vec4 u_backFaceAlphaByDistance;
uniform vec4 u_translucencyRectangle;
#endif
#ifdef UNDERGROUND_COLOR
uniform vec4 u_undergroundColor;
uniform vec4 u_undergroundColorAlphaByDistance;
#endif
#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)
{
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;
if (split < 0.0 && gl_FragCoord.x > splitPosition) {
alpha = 0.0;
}
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;
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));
vec3 normalEC = czm_normal3D * normalMC;
#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
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;
#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);
#ifdef FOG
vec3 fogColor = groundAtmosphereColor.rgb;
#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
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);
}
const float oceanFrequencyLowAltitude = 825000.0;
const float oceanAnimationSpeedLowAltitude = 0.004;
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
const float oceanSpecularIntensity = 0.5;
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);
vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
#ifdef SHOW_OCEAN_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);
time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
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);
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);
float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
#ifdef SHOW_OCEAN_WAVES
float tsPerturbationRatio = normalTangentSpace.z;
vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
#else
vec3 nonDiffuseHighlight = vec3(0.0);
#endif
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 VRi=_(T(),1),kv=`#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;
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
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)
{
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)
{
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);
return czm_modelViewProjection * morphPosition;
}
#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)
float webMercatorT = textureCoordinates.y;
float encodedNormal = compressed0.w;
#else
float webMercatorT = textureCoordinates.y;
float encodedNormal = 0.0;
#endif
#else
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;
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;
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 ZRi=_(T(),1),DV=`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 GRi=_(T(),1),Uv=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var XRi=_(T(),1),Ov=`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 WRi=_(T(),1),BV=`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;
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);
float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
underTranslucentGlobe = 0.0;
#if defined(GLOBE_TRANSLUCENT)
czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
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);
float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
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);
underTranslucentGlobe = 1.0;
return;
}
#endif
computeScattering(
primaryRay,
length(cameraToPositionWC),
lightDirection,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
opacity *= pow(nightAlpha, 0.5);
}
`;var PRi=_(T(),1),Dv=`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
if (translucent == 0.0) {
color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
}
out_FragColor = color;
}
`;var FRi=_(T(),1),Bv=`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;
gl_Position = czm_modelViewProjection * position;
}
`;var MRi=_(T(),1),Yv=`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 kRi=_(T(),1),Hv=`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 ORi=_(T(),1),zv=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(u_texture, v_textureCoordinates);
out_FragColor = czm_gammaCorrect(color);
}
`;var BRi=_(T(),1),Kv=`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);
burst += 0.4 * addBurst(position, vec2(0.38942,  0.92106), lengthScalar);
burst += 0.4 * addBurst(position, vec2(0.99235,  0.12348), lengthScalar);
burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);
burst += 0.3 * addBurst(position, vec2(0.31457,  0.94924), lengthScalar);
burst += 0.3 * addBurst(position, vec2(0.97931,  0.20239), lengthScalar);
burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);
color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
}
`;var HRi=_(T(),1),Jv=`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 KRi=_(T(),1),Qv=`in vec2 v_textureCoordinates;
void main()
{
czm_materialInput materialInput;
materialInput.s = v_textureCoordinates.s;
materialInput.st = v_textureCoordinates;
materialInput.str = vec3(v_textureCoordinates, 0.0);
materialInput.normalEC = vec3(0.0, 0.0, -1.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
}
`;var Ceo=_(T(),1);var jRi=_(T(),1);function vrt(e){let t,n=e.name,i=e.message;c(n)&&c(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return c(o)&&(t+=`
${o}`),t}var qh=vrt;var fGi=_(T(),1);var aGi=_(T(),1);var tGi=_(T(),1);async function Frt(e,t,n,i){return c(i)||(i=!1),C.typeOf.object("terrainProvider",e),C.typeOf.number("level",t),C.typeOf.bool("rejectOnTileFail",i),C.defined("positions",n),Nrt(e,t,n,i)}function Art(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(uye(i)):r=o.then(uye(i)).catch(krt(i)),e.shift(),t.push(r),!0}function Mrt(e){return new Promise(function(t){setTimeout(t,e)})}function Dj(e,t,n){return e.length?Art(e,t,n)?Dj(e,t,n):Mrt(100).then(()=>Dj(e,t,n)):Promise.resolve()}function Nrt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!c(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let f={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=f,s.push(f)}a[u].positions.push(n[r])}let l=[];return Dj(s,l,i).then(function(){return Promise.all(l).then(function(){return n})})}function dye(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function uye(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(!dye(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];dye(s,i,n)}}):Promise.resolve()}}function krt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var jv=Frt;var Bj=new D;async function mye(e,t,n){if(c(n)||(n=!1),!c(e))throw new L("terrainProvider is required.");if(!c(t))throw new L("positions is required.");let i=[],o=[],r=e.availability;if(!c(r))throw new L("sampleTerrainMostDetailed requires a terrain provider that has tile availability.");let s=[];for(let l=0;l<t.length;++l){let d=t[l],u=r.computeMaximumLevelAtPosition(d);if(o[l]=u,u===0){e.tilingScheme.positionToTileXY(d,1,Bj);let p=e.loadTileDataAvailability(Bj.x,Bj.y,1);c(p)&&s.push(p)}let f=i[u];c(f)||(i[u]=f=[]),f.push(d)}await Promise.all(s),await Promise.all(i.map(function(l,d){if(c(l))return jv(e,d,l,n)}));let a=[];for(let l=0;l<t.length;++l){let d=t[l];r.computeMaximumLevelAtPosition(d)!==o[l]&&a.push(d)}return a.length>0&&await mye(e,a,n),t}var IT=mye;async function Yj(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===se.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!c(n))return r;let a=n.availability;if(!c(a)||t.mode===se.SCENE2D)return r;let l=[de.center(e),de.southeast(e),de.southwest(e),de.northeast(e),de.northwest(e)],d=await Yj._sampleTerrainMostDetailed(n,l),u=!1,f=d.reduce(function(y,h){return c(h.height)?(u=!0,Math.max(h.height,y)):y},-Number.MAX_VALUE),p=r;return u&&(p.height+=f),p}Yj._sampleTerrainMostDetailed=IT;var WT=Yj;var CAi=_(T(),1);var XEi=_(T(),1);var TEi=_(T(),1);var pGi=_(T(),1),Urt={NONE:0,LERC:1},cm=Object.freeze(Urt);var YGi=_(T(),1);var GGi=_(T(),1);var yGi=_(T(),1),Ort={NONE:0,BITS12:1},qs=Object.freeze(Ort);var wT=new m,Drt=new m,lm=new D,XO=new M,Brt=new M,Yrt=Math.pow(2,12);function Zc(e,t,n,i,o,r,s,a,l,d){let u=qs.NONE,f,p;if(c(t)&&c(n)&&c(i)&&c(o)){let y=t.minimum,h=t.maximum,g=m.subtract(h,y,Drt),x=i-n;Math.max(m.maximumComponent(g),x)<Yrt-1?u=qs.BITS12:u=qs.NONE,f=M.inverseTransformation(o,new M);let V=m.negate(y,wT);M.multiply(M.fromTranslation(V,XO),f,f);let Z=wT;Z.x=1/g.x,Z.y=1/g.y,Z.z=1/g.z,M.multiply(M.fromScale(Z,XO),f,f),p=M.clone(o),M.setTranslation(p,m.ZERO,p),o=M.clone(o,new M);let R=M.fromTranslation(y,XO),E=M.fromScale(g,Brt),I=M.multiply(R,E,XO);M.multiply(o,I,o),M.multiply(p,I,p)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=m.clone(e),this.toScaledENU=f,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=l??1,this.exaggerationRelativeHeight=d??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Zc.prototype.encode=function(e,t,n,i,o,r,s,a){let l=i.x,d=i.y;if(this.quantization===qs.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,wT),n.x=w.clamp(n.x,0,1),n.y=w.clamp(n.y,0,1),n.z=w.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,f=w.clamp((o-this.minimumHeight)/u,0,1);D.fromElements(n.x,n.y,lm);let p=Fn.compressTextureCoordinates(lm);D.fromElements(n.z,f,lm);let y=Fn.compressTextureCoordinates(lm);D.fromElements(l,d,lm);let h=Fn.compressTextureCoordinates(lm);if(e[t++]=p,e[t++]=y,e[t++]=h,this.hasWebMercatorT){D.fromElements(s,0,lm);let g=Fn.compressTextureCoordinates(lm);e[t++]=g}}else m.subtract(n,this.center,wT),e[t++]=wT.x,e[t++]=wT.y,e[t++]=wT.z,e[t++]=o,e[t++]=l,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Fn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Hrt=new m,fye=new m;Zc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let f=s*i+u,p=s*r+u;t[p]=e[f]}let a=this.decodePosition(t,s,Hrt),l=n.geodeticSurfaceNormal(a,fye),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=l.x,t[d+1]=l.y,t[d+2]=l.z}};Zc.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,l=r*o+s;t[l]=e[a]}};Zc.prototype.decodePosition=function(e,t,n){if(c(n)||(n=new m),t*=this.stride,this.quantization===qs.BITS12){let i=Fn.decompressTextureCoordinates(e[t],lm);n.x=i.x,n.y=i.y;let o=Fn.decompressTextureCoordinates(e[t+1],lm);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],m.add(n,this.center,n)};Zc.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,fye),a=this.decodeHeight(e,t),l=Lr.getHeight(a,i,o)-a;n.x+=s.x*l,n.y+=s.y*l,n.z+=s.z*l}return n};Zc.prototype.decodeTextureCoordinates=function(e,t,n){return c(n)||(n=new D),t*=this.stride,this.quantization===qs.BITS12?Fn.decompressTextureCoordinates(e[t+2],n):D.fromElements(e[t+4],e[t+5],n)};Zc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===qs.BITS12?Fn.decompressTextureCoordinates(e[t+1],lm).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Zc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===qs.BITS12?Fn.decompressTextureCoordinates(e[t+3],lm).x:e[t+6]};Zc.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 D.fromElements(o,r,n)};Zc.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};Zc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case qs.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 IO={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},WO={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Zc.prototype.getAttributes=function(e){let t=q.FLOAT,n=q.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,l){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:l,offsetInBytes:o,strideInBytes:i}),o+=l*n}if(this.quantization===qs.NONE){s(IO.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(IO.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(IO.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,l=this.hasWebMercatorT&&this.hasVertexNormals;s(WO.compressed0,a?4:3),l&&s(WO.compressed1,1),this.hasGeodeticSurfaceNormals&&s(WO.geodeticSurfaceNormal,3)}return r};Zc.prototype.getAttributeLocations=function(){return this.quantization===qs.NONE?IO:WO};Zc.clone=function(e,t){if(c(e))return c(t)||(t=new Zc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=m.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 Rc=Zc;var $h={};$h.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Hj=new m,zrt=new M,Krt=new m,Jrt=new m;$h.computeVertices=function(e){if(!c(e)||!c(e.heightmap))throw new L("options.heightmap is required.");if(!c(e.width)||!c(e.height))throw new L("options.width and options.height are required.");if(!c(e.nativeRectangle))throw new L("options.nativeRectangle is required.");if(!c(e.skirtHeight))throw new L("options.skirtHeight is required.");let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=w.PI_OVER_TWO,a=w.toRadians,l=e.heightmap,d=e.width,u=e.height,f=e.skirtHeight,p=f>0,y=e.isGeographic??!0,h=e.ellipsoid??re.default,g=1/h.maximumRadius,x=de.clone(e.nativeRectangle),S=de.clone(e.rectangle),V,Z,R,E;c(S)?(V=S.west,Z=S.south,R=S.east,E=S.north):y?(V=a(x.west),Z=a(x.south),R=a(x.east),E=a(x.north)):(V=x.west*g,Z=s-2*o(r(-x.south*g)),R=x.east*g,E=s-2*o(r(-x.north*g)));let I=e.relativeToCenter,v=c(I);I=v?I:m.ZERO;let P=e.includeWebMercatorT??!1,F=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,G=F!==1,X=e.structure??$h.DEFAULT_STRUCTURE,W=X.heightScale??$h.DEFAULT_STRUCTURE.heightScale,A=X.heightOffset??$h.DEFAULT_STRUCTURE.heightOffset,k=X.elementsPerHeight??$h.DEFAULT_STRUCTURE.elementsPerHeight,B=X.stride??$h.DEFAULT_STRUCTURE.stride,O=X.elementMultiplier??$h.DEFAULT_STRUCTURE.elementMultiplier,H=X.isBigEndian??$h.DEFAULT_STRUCTURE.isBigEndian,U=de.computeWidth(x),K=de.computeHeight(x),Q=U/(d-1),ie=K/(u-1);y||(U*=g,K*=g);let j=h.radiiSquared,$=j.x,ne=j.y,be=j.z,Ce=65536,me=-65536,_e=wt.eastNorthUpToFixedFrame(I,h),Ve=M.inverseTransformation(_e,zrt),Ie,Ze;P&&(Ie=Wi.geodeticLatitudeToMercatorAngle(Z),Ze=1/(Wi.geodeticLatitudeToMercatorAngle(E)-Ie));let De=Krt;De.x=Number.POSITIVE_INFINITY,De.y=Number.POSITIVE_INFINITY,De.z=Number.POSITIVE_INFINITY;let Ke=Jrt;Ke.x=Number.NEGATIVE_INFINITY,Ke.y=Number.NEGATIVE_INFINITY,Ke.z=Number.NEGATIVE_INFINITY;let rt=Number.POSITIVE_INFINITY,Xt=d*u,Ht=f>0?d*2+u*2:0,qe=Xt+Ht,mn=new Array(qe),Dt=new Array(qe),Lt=new Array(qe),Vi=P?new Array(qe):[],ln=G?new Array(qe):[],ge=0,Le=u,yn=0,bt=d;p&&(--ge,++Le,--yn,++bt);let ro=1e-5;for(let $e=ge;$e<Le;++$e){let yt=$e;yt<0&&(yt=0),yt>=u&&(yt=u-1);let Bt=x.north-ie*yt;y?Bt=a(Bt):Bt=s-2*o(r(-Bt*g));let Ln=(Bt-Z)/(E-Z);Ln=w.clamp(Ln,0,1);let Io=$e===ge,To=$e===Le-1;f>0&&(Io?Bt+=ro*K:To&&(Bt-=ro*K));let Ka=t(Bt),Ja=n(Bt),Li=be*Ja,bi;P&&(bi=(Wi.geodeticLatitudeToMercatorAngle(Bt)-Ie)*Ze);for(let sa=yn;sa<bt;++sa){let Qr=sa;Qr<0&&(Qr=0),Qr>=d&&(Qr=d-1);let xl=yt*(d*B)+Qr*B,yo;if(k===1)yo=l[xl];else{yo=0;let Ao;if(H)for(Ao=0;Ao<k;++Ao)yo=yo*O+l[xl+Ao];else for(Ao=k-1;Ao>=0;--Ao)yo=yo*O+l[xl+Ao]}yo=yo*W+A,me=Math.max(me,yo),Ce=Math.min(Ce,yo);let wr=x.west+Q*Qr;y?wr=a(wr):wr=wr*g;let gp=(wr-V)/(R-V);gp=w.clamp(gp,0,1);let jr=yt*d+Qr;if(f>0){let Ao=sa===yn,dn=sa===bt-1,Re=Io||To||Ao||dn;if((Io||To)&&(Ao||dn))continue;Re&&(yo-=f,Ao?(jr=Xt+(u-yt-1),wr-=ro*U):To?jr=Xt+u+(d-Qr-1):dn?(jr=Xt+u+d+yt,wr+=ro*U):Io&&(jr=Xt+u+d+u+Qr))}let du=Ka*t(wr),Qa=Ka*n(wr),ex=$*du,aa=ne*Qa,ja=1/i(ex*du+aa*Qa+Li*Ja),ds=ex*ja,uu=aa*ja,mu=Li*ja,fu=new m;fu.x=ds+du*yo,fu.y=uu+Qa*yo,fu.z=mu+Ja*yo,M.multiplyByPoint(Ve,fu,Hj),m.minimumByComponent(Hj,De,De),m.maximumByComponent(Hj,Ke,Ke),rt=Math.min(rt,yo),mn[jr]=fu,Lt[jr]=new D(gp,Ln),Dt[jr]=yo,P&&(Vi[jr]=bi),G&&(ln[jr]=h.geodeticSurfaceNormal(fu))}}let Xo=ue.fromPoints(mn),ra;c(S)&&(ra=Xn.fromRectangle(S,Ce,me,h));let Wr;v&&(Wr=new kb(h).computeHorizonCullingPointPossiblyUnderEllipsoid(I,mn,Ce));let _s=new J0(De,Ke,I),Ae=new Rc(I,_s,rt,me,_e,!1,P,G,F,N),st=new Float32Array(qe*Ae.stride),Qe=0;for(let $e=0;$e<qe;++$e)Qe=Ae.encode(st,Qe,mn[$e],Lt[$e],Dt[$e],void 0,Vi[$e],ln[$e]);return{vertices:st,maximumHeight:me,minimumHeight:Ce,encoding:Ae,boundingSphere3D:Xo,orientedBoundingBox:ra,occludeePointInScaledSpace:Wr}};var YV=$h;var KGi=_(T(),1);function Lg(){L.throwInstantiationError()}Object.defineProperties(Lg.prototype,{credits:{get:L.throwInstantiationError},waterMask:{get:L.throwInstantiationError}});Lg.prototype.interpolateHeight=L.throwInstantiationError;Lg.prototype.isChildAvailable=L.throwInstantiationError;Lg.prototype.createMesh=L.throwInstantiationError;Lg.prototype.upsample=L.throwInstantiationError;Lg.prototype.wasCreatedByUpsampling=L.throwInstantiationError;Lg.maximumAsynchronousTasks=5;var Ff=Lg;var QGi=_(T(),1);function Qrt(e,t,n,i,o,r,s,a,l,d,u,f,p,y,h,g){this.center=e,this.vertices=t,this.stride=d??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=u,this.encoding=f,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=y,this.eastIndicesNorthToSouth=h,this.northIndicesWestToEast=g}var dm=Qrt;var nEi=_(T(),1);function ml(){L.throwInstantiationError()}Object.defineProperties(ml.prototype,{errorEvent:{get:L.throwInstantiationError},credit:{get:L.throwInstantiationError},tilingScheme:{get:L.throwInstantiationError},hasWaterMask:{get:L.throwInstantiationError},hasVertexNormals:{get:L.throwInstantiationError},availability:{get:L.throwInstantiationError}});var hye=[];ml.getRegularGridIndices=function(e,t){if(e*t>=w.FOUR_GIGABYTES)throw new L("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=hye[e];c(n)||(hye[e]=n=[]);let i=n[t];return c(i)||(e*t<w.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),gye(e,t,i,0)),i};var pye=[];ml.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=w.FOUR_GIGABYTES)throw new L("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=pye[e];c(n)||(pye[e]=n=[]);let i=n[t];if(!c(i)){let o=ml.getRegularGridIndices(e,t),r=yye(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,l=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:l,northIndicesWestToEast:d}}return i};var bye=[];ml.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=w.FOUR_GIGABYTES)throw new L("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=bye[e];c(n)||(bye[e]=n=[]);let i=n[t];if(!c(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,l=o+s,d=r+a,u=yye(e,t),f=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,y=u.eastIndicesNorthToSouth,h=u.northIndicesWestToEast,g=Me.createTypedArray(l,d);gye(e,t,g,0),ml.addSkirtIndices(f,p,y,h,o,g,r),i=n[t]={indices:g,westIndicesSouthToNorth:f,southIndicesEastToWest:p,eastIndicesNorthToSouth:y,northIndicesWestToEast:h,indexCountWithoutSkirts:r}}return i};ml.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=wO(e,a,r,s),a+=e.length,s=wO(t,a,r,s),a+=t.length,s=wO(n,a,r,s),a+=n.length,wO(i,a,r,s)};function yye(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 gye(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,l=a+e,d=l+1,u=a+1;n[i++]=a,n[i++]=l,n[i++]=u,n[i++]=u,n[i++]=l,n[i++]=d,++o}++o}}function wO(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}ml.heightmapTerrainQuality=.25;ml.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*ml.heightmapTerrainQuality/(t*n)};ml.prototype.requestTileGeometry=L.throwInstantiationError;ml.prototype.getLevelMaximumGeometricError=L.throwInstantiationError;ml.prototype.getTileDataAvailable=L.throwInstantiationError;ml.prototype.loadTileDataAvailability=L.throwInstantiationError;var rs=ml;function a0(e){if(!c(e)||!c(e.buffer))throw new L("options.buffer is required.");if(!c(e.width))throw new L("options.width is required.");if(!c(e.height))throw new L("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??cm.NONE;let t=YV.DEFAULT_STRUCTURE,n=e.structure;c(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===cm.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(a0.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var xye="createVerticesFromHeightmap",jrt=new gi(xye),qrt=new gi(xye,Ff.maximumAsynchronousTasks);a0.prototype.createMesh=function(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);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,l=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=l.cartographicToCartesian(de.center(u)),p=this._structure,h=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(h*4,1e3);let x=(a?qrt:jrt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:f,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Xi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!c(x))return;let S=this;return Promise.resolve(x).then(function(V){let Z;S._skirtHeight>0?Z=rs.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):Z=rs.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let R=V.gridWidth*V.gridHeight;return S._mesh=new dm(f,new Float32Array(V.vertices),Z.indices,Z.indexCountWithoutSkirts,R,V.minimumHeight,V.maximumHeight,ue.clone(V.boundingSphere3D),m.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,Xn.clone(V.orientedBoundingBox),Rc.clone(V.encoding),Z.westIndicesSouthToNorth,Z.southIndicesEastToWest,Z.eastIndicesNorthToSouth,Z.northIndicesWestToEast),S._buffer=void 0,S._mesh})};a0.prototype._createMeshSync=function(e){C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(de.center(d)),f=this._structure,y=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(y*4,1e3);let h=YV.computeVertices({heightmap:this._buffer,structure:f,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Xi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let g;this._skirtHeight>0?g=rs.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):g=rs.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let x=h.gridWidth*h.gridHeight;return this._mesh=new dm(u,h.vertices,g.indices,g.indexCountWithoutSkirts,x,h.minimumHeight,h.maximumHeight,h.boundingSphere3D,h.occludeePointInScaledSpace,h.encoding.stride,h.orientedBoundingBox,h.encoding,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),this._mesh};a0.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,l=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,f=r.heightScale,p=c(this._mesh),y=this._encoding===cm.LERC;if(!p&&y)return;let g;if(p){let x=this._mesh.vertices,S=this._mesh.encoding;g=_ye(x,S,u,f,e,i,o,t,n)}else g=$rt(this._buffer,a,l,s,d,e,i,o,t,n),g=g*f+u;return g};a0.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new L("tilingScheme is required.");if(!c(t))throw new L("thisX is required.");if(!c(n))throw new L("thisY is required.");if(!c(i))throw new L("thisLevel is required.");if(!c(o))throw new L("descendantX is required.");if(!c(r))throw new L("descendantY is required.");if(!c(s))throw new L("descendantLevel is required.");if(s-i>1)throw new L("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(l))return;let d=this._width,u=this._height,f=this._structure,p=f.stride,y=new this._bufferType(d*u*p),h=l.vertices,g=l.encoding,x=e.tileXYToRectangle(t,n,i),S=e.tileXYToRectangle(o,r,s),V=f.heightOffset,Z=f.heightScale,R=f.elementsPerHeight,E=f.elementMultiplier,I=f.isBigEndian,v=Math.pow(E,R-1);for(let P=0;P<u;++P){let F=w.lerp(S.north,S.south,P/(u-1));for(let N=0;N<d;++N){let b=w.lerp(S.west,S.east,N/(d-1)),G=_ye(h,g,V,Z,x,d,u,b,F);G=G<f.lowestEncodedHeight?f.lowestEncodedHeight:G,G=G>f.highestEncodedHeight?f.highestEncodedHeight:G,est(y,R,E,v,p,I,P*d+N,G)}}return Promise.resolve(new a0({buffer:y,width:d,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};a0.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new L("thisX is required.");if(!c(t))throw new L("thisY is required.");if(!c(n))throw new L("childX is required.");if(!c(i))throw new L("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};a0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function $rt(e,t,n,i,o,r,s,a,l,d){let u=(l-r.west)*(s-1)/(r.east-r.west),f=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,y=p+1;y>=s&&(y=s-1,p=s-2);let h=f|0,g=h+1;g>=a&&(g=a-1,h=a-2);let x=u-p,S=f-h;h=a-1-h,g=a-1-g;let V=PO(e,t,n,i,o,h*s+p),Z=PO(e,t,n,i,o,h*s+y),R=PO(e,t,n,i,o,g*s+p),E=PO(e,t,n,i,o,g*s+y);return Tye(x,S,V,Z,R,E)}function _ye(e,t,n,i,o,r,s,a,l){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(l-o.south)*(s-1)/(o.north-o.south),f=d|0,p=f+1;p>=r&&(p=r-1,f=r-2);let y=u|0,h=y+1;h>=s&&(h=s-1,y=s-2);let g=d-f,x=u-y;y=s-1-y,h=s-1-h;let S=(t.decodeHeight(e,y*r+f)-n)/i,V=(t.decodeHeight(e,y*r+p)-n)/i,Z=(t.decodeHeight(e,h*r+f)-n)/i,R=(t.decodeHeight(e,h*r+p)-n)/i;return Tye(g,x,S,V,Z,R)}function Tye(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function PO(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 est(e,t,n,i,o,r,s,a){s*=o;let l;if(r)for(l=0;l<t-1;++l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;else for(l=t-1;l>0;--l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;e[s+l]=a}var Da=a0;function HV(e){e=e??z.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??re.default})),this._levelZeroMaximumGeometricError=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye}Object.defineProperties(HV.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(){}}});HV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Da({buffer:new Uint8Array(16*16),width:16,height:16}))};HV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};HV.prototype.getTileDataAvailable=function(e,t,n){};HV.prototype.loadTileDataAvailability=function(e,t,n){};var ep=HV;var DEi=_(T(),1);var vEi=_(T(),1);var tst=new D;function nst(e,t){C.typeOf.object("clippingPlaneCollection",e),C.typeOf.object("context",t);let n=e.unionClippingRegions,i=e.length,o=hs.useFloatTexture(t),r=hs.getTextureResolution(e,t,tst),s=r.x,a=r.y,l=o?rst(s,a):sst(s,a);return l+=`
`,l+=n?ist(i):ost(i),l}function ist(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;
           break;
        }
    }
    if (breakAndDiscard) {
        discard;
    }
    return clipAmount;
}
`}function ost(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 rst(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});
    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 sst(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});
    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 c0=nst;function ast(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 zj(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function cst(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case se.SCENE3D:o=t;break;case se.SCENE2D:case se.COLUMBUS_VIEW:o=n;break;case se.MORPHING:o=i;break}return o}function lst(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 dst(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 ust(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}zj.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,l=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,f=e.applySplit,p=e.hasWaterMask,y=e.showReflectiveOcean,h=e.showOceanWaves,g=e.enableLighting,x=e.dynamicAtmosphereLighting,S=e.dynamicAtmosphereLightingFromSun,V=e.showGroundAtmosphere,Z=e.perFragmentGroundAtmosphere,R=e.hasVertexNormals,E=e.useWebMercatorProjection,I=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,F=e.enableClippingPolygons,N=e.clippingPolygons,b=e.clippedByBoundaries,G=e.hasImageryLayerCutout,X=e.colorCorrect,W=e.highlightFillTile,A=e.colorToAlpha,k=e.hasGeodeticSurfaceNormals,B=e.hasExaggeration,O=e.showUndergroundColor,H=e.translucent,U=0,K="",ie=n.renderedMesh.encoding;ie.quantization===qs.BITS12&&(U=1,K="QUANTIZATION_BITS12");let $=0,ne="";b&&($=1,ne="TILE_LIMIT_RECTANGLE");let be=0,Ce="";G&&(be=1,Ce="APPLY_IMAGERY_CUTOUT");let me=t.mode,_e=me|o<<2|r<<3|s<<4|a<<5|l<<6|d<<7|p<<8|y<<9|h<<10|g<<11|x<<12|S<<13|V<<14|Z<<15|R<<16|E<<17|I<<18|U<<19|f<<20|v<<21|F<<22|$<<23|be<<24|X<<25|W<<26|A<<27|k<<28|B<<29|O<<30|H<<31|u<<32,Ve=0;c(P)&&P.length>0&&(Ve=v?P.clippingPlanesState:0);let Ie=0;c(N)&&N.length>0&&(Ie=F?N.clippingPolygonsState:0);let Ze=n.surfaceShader;if(c(Ze)&&Ze.numberOfDayTextures===i&&Ze.flags===_e&&Ze.material===this.material&&Ze.clippingShaderState===Ve&&Ze.clippingPolygonShaderState===Ie)return Ze.shaderProgram;let De=this._shadersByTexturesFlags[i];if(c(De)||(De=this._shadersByTexturesFlags[i]=[]),Ze=De[_e],!c(Ze)||Ze.material!==this.material||Ze.clippingShaderState!==Ve||Ze.clippingPolygonShaderState!==Ie){let Ke=this.baseVertexShaderSource.clone(),rt=this.baseFragmentShaderSource.clone();Ve!==0&&rt.sources.unshift(c0(P,t.context)),Ie!==0&&(rt.sources.unshift(lst(t.context)),Ke.sources.unshift(dst(t.context))),Ke.defines.push(K),rt.defines.push(`TEXTURE_UNITS ${i}`,ne,Ce),o&&rt.defines.push("APPLY_BRIGHTNESS"),r&&rt.defines.push("APPLY_CONTRAST"),s&&rt.defines.push("APPLY_HUE"),a&&rt.defines.push("APPLY_SATURATION"),l&&rt.defines.push("APPLY_GAMMA"),d&&rt.defines.push("APPLY_ALPHA"),u&&rt.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&rt.defines.push("HAS_WATER_MASK"),y&&(rt.defines.push("SHOW_REFLECTIVE_OCEAN"),Ke.defines.push("SHOW_REFLECTIVE_OCEAN")),h&&rt.defines.push("SHOW_OCEAN_WAVES"),A&&rt.defines.push("APPLY_COLOR_TO_ALPHA"),O&&(Ke.defines.push("UNDERGROUND_COLOR"),rt.defines.push("UNDERGROUND_COLOR")),H&&(Ke.defines.push("TRANSLUCENT"),rt.defines.push("TRANSLUCENT")),g&&(R?(Ke.defines.push("ENABLE_VERTEX_LIGHTING"),rt.defines.push("ENABLE_VERTEX_LIGHTING")):(Ke.defines.push("ENABLE_DAYNIGHT_SHADING"),rt.defines.push("ENABLE_DAYNIGHT_SHADING"))),x&&(Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),rt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),S&&(Ke.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),rt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),V&&(Ke.defines.push("GROUND_ATMOSPHERE"),rt.defines.push("GROUND_ATMOSPHERE"),Z&&(Ke.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),rt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Ke.defines.push("INCLUDE_WEB_MERCATOR_Y"),rt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Ke.defines.push("FOG"),rt.defines.push("FOG")),f&&rt.defines.push("APPLY_SPLIT"),v&&rt.defines.push("ENABLE_CLIPPING_PLANES"),F&&(rt.defines.push("ENABLE_CLIPPING_POLYGONS"),Ke.defines.push("ENABLE_CLIPPING_POLYGONS"),N.inverse&&rt.defines.push("CLIPPING_INVERSE"),rt.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`),Ke.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${N.extentsCount}`)),X&&rt.defines.push("COLOR_CORRECT"),W&&rt.defines.push("HIGHLIGHT_FILL_TILE"),k&&Ke.defines.push("GEODETIC_SURFACE_NORMALS"),B&&Ke.defines.push("EXAGGERATION");let Xt=`    vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
    {
        vec4 color = initialColor;
`;G&&(Xt+=`        vec4 cutoutAndColorResult;
        bool texelUnclipped;
`);for(let qe=0;qe<i;++qe)G?Xt+=`        cutoutAndColorResult = u_dayTextureCutoutRectangles[${qe}];
        texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
        cutoutAndColorResult = sampleAndBlend(
`:Xt+=`        color = sampleAndBlend(
`,Xt+=`            color,
            u_dayTextures[${qe}],
            u_dayTextureUseWebMercatorT[${qe}] ? textureCoordinates.xz : textureCoordinates.xy,
            u_dayTextureTexCoordsRectangle[${qe}],
            u_dayTextureTranslationAndScale[${qe}],
            ${d?`u_dayTextureAlpha[${qe}]`:"1.0"},
            ${u?`u_dayTextureNightAlpha[${qe}]`:"1.0"},
${u?`u_dayTextureDayAlpha[${qe}]`:"1.0"},
${o?`u_dayTextureBrightness[${qe}]`:"0.0"},
            ${r?`u_dayTextureContrast[${qe}]`:"0.0"},
            ${s?`u_dayTextureHue[${qe}]`:"0.0"},
            ${a?`u_dayTextureSaturation[${qe}]`:"0.0"},
            ${l?`u_dayTextureOneOverGamma[${qe}]`:"0.0"},
            ${f?`u_dayTextureSplit[${qe}]`:"0.0"},
            ${A?`u_colorsToAlpha[${qe}]`:"vec4(0.0)"},
        nightBlend        );
`,G&&(Xt+=`        color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);Xt+=`        return color;
    }`,rt.sources.push(Xt),Ke.sources.push(cst(me)),Ke.sources.push(ust(E));let Ht=tn.fromCache({context:t.context,vertexShaderSource:Ke,fragmentShaderSource:rt,attributeLocations:ie.getAttributeLocations()});Ze=De[_e]=new ast(i,_e,this.material,Ht,Ve,Ie)}return n.surfaceShader=Ze,Ze.shaderProgram};zj.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!c(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],c(t)&&t.shaderProgram.destroy())}return he(this)};var qv=zj;var Kvi=_(T(),1);var YEi=_(T(),1),mst={NONE:-1,PARTIAL:0,FULL:1},yr=Object.freeze(mst);var XXi=_(T(),1);var JEi=_(T(),1);function vO(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}vO.reportError=function(e,t,n,i,o,r,s,a){let l=e;return c(e)?(l.provider=t,l.message=i,l.x=o,l.y=r,l.level=s,l.retry=!1,l.error=a,++l.timesRetried):l=new vO(t,i,o,r,s,0,a),c(n)&&n.numberOfListeners>0?n.raiseEvent(l):c(t)&&console.log(`An error occurred in "${t.constructor.name}": ${qh(i)}`),l};vO.reportSuccess=function(e){c(e)&&(e.timesRetried=-1)};var Ro=vO;var jEi=_(T(),1),fst={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ci=Object.freeze(fst);var $Ei=_(T(),1),hst={START:0,LOADING:1,DONE:2,FAILED:3},$s=Object.freeze(hst);var tXi=_(T(),1),pst={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},uo=Object.freeze(pst);function sr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new m,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=uo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ue,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(sr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===uo.RECEIVING||e===uo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!c(s.loadingImagery)||s.loadingImagery.state!==ci.TRANSITIONING}return n}},renderedMesh:{get:function(){if(c(this.vertexArray))return this.mesh;if(c(this.fill))return this.fill.mesh}}});var bst=new pe;function Kj(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(c(t)&&t!==se.SCENE3D){let l=n.ellipsoid.cartesianToCartographic(s,bst);s=n.project(l,r),s=m.fromElements(s.z,s.x,s.y,r)}return s}var yst=new m,gst=new m,xst=new m;sr.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!c(r))return;let s=r.vertices,a=r.indices,l=r.encoding,d=a.length,u=Number.MAX_VALUE;for(let f=0;f<d;f+=3){let p=a[f],y=a[f+1],h=a[f+2],g=Kj(l,t,n,s,p,yst),x=Kj(l,t,n,s,y,gst),S=Kj(l,t,n,s,h,xst),V=qn.rayTriangleParametric(e,g,x,S,i);c(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?bn.getPoint(e,u,o):void 0};sr.prototype.freeResources=function(){c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=uo.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()};sr.prototype.freeVertexArray=function(){sr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,sr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};sr.initialize=function(e,t,n){let i=e.data;c(i)||(i=e.data=new sr),e.state===$s.START&&(_st(e,t,n),e.state=$s.LOADING)};sr.processStateMachine=function(e,t,n,i,o,r,s){sr.initialize(e,n,i);let a=e.data;if(e.state===$s.LOADING&&Tst(e,t,n,i,o,r),s)return;let l=e.renderable;e.renderable=c(a.vertexArray);let d=a.terrainState===uo.READY;e.upsampledFromParent=c(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let f=e._loadedCallbacks,p={};for(let y in f)f.hasOwnProperty(y)&&(f[y](e)||(p[y]=f[y]));e._loadedCallbacks=p,e.state=$s.DONE}l&&(e.renderable=!0)};sr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,l=o.imagery,d,u;for(d=0,u=l.length;d<u;++d){let f=l[d];if(!c(f.loadingImagery)){r=!1;continue}if(f.loadingImagery.state===ci.PLACEHOLDER){let y=f.loadingImagery.imageryLayer;if(y.ready){f.freeResources(),l.splice(d,1),y._createTileImagerySkeletons(e,t,d),--d,u=l.length;continue}else r=!1}let p=f.processStateMachine(e,n,i);a=a&&p,s=s||p||c(f.readyImagery),r=r&&c(f.loadingImagery)&&(f.loadingImagery.state===ci.FAILED||f.loadingImagery.state===ci.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function Sye(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,l=Rc.clone(s);l.hasGeodeticSurfaceNormals=t,l=Rc.clone(l);let d=l.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(sr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=sr._createVertexArrayForMesh(i.context,o)):(sr._freeVertexArray(e.vertexArray),e.vertexArray=sr._createVertexArrayForMesh(i.context,o)),sr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}sr.prototype.addGeodeticSurfaceNormals=function(e,t){Sye(this,!0,e,t)};sr.prototype.removeGeodeticSurfaceNormals=function(e){Sye(this,!1,void 0,e)};sr.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,l=o.encoding,d=l.exaggeration!==r,u=l.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!l.hasGeodeticSurfaceNormals){let f=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(f,t)}else!a&&l.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(l.exaggeration=r,l.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let f=e.customData,p=f.length;for(let y=0;y<p;y++){let h=f[y];h.level=-1}}}};function _st(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!c(i)&&c(e.parent)){let o=e.parent,r=o.data;c(r)&&c(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=uo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Tst(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===uo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||sr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===uo.FAILED&&Sst(s,e,t,n,e.x,e.y,e.level),s.terrainState===uo.UNLOADED&&Cst(s,n,e.x,e.y,e.level),s.terrainState===uo.RECEIVED&&Lst(s,t,n,e.x,e.y,e.level),s.terrainState===uo.TRANSFORMED&&(Zst(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=uo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Gst(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);c(d)&&c(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function Sst(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=$s.FAILED;return}let l=a.data.terrainData,d=a.x,u=a.y,f=a.level;if(!c(l))return;let p=l.upsample(i.tilingScheme,d,u,f,o,r,s);c(p)&&(e.terrainState=uo.RECEIVING,Promise.resolve(p).then(function(y){c(y)&&(e.terrainData=y,e.terrainState=uo.RECEIVED)}).catch(function(){e.terrainState=uo.FAILED}))}function Cst(e,t,n,i,o){function r(l){if(!c(l)){e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainData=l,e.terrainState=uo.RECEIVED,e.request=void 0}function s(l){if(e.request.state===jn.CANCELLED){e.terrainData=void 0,e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainState=uo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${l}"`;t._requestError=Ro.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let l=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN});e.request=l;let d=t.requestTileGeometry(n,i,o,l);c(d)?(e.terrainState=uo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=uo.UNLOADED,e.request=void 0)}a()}var Vst={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Lst(e,t,n,i,o,r){let s=n.tilingScheme,a=Vst;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);c(d)&&(e.terrainState=uo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=uo.TRANSFORMED}).catch(function(){e.terrainState=uo.FAILED}))}sr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=_t.createVertexBuffer({context:e,typedArray:n,usage:Ne.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!c(s)||s.isDestroyed()){let a=t.indices;s=_t.createIndexBuffer({context:e,typedArray:a,usage:Ne.STATIC_DRAW,indexDatatype:Me.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ni({context:e,attributes:o,indexBuffer:s})};sr._freeVertexArray=function(e){if(c(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),c(t)&&!t.isDestroyed()&&c(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Zst(e,t,n,i,o,r,s){e.vertexArray=sr._createVertexArrayForMesh(t,e.mesh),e.terrainState=uo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Rst(e){let t=e.cache.tile_waterMaskData;if(!c(t)){let n=Pt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Gst(e,t){let n=t.terrainData.waterMask,i=Rst(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Pt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ce.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}sr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;c(t)&&(!c(t.data)||!c(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};sr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,l=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=l*(o.south-i.south)/s,n.z=a,n.w=l,n};var um=sr;var T2i=_(T(),1);var VPi=_(T(),1);var yPi=_(T(),1);var WIi=_(T(),1);var MXi=_(T(),1);function Zg(e){if(e=e??z.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??re.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Wi(this._ellipsoid),c(e.rectangleSouthwestInMeters)&&c(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new D(-i,-i),this._rectangleNortheastInMeters=new D(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new de(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Zg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Zg.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Zg.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Zg.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(de.southwest(e)),o=n.project(de.northeast(e));return c(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new de(i.x,i.y,o.x,o.y)};Zg.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,l=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,f=this._rectangleNortheastInMeters.y-(t+1)*d;return c(i)?(i.west=a,i.south=f,i.east=l,i.north=u,i):new de(a,f,l,u)};Zg.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new D(o.west,o.south)),a=r.unproject(new D(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};Zg.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!de.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._projection.project(e),p=f.x-this._rectangleSouthwestInMeters.x,y=this._rectangleNortheastInMeters.y-f.y,h=p/a|0;h>=o&&(h=o-1);let g=y/d|0;return g>=r&&(g=r-1),c(n)?(n.x=h,n.y=g,n):new D(h,g)};var ss=Zg;var DXi=_(T(),1);var Jj,Cye="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",zV={};zV.defaultAccessToken=Cye;zV.defaultWorldImageryServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});zV.defaultWorldHillshadeServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});zV.defaultWorldOceanServer=new Ge({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});zV.getDefaultTokenCredit=function(e){if(e===Cye){if(!c(Jj)){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>';Jj=new Ct(t,!0)}return Jj}};var Jd=zV;var QXi=_(T(),1);function Qj(e){if(e=e??z.EMPTY_OBJECT,!c(e.missingImageUrl))throw new L("options.missingImageUrl is required.");if(!c(e.pixelsToCheck))throw new L("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ge.createIfNeeded(e.missingImageUrl),n=this;function i(r){c(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Rm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,l=r.width,d=e.pixelsToCheck;for(let u=0,f=d.length;a&&u<f;++u){let p=d[u],y=p.x*4+p.y*l;s[y+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)}Qj.prototype.isReady=function(){return this._isReady};Qj.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new L("shouldDiscardImage must not be called before the discard policy is ready.");let t=this._pixelsToCheck,n=this._missingImagePixels;if(!c(n)||c(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Rm(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],l=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=l+d;if(i[u]!==n[u])return!1}}return!0};var $v=Qj;var $Xi=_(T(),1);function jj(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}jj.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)}c(n)&&(this.name=e[n])};jj.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];c(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 Af=jj;var sIi=_(T(),1);function KV(){L.throwInstantiationError()}Object.defineProperties(KV.prototype,{rectangle:{get:L.throwInstantiationError},tileWidth:{get:L.throwInstantiationError},tileHeight:{get:L.throwInstantiationError},maximumLevel:{get:L.throwInstantiationError},minimumLevel:{get:L.throwInstantiationError},tilingScheme:{get:L.throwInstantiationError},tileDiscardPolicy:{get:L.throwInstantiationError},errorEvent:{get:L.throwInstantiationError},credit:{get:L.throwInstantiationError},proxy:{get:L.throwInstantiationError},hasAlphaChannel:{get:L.throwInstantiationError}});KV.prototype.getTileCredits=function(e,t,n){L.throwInstantiationError()};KV.prototype.requestImage=function(e,t,n,i){L.throwInstantiationError()};KV.prototype.pickFeatures=function(e,t,n,i,o){L.throwInstantiationError()};var Est=/\.ktx2$/i;KV.loadImage=function(e,t){C.defined("url",t);let n=Ge.createIfNeeded(t);return Est.test(n.url)?Ll(n):c(e)&&c(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var fl=KV;var cIi=_(T(),1),Xst={SATELLITE:1,OCEANS:2,HILLSHADE:3},Mf=Object.freeze(Xst);function Vye(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ki({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Ct(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}Vye.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&&!c(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new $v({missingImageUrl:Lye(e,0,0,this.maximumLevel).url,pixelsToCheck:[new D(0,0),new D(200,20),new D(20,200),new D(80,110),new D(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Ist(e,t){let n=e.tileInfo;if(!c(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 ss({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ki({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new le(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,c(e.fullExtent)){if(c(e.fullExtent.spatialReference)&&c(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Wi,o=e.fullExtent,r=i.unproject(new m(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new m(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new de(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=de.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new le(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}c(e.copyrightText)&&e.copyrightText.length>0&&(c(t.credit)?t.tileCredits=[new Ct(e.copyrightText)]:t.credit=new Ct(e.copyrightText))}function Wst(e,t){let n=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(n+=`: ${t.message}`),new le(n)}async function wst(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Ist(i,t)}catch(i){Wst(e,i)}}function tp(e){e=e??z.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 Ki({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 Ct(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new ye}tp.fromBasemapType=async function(e,t){C.defined("style",e),t=t??z.EMPTY_OBJECT;let n,i,o;switch(e){case Mf.SATELLITE:{n=t.token??Jd.defaultAccessToken,i=Ge.createIfNeeded(Jd.defaultWorldImageryServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);c(r)&&(o=Ct.clone(r))}break;case Mf.OCEANS:{n=t.token??Jd.defaultAccessToken,i=Ge.createIfNeeded(Jd.defaultWorldOceanServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);c(r)&&(o=Ct.clone(r))}break;case Mf.HILLSHADE:{n=t.token??Jd.defaultAccessToken,i=Ge.createIfNeeded(Jd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Jd.getDefaultTokenCredit(n);c(r)&&(o=Ct.clone(r))}break;default:throw new L(`Unsupported basemap type: ${e}`)}return tp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Lye(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),l={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Xi?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:l})}return r}Object.defineProperties(tp.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}}});tp.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&n.setQueryParameters({token:t.token});let i=new tp(t);i._resource=n;let o=new Vye(t);return(t.usePreCachedTilesIfAvailable??!0)&&await wst(n,o),o.build(i),i};tp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};tp.prototype.requestImage=function(e,t,n,i){return fl.loadImage(this,Lye(this,e,t,n,i))};tp.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,l;if(this._tilingScheme.projection instanceof Xi)s=w.toDegrees(i),a=w.toDegrees(o),l="4326";else{let p=this._tilingScheme.projection.project(new pe(i,o,0));s=p.x,a=p.y,l="3857"}let d="visible";c(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:l,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let y=[],h=p.results;if(!c(h))return y;for(let g=0;g<h.length;++g){let x=h[g],S=new Af;if(S.data=x,S.name=x.value,S.properties=x.attributes,S.configureDescriptionFromProperties(x.attributes),x.geometryType==="esriGeometryPoint"&&x.geometry){let V=x.geometry.spatialReference&&x.geometry.spatialReference.wkid?x.geometry.spatialReference.wkid:4326;if(V===4326||V===4283)S.position=pe.fromDegrees(x.geometry.x,x.geometry.y,x.geometry.z);else if(V===102100||V===900913||V===3857){let Z=new Wi;S.position=Z.unproject(new m(x.geometry.x,x.geometry.y,x.geometry.z))}}y.push(S)}return y})};tp._metadataCache={};var l0=tp;var eWi=_(T(),1);var PIi=_(T(),1),Pst={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"},JV=Object.freeze(Pst);var AIi=_(T(),1);function eF(e){}eF.prototype.isReady=function(){return!0};eF.prototype.shouldDiscardImage=function(e){return eF.EMPTY_IMAGE===e};var FO;Object.defineProperties(eF,{EMPTY_IMAGE:{get:function(){return c(FO)||(FO=new Image,FO.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),FO}}});var QV=eF;function Zye(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}Zye.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 Ct)break;o.credit=new Ct(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let l=r[s],d=l.bbox;l.bbox=new de(w.toRadians(d[1]),w.toRadians(d[0]),w.toRadians(d[3]),w.toRadians(d[2]))}}};function vst(e,t){if(e.resourceSets.length!==1)throw new le("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;c(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>c(r.bbox)))),t.attributionList=i}function Fst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i+=`: ${t.message}`),Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new le(i)}async function Ast(e,t,n){let i=e.url,o=Ws._metadataCache[i];c(o)||(o=e.fetchJsonp("jsonp"),Ws._metadataCache[i]=o);try{let r=await o;return vst(r,t)}catch(r){Fst(e,r,n)}}function Ws(e){e=e??z.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??JV.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new QV),this._proxy=e.proxy,this._credit=new Ct(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Ws.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new ss({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 ye}Object.defineProperties(Ws.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 c(this.mapLayer)}}});Ws.fromUrl=async function(e,t){t=t??z.EMPTY_OBJECT,C.defined("url",e),C.defined("options.key",t.key);let n=t.tileProtocol;c(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??JV.AERIAL,o=Ge.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};c(t.mapLayer)&&(r.mapLayer=t.mapLayer),c(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Ws(t);a._resource=o;let l=new Zye(t);return await Ast(s,l),l.build(a),a};var Mst=new de;Ws.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Mst);return Ust(this._attributionList,n,i)};Ws.prototype.requestImage=function(e,t,n,i){let o=fl.loadImage(this,Nst(this,e,t,n,i));if(c(o))return o.catch(function(r){return c(r.blob)&&r.blob.size===0?QV.EMPTY_IMAGE:Promise.reject(r)})};Ws.prototype.pickFeatures=function(e,t,n,i,o){};Ws.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Ws.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&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Ws._logoUrl=void 0;Object.defineProperties(Ws,{logoUrl:{get:function(){return c(Ws._logoUrl)||(Ws._logoUrl=on("Assets/Images/bing_maps_credit.png")),Ws._logoUrl},set:function(e){C.defined("value",e),Ws._logoUrl=e}}});function Nst(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:Ws.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var kst=new de;function Ust(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,l=!1;for(let d=0,u=s.coverageAreas.length;!l&&d<u;++d){let f=a[d];if(t>=f.zoomMin&&t<=f.zoomMax){let p=de.intersection(n,f.bbox,kst);c(p)&&(l=!0)}}l&&i.push(s.credit)}return i}Ws._metadataCache={};var tF=Ws;var wWi=_(T(),1);var yWi=_(T(),1);var Rye=/{[^}]+}/g,Gye={x:Yst,y:zst,z:Qst,s:jst,reverseX:Hst,reverseY:Kst,reverseZ:Jst,westDegrees:qst,southDegrees:$st,eastDegrees:eat,northDegrees:tat,westProjected:nat,southProjected:iat,eastProjected:oat,northProjected:rat,width:sat,height:aat},Ost=St(Gye,{i:cat,j:lat,reverseI:dat,reverseJ:uat,longitudeDegrees:fat,latitudeDegrees:hat,longitudeProjected:pat,latitudeProjected:bat,format:gat});function nF(e){e=e??z.EMPTY_OBJECT,this._errorEvent=new ye,C.defined("options.url",e.url);let t=Ge.createIfNeeded(e.url),n=Ge.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():c(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 ss({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=de.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Ct(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=St(Gye,r),a=St(Ost,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(nF.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}}});nF.prototype.getTileCredits=function(e,t,n){};nF.prototype.requestImage=function(e,t,n,i){return fl.loadImage(this,Dst(this,e,t,n,i))};nF.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!c(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function l(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=Bst(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(l):d.type==="xml"?u.fetchXML().then(d.callback).catch(l):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(l):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(l)}return l()};var AO=!1,Qd=new de,MO=!1,iF=new de;function Dst(e,t,n,i,o){AO=!1,MO=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,l={},d=s.match(Rye);return c(d)&&d.forEach(function(u){let f=u.substring(1,u.length-1);c(a[f])&&(l[f]=a[f](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:l})}var qj=!1,qV=new D,$j=!1;function Bst(e,t,n,i,o,r,s){AO=!1,MO=!1,qj=!1,$j=!1;let a=e._pickFeaturesResource,l=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},f=l.match(Rye);return c(f)&&f.forEach(function(p){let y=p.substring(1,p.length-1);c(d[y])&&(u[y]=d[y](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function $V(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 Yst(e,t,n,i){return $V(e,"{x}",t)}function Hst(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return $V(e,"{reverseX}",o)}function zst(e,t,n,i){return $V(e,"{y}",n)}function Kst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return $V(e,"{reverseY}",o)}function Jst(e,t,n,i){let o=e.maximumLevel,r=c(o)&&i<o?o-i-1:i;return $V(e,"{reverseZ}",r)}function Qst(e,t,n,i){return $V(e,"{z}",i)}function jst(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function NO(e,t,n,i){AO||(e.tilingScheme.tileXYToRectangle(t,n,i,Qd),Qd.west=w.toDegrees(Qd.west),Qd.south=w.toDegrees(Qd.south),Qd.east=w.toDegrees(Qd.east),Qd.north=w.toDegrees(Qd.north),AO=!0)}function qst(e,t,n,i){return NO(e,t,n,i),Qd.west}function $st(e,t,n,i){return NO(e,t,n,i),Qd.south}function eat(e,t,n,i){return NO(e,t,n,i),Qd.east}function tat(e,t,n,i){return NO(e,t,n,i),Qd.north}function kO(e,t,n,i){MO||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,iF),MO=!0)}function nat(e,t,n,i){return kO(e,t,n,i),iF.west}function iat(e,t,n,i){return kO(e,t,n,i),iF.south}function oat(e,t,n,i){return kO(e,t,n,i),iF.east}function rat(e,t,n,i){return kO(e,t,n,i),iF.north}function sat(e,t,n,i){return e.tileWidth}function aat(e,t,n,i){return e.tileHeight}function cat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),qV.x}function lat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),qV.y}function dat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),e.tileWidth-qV.x-1}function uat(e,t,n,i,o,r,s){return UO(e,t,n,i,o,r),e.tileHeight-qV.y-1}var mat=new de,jV=new m;function UO(e,t,n,i,o,r,s){if(qj)return;e4(e,t,n,i,o,r);let a=jV,l=e.tilingScheme.tileXYToNativeRectangle(t,n,i,mat);qV.x=e.tileWidth*(a.x-l.west)/l.width|0,qV.y=e.tileHeight*(l.north-a.y)/l.height|0,qj=!0}function fat(e,t,n,i,o,r,s){return w.toDegrees(o)}function hat(e,t,n,i,o,r,s){return w.toDegrees(r)}function pat(e,t,n,i,o,r,s){return e4(e,t,n,i,o,r),jV.x}function bat(e,t,n,i,o,r,s){return e4(e,t,n,i,o,r),jV.y}var yat=new pe;function e4(e,t,n,i,o,r,s){if(!$j){if(e.tilingScheme.projection instanceof Xi)jV.x=w.toDegrees(o),jV.y=w.toDegrees(r);else{let a=yat;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,jV)}$j=!0}}function gat(e,t,n,i,o,r,s){return s}var Ba=nF;function mm(e){Ba.call(this,e)}mm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return mm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof ih)return mm._metadataFailure(e,t);throw o}};mm.fromUrl=async function(e,t){C.defined("url",e);let n=Ge.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??z.EMPTY_OBJECT;let r=await mm._requestMetadata(t,i,o);return new mm(r)};c(Object.create)&&(mm.prototype=Object.create(Ba.prototype),mm.prototype.constructor=mm);function Eye(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 Xye(e,t,n){let i=e.positionToTileXY(de.southwest(t),n),o=e.positionToTileXY(de.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}mm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,l=/boundingbox/i,d,u,f,p=[],y=e.childNodes[0].childNodes;for(let P=0;P<y.length;P++)if(r.test(y.item(P).nodeName))d=y.item(P);else if(a.test(y.item(P).nodeName)){f=y.item(P);let F=y.item(P).childNodes;for(let N=0;N<F.length;N++)s.test(F.item(N).nodeName)&&p.push(F.item(N))}else l.test(y.item(P).nodeName)&&(u=y.item(P));let h;if(!c(f)||!c(u))throw h=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,c(o)&&Ro.reportError(void 0,o,o.errorEvent,h),new le(h);let g=t.fileExtension??d.getAttribute("extension"),x=t.tileWidth??parseInt(d.getAttribute("width"),10),S=t.tileHeight??parseInt(d.getAttribute("height"),10),V=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),Z=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),R=f.getAttribute("profile"),E=t.tilingScheme;if(!c(E))if(R==="geodetic"||R==="global-geodetic")E=new Ki({ellipsoid:t.ellipsoid});else if(R==="mercator"||R==="global-mercator")E=new ss({ellipsoid:t.ellipsoid});else throw h=`${i.url} specifies an unsupported profile attribute, ${R}.`,c(o)&&Ro.reportError(void 0,o,o.errorEvent,h),new le(h);let I=de.clone(t.rectangle);if(!c(I)){let P,F,N,b;t.flipXY??!1?(N=new D(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new D(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(N=new D(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new D(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let X=R==="geodetic"||R==="mercator";if(E.projection instanceof Xi||X)P=pe.fromDegrees(N.x,N.y),F=pe.fromDegrees(b.x,b.y);else{let W=E.projection;P=W.unproject(N),F=W.unproject(b)}I=new de(P.longitude,P.latitude,F.longitude,F.latitude)}return I=Eye(I,E),V=Xye(E,I,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${g}`}),tilingScheme:E,rectangle:I,tileWidth:x,tileHeight:S,minimumLevel:V,maximumLevel:Z,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};mm._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=c(e.tilingScheme)?e.tilingScheme:new ss({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Eye(a,s);let l=Xye(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:l,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Rg=mm;var zWi=_(T(),1);function Iye(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Iye.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function xat(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(!c(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new le(o)}if(!c(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new le(o)}if(t.version=i.version,c(n.projection)&&n.projection==="flat")t.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!c(n.projection)||n.projection==="mercator")t.tilingScheme=new ss({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new le(o)}return!0}function _at(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw c(e)&&c(e.message)&&(i+=`: ${e.message}`),Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new le(i)}async function Tat(e,t,n){try{let i=await e.fetchText();xat(i,t)}catch(i){_at(i,e,n)}}function ql(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 Ct(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${ql.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 ye}Object.defineProperties(ql.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}}});ql.fromUrl=async function(e,t,n){C.defined("url",e),C.defined("channel",t),n=n??{};let i=n.path??"/default_map",o=Ge.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new Iye(n);s.channel=t,await Tat(r,s);let a=new ql(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};ql.prototype.getTileCredits=function(e,t,n){};ql.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 fl.loadImage(this,o)};ql.prototype.pickFeatures=function(e,t,n,i,o){};ql._logoUrl=void 0;Object.defineProperties(ql,{logoUrl:{get:function(){return c(ql._logoUrl)||(ql._logoUrl=on("Assets/Images/google_earth_credit.png")),ql._logoUrl},set:function(e){C.defined("value",e),ql._logoUrl=e}}});var oF=ql;var twi=_(T(),1);var Sat=/\/$/,Wye=new Ct('&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 eL(e){e=e??z.EMPTY_OBJECT;let t=e.mapId;if(!c(t))throw new L("options.mapId is required.");let n=e.accessToken;if(!c(n))throw new L("options.accessToken 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;let i=Ge.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Sat.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;c(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Ct(s))):s=Wye,this._resource=i,this._imageryProvider=new Ba({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(eL.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}}});eL.prototype.getTileCredits=function(e,t,n){};eL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};eL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};eL._defaultCredit=Wye;var rF=eL;var hwi=_(T(),1);function PT(e){e=e??z.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??de.MAX_VALUE,n=new Ki({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 ye;let i=e.credit;typeof i=="string"&&(i=new Ct(i)),this._credit=i,C.defined("options.url",e.url);let o=Ge.createIfNeeded(e.url);this._resource=o,C.typeOf.number("options.tileWidth",e.tileWidth),C.typeOf.number("options.tileHeight",e.tileHeight),this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(PT.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 Cat(e,t,n,i){let o=`Failed to load image ${e.url}`;c(t)&&c(t.message)&&(o+=`: ${t.message}`);let r=Ro.reportError(i,n,c(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return t4(e,n,r);throw c(n)&&(n._hasError=!0),new le(o)}async function t4(e,t,n){try{return await fl.loadImage(null,e)}catch(i){return Cat(e,i,t,n)}}PT.fromUrl=async function(e,t){C.defined("url",e);let n=Ge.createIfNeeded(e),i=await t4(n);t=t??z.EMPTY_OBJECT;let o=new PT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};PT.prototype.getTileCredits=function(e,t,n){};PT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!c(this._image)){let o=await t4(this._resource,this);return this._image=o,Ro.reportSuccess(this._errorEvent),o}return this._image};PT.prototype.pickFeatures=function(e,t,n,i,o){};var sF=PT;var Uwi=_(T(),1);var Twi=_(T(),1);function Vat(e,t,n){if(!c(e))throw new L("type is required.");if(this.type=e,!c(t))if(e==="json")t="application/json";else if(e==="xml")t="text/xml";else if(e==="html")t="text/html";else if(e==="text")t="text/plain";else throw new L('format is required when type is not "json", "xml", "html", or "text".');if(this.format=t,!c(n))if(e==="json")n=Lat;else if(e==="xml")n=Eat;else if(e==="html")n=wye;else if(e==="text")n=wye;else throw new L('callback is required when type is not "json", "xml", "html", or "text".');this.callback=n}function Lat(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Af;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),c(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=pe.fromDegrees(s,a)}t.push(r)}return t}var n4="http://www.mapinfo.com/mxp",Zat="http://www.esri.com/wms",Rat="http://www.opengis.net/wfs",Gat="http://www.opengis.net/gml";function Eat(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===n4)return Xat(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Zat)return Iat(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Rat)return Wat(e);if(t.localName==="ServiceExceptionReport")throw new le(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?wat(e):Pat(e)}function Xat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(n4,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(n4,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let f=u.getAttribute("ref"),p=u.textContent.trim();s[f]=p}}let l=new Af;l.data=r,l.properties=s,l.configureNameFromProperties(s),l.configureDescriptionFromProperties(s),t.push(l)}return t}function Iat(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 l=0;l<a.length;++l){let d=a[l];i[d.name]=d.value}n.push(OO(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let l=a.childNodes;for(let d=0;d<l.length;++d){let u=l[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(OO(a,i))}}return n}function Wat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Gat,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};i4(r,s),t.push(OO(r,s))}return t}function wat(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(!c(n))throw new le("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={};i4(s,a),t.push(OO(s,a))}}return t}function i4(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()&&i4(o,t)&&(t[o.localName]=o.textContent)}return n}function OO(e,t){let n=new Af;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Pat(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Af;return o.data=e,o.description=n.innerHTML,[o]}var vat=/<body>\s*<\/body>/im,Fat=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Aat=/<title>([\s\S]*)<\/title>/im;function wye(e){if(vat.test(e)||Fat.test(e))return;let t,n=Aat.exec(e);n&&n.length>1&&(t=n[1]);let i=new Af;return i.name=t,i.description=e,i.data=e,[i]}var vT=Vat;var Xwi=_(T(),1);function aF(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.clock",e.clock),C.typeOf.object("options.times",e.times),C.typeOf.func("options.requestImageFunction",e.requestImageFunction),C.typeOf.func("options.reloadFunction",e.reloadFunction),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(aF.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!c(e))throw new L("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!c(e))throw new L("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});aF.prototype.getFromCache=function(e,t,n,i){let o=Pye(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(c(s)&&c(s[o])){let a=s[o];r=a.promise.catch(function(l){throw i.state=a.request.state,l}),delete s[o]}return r};aF.prototype.checkApproachingInterval=function(e,t,n,i){let o=Pye(e,t,n),r=this._tilesRequestedForInterval,s=vye(this),a={key:o,priorityFunction:i.priorityFunction};(!c(s)||!Fye(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};aF.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=vye(this);if(c(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let l=s.pop();a=Fye(this,l,r),a||s.push(l)}}};function Pye(e,t,n){return`${e}-${t}-${n}`}function Mat(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function vye(e){let t=e._times;if(!c(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 l=t.get(a);return r>0?(s=ee.secondsDifference(l.stop,i),++a):(s=ee.secondsDifference(l.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function Fye(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];c(r)||(r=o[i]={});let s=t.key;if(c(r[s]))return!0;let a=Mat(s),l=new Jo({throttle:!1,throttleByServer:!0,type:us.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,l,n);return c(d)?(r[s]={promise:d,request:l},!0):!1}var FT=aF;var Nat=[3034,3035,3042,3043,3044],kat=[4471,4559];function Nf(e){if(e=e??z.EMPTY_OBJECT,!c(e.url))throw new L("options.url is required.");if(!c(e.layers))throw new L("options.layers is required.");if(c(e.times)&&!c(e.clock))throw new L("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=Ge.createIfNeeded(e.url),n=Ge.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Nf.DefaultParameters,!0),n.setQueryParameters(Nf.GetFeatureInfoDefaultParameters,!0),c(e.parameters)&&t.setQueryParameters(Aye(e.parameters)),c(e.getFeatureInfoParameters)&&n.setQueryParameters(Aye(e.getFeatureInfoParameters));let i=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new FT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,l,d,u){return Mye(i,s,a,l,d,u)},reloadFunction:function(){c(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 Wi?"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&&!kat.includes(a)||Nat.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Wi?"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 Ba({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ki({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??Nf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Mye(e,t,n,i,o,r){let s=c(r)?r.data:void 0,a=e._tileProvider;return c(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Uat(e,t,n,i,o,r,s){let a=c(s)?s.data:void 0,l=e._tileProvider;return c(a)&&l._pickFeaturesResource.setQueryParameters(a),l.pickFeatures(t,n,i,o,r)}Object.defineProperties(Nf.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}}});Nf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Nf.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=Mye(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};Nf.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=c(r)?r.currentInterval:void 0;return Uat(this,e,t,n,i,o,s)};Nf.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Nf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Nf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new vT("json","application/json")),Object.freeze(new vT("xml","text/xml")),Object.freeze(new vT("text","text/html"))]);function Aye(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var cF=Nf;var ePi=_(T(),1);var Oat=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function lF(e){if(e=e??z.EMPTY_OBJECT,!c(e.url))throw new L("options.url is required.");if(!c(e.layer))throw new L("options.layer is required.");if(!c(e.style))throw new L("options.style is required.");if(!c(e.tileMatrixSetID))throw new L("options.tileMatrixSetID is required.");if(c(e.times)&&!c(e.clock))throw new L("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;let t=Ge.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!c(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Oat),this._useKvp=!0;else{let f={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(f),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=c(e.tilingScheme)?e.tilingScheme:new ss({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,c(e.times)&&(this._timeDynamicImagery=new FT({clock:e.clock,times:e.times,requestImageFunction:function(f,p,y,h,g){return Nye(s,f,p,y,h,g)},reloadFunction:function(){c(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(de.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(de.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(l.x-a.x)+1)*(Math.abs(l.y-a.y)+1);if(d>4)throw new L(`The imagery provider's rectangle and minimumLevel indicate that there are ${d} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new ye;let u=e.credit;this._credit=typeof u=="string"?new Ct(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():c(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function Nye(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=c(s)?s[i]:i.toString(),l=e._subdomains,d=e._dimensions,u=c(r)?r.data:void 0,f,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:l[(t+n+i)%l.length]},f=e._resource.getDerivedResource({request:o}),f.setTemplateValues(p),c(d)&&f.setTemplateValues(d),c(u)&&f.setTemplateValues(u);else{let y={};y.tilematrix=a,y.layer=e._layer,y.style=e._style,y.tilerow=n,y.tilecol=t,y.tilematrixset=e._tileMatrixSetID,y.format=e._format,c(d)&&(y=St(y,d)),c(u)&&(y=St(y,u)),p={s:l[(t+n+i)%l.length]},f=e._resource.getDerivedResource({queryParameters:y,request:o}),f.setTemplateValues(p)}return fl.loadImage(e,f)}Object.defineProperties(lF.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,c(this._reload)&&this._reload())}}});lF.prototype.getTileCredits=function(e,t,n){};lF.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=Nye(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};lF.prototype.pickFeatures=function(e,t,n,i,o){};var dF=lF;var Dat={ARCGIS_MAPSERVER:l0.fromUrl,BING:async(e,t)=>tF.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,oF.fromUrl(e,n,t)},MAPBOX:(e,t)=>new rF({url:e,...t}),SINGLE_TILE:sF.fromUrl,TMS:Rg.fromUrl,URL_TEMPLATE:(e,t)=>new Ba({url:e,...t}),WMS:(e,t)=>new cF({url:e,...t}),WMTS:(e,t)=>new dF({url:e,...t})};function np(e){e=e??z.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 ye}Object.defineProperties(np.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(){}}});np.fromAssetId=async function(e,t){C.typeOf.number("assetId",e),t=t??z.EMPTY_OBJECT;let n=xd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=np._endpointCache[i];c(o)||(o=n.fetchJson(),np._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new le(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!c(a))s=await Rg.fromUrl(new xd(r,n));else{let d=Dat[a];if(!c(d))throw new le(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},f=u.url;delete u.url,s=await d(f,u)}let l=new np(t);return s.errorEvent.addEventListener(function(d){d.provider=l,l._errorEvent.raiseEvent(d)}),l._tileCredits=xd.getCreditsFromEndpoint(r,n),l._imageryProvider=s,l};np.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return c(i)?this._tileCredits.concat(i):this._tileCredits};np.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};np.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};np._endpointCache={};var d0=np;var xPi=_(T(),1),Bat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},u0=Object.freeze(Bat);function Yat(e){e=e??z.EMPTY_OBJECT;let t=e.style??u0.AERIAL;return d0.fromAssetId(t)}var m0=Yat;var EPi=_(T(),1);function tL(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=ci.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!c(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}tL.createPlaceholder=function(e){let t=new tL(e,0,0,0);return t.addReference(),t.state=ci.PLACEHOLDER,t};tL.prototype.addReference=function(){++this.referenceCount};tL.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),c(this.parent)&&this.parent.releaseReference(),c(this.image)&&c(this.image.destroy)&&this.image.destroy(),c(this.texture)&&this.texture.destroy(),c(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),he(this),0):this.referenceCount};tL.prototype.processStateMachine=function(e,t,n){this.state===ci.UNLOADED&&!n&&(this.state=ci.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ci.RECEIVED&&(this.state=ci.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ci.READY&&t&&!this.texture;(this.state===ci.TEXTURE_LOADED||i)&&(this.state=ci.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var nL=tL;var wPi=_(T(),1);function o4(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}o4.prototype.freeResources=function(){c(this.readyImagery)&&this.readyImagery.releaseReference(),c(this.loadingImagery)&&this.loadingImagery.releaseReference()};o4.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ci.READY)return c(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(;c(r)&&(r.state!==ci.READY||!this.useWebMercatorT&&!c(r.texture));)r.state!==ci.FAILED&&r.state!==ci.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,c(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ci.FAILED||i.state===ci.INVALID?c(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var iL=o4;function Si(e,t){this._imageryProvider=e,this._readyEvent=new ye,this._errorEvent=new ye,t=t??z.EMPTY_OBJECT,e=e??z.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??Si.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Si.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Si.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Si.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Si.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Si.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Si.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Si.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??de.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new iL(nL.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??Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Si.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return c(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Si.DEFAULT_BRIGHTNESS=1;Si.DEFAULT_CONTRAST=1;Si.DEFAULT_HUE=0;Si.DEFAULT_SATURATION=1;Si.DEFAULT_GAMMA=1;Si.DEFAULT_SPLIT=Ar.NONE;Si.DEFAULT_MINIFICATION_FILTER=Jt.LINEAR;Si.DEFAULT_MAGNIFICATION_FILTER=di.LINEAR;Si.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Si.fromProviderAsync=function(e,t){C.typeOf.object("imageryProviderPromise",e);let n=new Si(void 0,t);return Qat(n,Promise.resolve(e)),n};Si.fromWorldImagery=function(e){return e=e??z.EMPTY_OBJECT,Si.fromProviderAsync(m0({style:e.style}),e)};Si.prototype.isBaseLayer=function(){return this._isBaseLayer};Si.prototype.isDestroyed=function(){return!1};Si.prototype.destroy=function(){return he(this)};var Oye=new de,kye=new de,r4=new de,Dye=new de;Si.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return de.intersection(e.rectangle,t)};Si.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!c(t)||c(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||c(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;c(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 Wi&&e.rectangle.north<Wi.MaximumLatitude&&e.rectangle.south>-Wi.MaximumLatitude,s=de.intersection(o.rectangle,this._rectangle,Oye),a=de.intersection(e.rectangle,s,kye);if(!c(a)){if(!this.isBaseLayer())return!1;let X=s,W=e.rectangle;a=kye,W.south>=X.north?a.north=a.south=X.north:W.north<=X.south?a.north=a.south=X.south:(a.south=Math.max(W.south,X.south),a.north=Math.min(W.north,X.north)),W.west>=X.east?a.west=a.east=X.east:W.east<=X.west?a.west=a.east=X.west:(a.west=Math.max(W.west,X.west),a.east=Math.min(W.east,X.east))}let l=0;a.south>0?l=a.south:a.north<0&&(l=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),f=Kat(this,u,l);f=Math.max(0,f);let p=o.maximumLevel;if(f>p&&(f=p),c(o.minimumLevel)){let X=o.minimumLevel;f<X&&(f=X)}let y=o.tilingScheme,h=y.positionToTileXY(de.northwest(a),f),g=y.positionToTileXY(de.southeast(a),f),x=e.rectangle.width/512,S=e.rectangle.height/512,V=y.tileXYToRectangle(h.x,h.y,f);Math.abs(V.south-e.rectangle.north)<S&&h.y<g.y&&++h.y,Math.abs(V.east-e.rectangle.west)<x&&h.x<g.x&&++h.x;let Z=y.tileXYToRectangle(g.x,g.y,f);Math.abs(Z.north-e.rectangle.south)<S&&g.y>h.y&&--g.y,Math.abs(Z.west-e.rectangle.east)<x&&g.x>h.x&&--g.x;let R=de.clone(e.rectangle,Dye),E=y.tileXYToRectangle(h.x,h.y,f),I=de.intersection(E,s,r4),v;r?(y.rectangleToNativeRectangle(R,R),y.rectangleToNativeRectangle(E,E),y.rectangleToNativeRectangle(I,I),y.rectangleToNativeRectangle(s,s),v=y.tileXYToNativeRectangle.bind(y),x=R.width/512,S=R.height/512):v=y.tileXYToRectangle.bind(y);let P,F=0,N=1,b;!this.isBaseLayer()&&Math.abs(I.west-R.west)>=x&&(F=Math.min(1,(I.west-R.west)/R.width)),!this.isBaseLayer()&&Math.abs(I.north-R.north)>=S&&(N=Math.max(0,(I.north-R.south)/R.height));let G=N;for(let X=h.x;X<=g.x;X++)if(P=F,E=v(X,h.y,f),I=de.simpleIntersection(E,s,r4),!!c(I)){F=Math.min(1,(I.east-R.west)/R.width),X===g.x&&(this.isBaseLayer()||Math.abs(I.east-R.east)<x)&&(F=1),N=G;for(let W=h.y;W<=g.y;W++){if(b=N,E=v(X,W,f),I=de.simpleIntersection(E,s,r4),!c(I))continue;N=Math.max(0,(I.south-R.south)/R.height),W===g.y&&(this.isBaseLayer()||Math.abs(I.south-R.south)<S)&&(N=0);let A=new ce(P,N,F,b),k=this.getImageryFromCache(X,W,f);i.imagery.splice(n,0,new iL(k,A,r)),++n}}return!0};Si.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let l=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=l.rectangleToNativeRectangle(n,Oye),i=l.rectangleToNativeRectangle(i,Dye)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ce(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Si.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!c(s))return o();e.image=s,e.state=ci.RECEIVED,e.request=void 0,Ro.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===jn.CANCELLED){e.state=ci.UNLOADED,e.request=void 0;return}e.state=ci.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Ro.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Jo({throttle:!1,throttleByServer:!0,type:us.IMAGERY});e.request=s,e.state=ci.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!c(a)){e.state=ci.UNLOADED,e.request=void 0;return}c(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(l){i(l)}).catch(function(l){o(l)})}r()};Si.prototype._createTextureWebGL=function(e,t){let n=new en({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return c(i.internalFormat)?new Pt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Pt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ke.RGBA:ke.RGB,sampler:n})};Si.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(c(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(c(r)){if(!r.isReady()){t.state=ci.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ci.INVALID;return}}}if(this.minificationFilter!==Jt.NEAREST&&this.minificationFilter!==Jt.LINEAR)throw new L("ImageryLayer minification filter must be NEAREST or LINEAR");let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Wi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ci.TEXTURE_LOADED};function Uye(e,t,n){return`${e}:${t}:${n}`}Si.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Jt.LINEAR&&i===di.LINEAR&&!ke.isCompressedFormat(t.pixelFormat)&&w.isPowerOfTwo(t.width)&&w.isPowerOfTwo(t.height)){n=Jt.LINEAR_MIPMAP_LINEAR;let r=mt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Uye(n,i,s),l=e.cache.imageryLayerMipmapSamplers;c(l)||(l={},e.cache.imageryLayerMipmapSamplers=l);let d=l[a];c(d)||(d=l[a]=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(_u.NICEST),t.sampler=d}else{let r=Uye(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;c(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];c(a)||(a=s[r]=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Si.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 Xi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new vc({persists:!0,owner:this,preExecute:function(l){zat(l,r,i,t.rectangle)},postExecute:function(l){t.texture=l,s._finalizeReprojectTexture(r,l),t.state=ci.READY,t.releaseReference()},canceled:function(){t.state=ci.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ci.READY};Si.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};Si.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){c(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Si.prototype.getImageryFromCache=function(e,t,n,i){let o=Bye(e,t,n),r=this._imageryCache[o];return c(r)||(r=new nL(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Si.prototype.removeImageryFromCache=function(e){let t=Bye(e.x,e.y,e.level);delete this._imageryCache[t]};function Bye(e,t,n){return JSON.stringify([e,t,n])}var DO={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},Hat=Ot.supportsTypedArrays()?new Float32Array(2*64):void 0;function zat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!c(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){c(this.framebuffer)&&this.framebuffer.destroy(),c(this.vertexArray)&&this.vertexArray.destroy(),c(this.shaderProgram)&&this.shaderProgram.destroy()}};let x=new Float32Array(2*64*2),S=0;for(let I=0;I<64;++I){let v=I/63;x[S++]=0,x[S++]=v,x[S++]=1,x[S++]=v}let V={position:0,webMercatorT:1},Z=rs.getRegularGridIndices(2,64),R=_t.createIndexBuffer({context:t,typedArray:Z,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:V.position,vertexBuffer:_t.createVertexBuffer({context:t,typedArray:x,usage:Ne.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:_t.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Ne.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:R});let E=new Be({sources:[Ov]});o.shaderProgram=tn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:Uv,attributeLocations:V}),o.sampler=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;DO.textureDimensions.x=r,DO.textureDimensions.y=s,DO.texture=n;let a=Math.sin(i.south),l=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-l),f=new Pt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});w.isPowerOfTwo(r)&&w.isPowerOfTwo(s)&&f.generateMipmap(_u.NICEST);let p=i.south,y=i.north,h=Hat,g=0;for(let x=0;x<64;++x){let S=x/63,V=w.lerp(p,y,S);a=Math.sin(V);let R=(.5*Math.log((1+a)/(1-a))-l)*u;h[g++]=R,h[g++]=R}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(h),e.shaderProgram=o.shaderProgram,e.outputTexture=f,e.uniformMap=DO,e.vertexArray=o.vertexArray}function Kat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Xi?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function Jat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Qat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Jat(e._errorEvent,i)}}var Ya=Si;var z2i=_(T(),1);var C2i=_(T(),1),jat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},_n=jat;var L2i=_(T(),1),Yye={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>=Yye.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Jn=Yye;function rL(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce}rL.prototype.update=function(e,t,n){this.changedThisFrame&&(qye(e,t,this.tile,n),this.changedThisFrame=!1)};rL.prototype.destroy=function(e){this._destroyVertexArray(e),c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};rL.prototype._destroyVertexArray=function(e){c(this.vertexArray)&&(c(e)?e.push(this.vertexArray):um._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var qat=new _y;rL.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=qat;a.clear();for(let d=0;d<t.length;++d){let u=t[d];c(u.data.vertexArray)&&a.enqueue(t[d])}let l=a.dequeue();for(;l!==void 0;){let d=l.findTileToWest(r),u=l.findTileToSouth(r),f=l.findTileToEast(r),p=l.findTileToNorth(r);ws(e,n,l,d,s,_n.EAST,!1,a,i),ws(e,n,l,u,s,_n.NORTH,!1,a,i),ws(e,n,l,f,s,_n.WEST,!1,a,i),ws(e,n,l,p,s,_n.SOUTH,!1,a,i);let y=d.findTileToNorth(r),h=d.findTileToSouth(r),g=f.findTileToNorth(r),x=f.findTileToSouth(r);ws(e,n,l,y,s,_n.SOUTHEAST,!1,a,i),ws(e,n,l,g,s,_n.SOUTHWEST,!1,a,i),ws(e,n,l,h,s,_n.NORTHEAST,!1,a,i),ws(e,n,l,x,s,_n.NORTHWEST,!1,a,i),l=a.dequeue()}};function ws(e,t,n,i,o,r,s,a,l){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||Jn.wasKicked(d._lastSelectionResult)||Jn.originalResult(d._lastSelectionResult)===Jn.CULLED);){if(s)return;let u=d.parent;if(r>=_n.NORTHWEST&&u!==void 0)switch(r){case _n.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case _n.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case _n.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case _n.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Jn.RENDERED){if(c(d.data.vertexArray))return;$at(e,t,n,d,r,o,a,l);return}if(Jn.originalResult(i._lastSelectionResult)!==Jn.CULLED)switch(r){case _n.WEST:ws(e,t,n,i.northwestChild,o,r,!0,a,l),ws(e,t,n,i.southwestChild,o,r,!0,a,l);break;case _n.EAST:ws(e,t,n,i.southeastChild,o,r,!0,a,l),ws(e,t,n,i.northeastChild,o,r,!0,a,l);break;case _n.SOUTH:ws(e,t,n,i.southwestChild,o,r,!0,a,l),ws(e,t,n,i.southeastChild,o,r,!0,a,l);break;case _n.NORTH:ws(e,t,n,i.northeastChild,o,r,!0,a,l),ws(e,t,n,i.northwestChild,o,r,!0,a,l);break;case _n.NORTHWEST:ws(e,t,n,i.northwestChild,o,r,!0,a,l);break;case _n.NORTHEAST:ws(e,t,n,i.northeastChild,o,r,!0,a,l);break;case _n.SOUTHWEST:ws(e,t,n,i.southwestChild,o,r,!0,a,l);break;case _n.SOUTHEAST:ws(e,t,n,i.southeastChild,o,r,!0,a,l);break;default:throw new L("Invalid edge")}}}function $at(e,t,n,i,o,r,s,a){let l=i.data;if(l.fill===void 0)l.fill=new rL(i);else if(l.fill.visitedFrame===r)return;l.fill.enqueuedFrame!==r&&(l.fill.enqueuedFrame=r,l.fill.changedThisFrame=!1,s.enqueue(i)),ect(e,t,n,i,o,a)}function ect(e,t,n,i,o,r){let s=i.data.fill,a,l=n.data.fill;c(l)?(l.visitedFrame=t.frameNumber,l.changedThisFrame&&(qye(e,t,n,r),l.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case _n.WEST:d=s.westMeshes,u=s.westTiles;break;case _n.SOUTH:d=s.southMeshes,u=s.southTiles;break;case _n.EAST:d=s.eastMeshes,u=s.eastTiles;break;case _n.NORTH:d=s.northMeshes,u=s.northTiles;break;case _n.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case _n.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case _n.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case _n.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let f,p,y,h,g=n.rectangle,x,S=i.rectangle;switch(o){case _n.WEST:for(x=(S.north-S.south)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.greaterThan(g.north,h.south,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.greaterThanOrEquals(g.south,h.north,x));++p);break;case _n.SOUTH:for(x=(S.east-S.west)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.lessThan(g.west,h.east,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.lessThanOrEquals(g.east,h.west,x));++p);break;case _n.EAST:for(x=(S.north-S.south)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.lessThan(g.south,h.north,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.lessThanOrEquals(g.north,h.south,x));++p);break;case _n.NORTH:for(x=(S.east-S.west)*w.EPSILON5,f=0;f<u.length&&(y=u[f],h=y.rectangle,!w.greaterThan(g.east,h.west,x));++f);for(p=f;p<u.length&&(y=u[p],h=y.rectangle,!w.greaterThanOrEquals(g.west,h.east,x));++p);break}p-f===1?(s.changedThisFrame=s.changedThisFrame||d[f]!==a,d[f]=a,u[f]=n):(s.changedThisFrame=!0,d.splice(f,p-f,a),u.splice(f,p-f,n))}var AT=new pe,tct=new pe,oL=new m,l4=new m,s4=new D,a4=new D,jd=new D;function QO(){this.height=0,this.encodedNormal=new D}function BO(e,t,n,i,o,r,s,a,l){if(c(o))return o;let d;if(c(r)&&c(s))d=(r.height+s.height)*.5;else if(c(r))d=r.height;else if(c(s))d=s.height;else if(c(a))d=a.height;else{let f=e.tile.data.tileBoundingRegion,p=0,y=0;c(f)&&(p=f.minimumHeight,y=f.maximumHeight),d=(p+y)*.5}return $ye(e,t,n,i,d,l),l}var nct={minimumHeight:0,maximumHeight:0},ict=new m,Hye=new QO,zye=new QO,Kye=new QO,Jye=new QO,oct=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,rct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function qye(e,t,n,i){um.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,l=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,f=HO(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Kye),p=HO(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,Hye),y=HO(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,zye),h=HO(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Jye);f=BO(r,u,0,1,f,p,h,y,Kye),p=BO(r,u,0,0,p,f,y,h,Hye),y=BO(r,u,1,1,y,p,h,f,zye),h=BO(r,u,1,1,h,y,f,p,Jye);let g=p.height,x=y.height,S=f.height,V=h.height,Z=Math.min(g,x,S,V),R=Math.max(g,x,S,V),E=(Z+R)*.5,I,v,P=e.getLevelMaximumGeometricError(n.level),F=u.maximumRadius-P,N=Math.acos(F/u.maximumRadius)*4;if(N*=1.5,s.width>N&&R-Z<=P){let X=new Da({width:9,height:9,buffer:oct,structure:{heightOffset:R}}),W=rct;W.tilingScheme=n.tilingScheme,W.x=n.x,W.y=n.y,W.level=n.level,W.exaggeration=a,W.exaggerationRelativeHeight=l,r.mesh=X._createMeshSync(W)}else{let X=d,W=de.center(s,tct);W.height=E;let A=u.cartographicToCartesian(W,ict),k=new Rc(A,void 0,void 0,void 0,void 0,!0,!0,X,a,l),B=5,O;for(O=r.westMeshes,I=0,v=O.length;I<v;++I)B+=O[I].eastIndicesNorthToSouth.length;for(O=r.southMeshes,I=0,v=O.length;I<v;++I)B+=O[I].northIndicesWestToEast.length;for(O=r.eastMeshes,I=0,v=O.length;I<v;++I)B+=O[I].westIndicesSouthToNorth.length;for(O=r.northMeshes,I=0,v=O.length;I<v;++I)B+=O[I].southIndicesEastToWest.length;let H=nct;H.minimumHeight=Z,H.maximumHeight=R;let U=k.stride,K=new Float32Array(B*U),Q=0,ie=Q;Q=YO(u,s,k,K,Q,0,1,f.height,f.encodedNormal,1,H),Q=KO(r,u,k,K,Q,r.westTiles,r.westMeshes,_n.EAST,H);let j=Q;Q=YO(u,s,k,K,Q,0,0,p.height,p.encodedNormal,0,H),Q=KO(r,u,k,K,Q,r.southTiles,r.southMeshes,_n.NORTH,H);let $=Q;Q=YO(u,s,k,K,Q,1,0,y.height,y.encodedNormal,0,H),Q=KO(r,u,k,K,Q,r.eastTiles,r.eastMeshes,_n.WEST,H);let ne=Q;Q=YO(u,s,k,K,Q,1,1,h.height,h.encodedNormal,1,H),Q=KO(r,u,k,K,Q,r.northTiles,r.northMeshes,_n.SOUTH,H),Z=H.minimumHeight,R=H.maximumHeight;let be=Xn.fromRectangle(s,Z,R,n.tilingScheme.ellipsoid),Ce=Wi.geodeticLatitudeToMercatorAngle(s.south),me=1/(Wi.geodeticLatitudeToMercatorAngle(s.north)-Ce),_e=(Wi.geodeticLatitudeToMercatorAngle(W.latitude)-Ce)*me,Ve=u.geodeticSurfaceNormalCartographic(AT,l4),Ie=Fn.octEncode(Ve,s4),Ze=Q;k.encode(K,Q*U,be.center,D.fromElements(.5,.5,jd),E,Ie,_e,Ve),++Q;let De=Q,Ke=De<256?1:2,rt=(De-1)*3,Xt=rt*Ke,Ht=(K.length-De*U)*Float32Array.BYTES_PER_ELEMENT,qe;if(Ht>=Xt){let ge=De*U*Float32Array.BYTES_PER_ELEMENT;qe=De<256?new Uint8Array(K.buffer,ge,rt):new Uint16Array(K.buffer,ge,rt)}else qe=De<256?new Uint8Array(rt):new Uint16Array(rt);K=new Float32Array(K.buffer,0,De*U);let mn=0;for(I=0;I<De-2;++I)qe[mn++]=Ze,qe[mn++]=I,qe[mn++]=I+1;qe[mn++]=Ze,qe[mn++]=I,qe[mn++]=0;let Dt=[];for(I=j;I>=ie;--I)Dt.push(I);let Lt=[];for(I=$;I>=j;--I)Lt.push(I);let Vi=[];for(I=ne;I>=$;--I)Vi.push(I);let ln=[];for(ln.push(0),I=Ze-1;I>=ne;--I)ln.push(I);r.mesh=new dm(k.center,K,qe,rt,De,Z,R,ue.fromOrientedBoundingBox(be),mct(e,be.center,s,Z,R),k.stride,be,k,Dt,Lt,Vi,ln)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=um._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let G=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let X=o._findAncestorTileWithTerrainData(n);c(X)&&c(X.data.waterMaskTexture)&&(r.waterMaskTexture=X.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,X,r.waterMaskTranslationAndScale))}c(G)&&(--G.referenceCount,G.referenceCount===0&&G.destroy())}function YO(e,t,n,i,o,r,s,a,l,d,u){let f=AT;f.longitude=w.lerp(t.west,t.east,r),f.latitude=w.lerp(t.south,t.north,s),f.height=a;let p=e.cartographicToCartesian(f,oL),y;n.hasGeodeticSurfaceNormals&&(y=e.geodeticSurfaceNormal(p,l4));let h=a4;return h.x=r,h.y=s,n.encode(i,o*n.stride,p,h,a,l,d,y),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var JO=new de;function uF(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=de.clone(e.rectangle,JO),o.west-=w.TWO_PI,o.east-=w.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=de.clone(e.rectangle,JO),o.west+=w.TWO_PI,o.east+=w.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,l=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,f=(r.north-o.south)/d,p=(n.x-a)/(l-a),y=(n.y-u)/(f-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(y)<Math.EPSILON5?y=0:Math.abs(y-1)<Math.EPSILON5&&(y=1),i.x=p,i.y=y,i}var sct=new D;function c4(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 act=new D,cct=new m;function lct(e,t,n,i,o,r,s,a,l,d){let u=i.encoding,f=i.vertices,p=uF(t,n,u.decodeTextureCoordinates(f,o,jd),jd),y=uF(t,n,u.decodeTextureCoordinates(f,r,a4),a4),h;l?h=(s-p.x)/(y.x-p.x):h=(a-p.y)/(y.y-p.y);let g=u.decodeHeight(f,o),x=u.decodeHeight(f,r),S=n.rectangle;AT.longitude=w.lerp(S.west,S.east,s),AT.latitude=w.lerp(S.south,S.north,a),d.height=AT.height=w.lerp(g,x,h);let V;if(u.hasVertexNormals){let Z=u.getOctEncodedNormal(f,o,sct),R=u.getOctEncodedNormal(f,r,act),E=Fn.octDecode(Z.x,Z.y,oL),I=Fn.octDecode(R.x,R.y,cct);V=m.lerp(E,I,h,oL),m.normalize(V,V),Fn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(AT,oL),Fn.octEncode(V,d.encodedNormal)}function $ye(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(AT,oL);Fn.octEncode(s,r.encodedNormal)}function HO(e,t,n,i,o,r,s,a,l,d,u){if(jye(e,t,a,s,!1,n,i,u)||jye(e,t,d,l,!0,n,i,u))return u;let p;if(d4(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],c4(r,p,n,i,u),u;let y;if(n===0?i===0?y=zO(e.westMeshes,e.westTiles,_n.EAST,e.southMeshes,e.southTiles,_n.NORTH,n,i):y=zO(e.northMeshes,e.northTiles,_n.SOUTH,e.westMeshes,e.westTiles,_n.EAST,n,i):i===0?y=zO(e.southMeshes,e.southTiles,_n.NORTH,e.eastMeshes,e.eastTiles,_n.WEST,n,i):y=zO(e.eastMeshes,e.eastTiles,_n.WEST,e.northMeshes,e.northTiles,_n.SOUTH,n,i),c(y))return $ye(e,t,n,i,y,u),u}function zO(e,t,n,i,o,r,s,a){let l=Qye(e,t,!1,n,s,a),d=Qye(i,o,!0,r,s,a);return c(l)&&c(d)?(l+d)*.5:c(l)?l:d}function KO(e,t,n,i,o,r,s,a,l){for(let d=0;d<r.length;++d)o=dct(e,t,n,i,o,r[d],s[d],a,l);return o}function dct(e,t,n,i,o,r,s,a,l){let d=r.rectangle;a===_n.EAST&&e.tile.x===0?(d=de.clone(r.rectangle,JO),d.west-=w.TWO_PI,d.east-=w.TWO_PI):a===_n.WEST&&r.x===0&&(d=de.clone(r.rectangle,JO),d.west+=w.TWO_PI,d.east+=w.TWO_PI);let u=e.tile.rectangle,f,p;o>0&&(n.decodeTextureCoordinates(i,o-1,jd),f=jd.x,p=jd.y);let y,h;switch(a){case _n.WEST:y=s.westIndicesSouthToNorth,h=!1;break;case _n.NORTH:y=s.northIndicesWestToEast,h=!0;break;case _n.EAST:y=s.eastIndicesNorthToSouth,h=!1;break;case _n.SOUTH:y=s.southIndicesEastToWest,h=!0;break}let g=r,x=e.tile,S=s.encoding,V=s.vertices,Z=n.stride,R,E;S.hasWebMercatorT&&(R=Wi.geodeticLatitudeToMercatorAngle(u.south),E=1/(Wi.geodeticLatitudeToMercatorAngle(u.north)-R));for(let I=0;I<y.length;++I){let v=y[I],P=S.decodeTextureCoordinates(V,v,jd);uF(g,x,P,P);let F=P.x,N=P.y,b=h?F:N;if(b<0||b>1||Math.abs(F-f)<w.EPSILON5&&Math.abs(N-p)<w.EPSILON5)continue;let G=Math.abs(F)<w.EPSILON5||Math.abs(F-1)<w.EPSILON5,X=Math.abs(N)<w.EPSILON5||Math.abs(N-1)<w.EPSILON5;if(G&&X)continue;let W=S.decodePosition(V,v,oL),A=S.decodeHeight(V,v),k;S.hasVertexNormals?k=S.getOctEncodedNormal(V,v,s4):(k=s4,k.x=0,k.y=0);let B=N;if(S.hasWebMercatorT){let H=w.lerp(u.south,u.north,N);B=(Wi.geodeticLatitudeToMercatorAngle(H)-R)*E}let O;n.hasGeodeticSurfaceNormals&&(O=t.geodeticSurfaceNormal(W,l4)),n.encode(i,o*Z,W,P,A,k,B,O),l.minimumHeight=Math.min(l.minimumHeight,A),l.maximumHeight=Math.max(l.maximumHeight,A),++o}return o}function Qye(e,t,n,i,o,r){let s,a,l;n?(s=0,a=e.length,l=1):(s=e.length-1,a=-1,l=-1);for(let d=s;d!==a;d+=l){let u=e[d],f=t[d];if(!d4(f,u))continue;let p;switch(i){case _n.WEST:p=u.westIndicesSouthToNorth;break;case _n.SOUTH:p=u.southIndicesEastToWest;break;case _n.EAST:p=u.eastIndicesNorthToSouth;break;case _n.NORTH:p=u.northIndicesWestToEast;break}let y=p[n?0:p.length-1];if(c(y))return u.encoding.decodeHeight(u.vertices,y)}}function d4(e,t){return c(t)&&(!c(e.data.fill)||!e.data.fill.changedThisFrame)}function jye(e,t,n,i,o,r,s,a){let l,d,u,f,p,y=i[o?0:n.length-1],h=n[o?0:n.length-1];if(d4(y,h)&&(r===0?s===0?(l=o?h.northIndicesWestToEast:h.eastIndicesNorthToSouth,d=o,u=o):(l=o?h.eastIndicesNorthToSouth:h.southIndicesEastToWest,d=!o,u=!1):s===0?(l=o?h.westIndicesSouthToNorth:h.northIndicesWestToEast,d=!o,u=!0):(l=o?h.southIndicesEastToWest:h.westIndicesSouthToNorth,d=o,u=!o),l.length>0)){f=o?0:l.length-1,p=l[f],h.encoding.decodeTextureCoordinates(h.vertices,p,jd);let g=uF(y,e.tile,jd,jd);if(g.x===r&&g.y===s)return c4(h,p,r,s,a),!0;if(f=Wo(l,d?r:s,function(x,S){h.encoding.decodeTextureCoordinates(h.vertices,x,jd);let V=uF(y,e.tile,jd,jd);return u?d?V.x-r:V.y-s:d?r-V.x:s-V.y}),f<0){if(f=~f,f>0&&f<l.length)return lct(t,y,e.tile,h,l[f-1],l[f],r,s,d,a),!0}else return c4(h,l[f],r,s,a),!0}return!1}var uct=[new m,new m,new m,new m];function mct(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=uct;return m.fromRadians(n.west,n.south,o,a,l[0]),m.fromRadians(n.east,n.south,o,a,l[1]),m.fromRadians(n.west,n.north,o,a,l[2]),m.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}var sL=rL;function ar(e){if(!c(e))throw new L("options is required.");if(c(e.terrainProvider))if(c(e.imageryLayers)){if(!c(e.surfaceShaderSet))throw new L("options.surfaceShaderSet is required.")}else throw new L("options.imageryLayers is required.");else throw new L("options.terrainProvider is required.");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=Sn.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 ye,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(ar.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(ar.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(ar.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(ar.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new ye,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 Y(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=de.clone(de.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(ar.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!c(e))throw new L("value is required.");this._baseColor=e,this._firstPassInitialColor=ce.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!c(e))throw new L("value is required.");this._quadtree=e}},tilingScheme:{get:function(){if(c(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,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){qm.setOwner(e,this,"_clippingPolygons")}}});function fct(e,t){let n=e.loadingImagery;c(n)||(n=e.readyImagery);let i=t.loadingImagery;return c(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}ar.prototype.update=function(e){this._imageryLayers._update()};function hct(e,t){let n=t.creditDisplay,i=e._terrainProvider;c(i)&&c(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&&c(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}ar.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(fct)})),hct(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)um._freeVertexArray(t[i]);t.length=0};ar.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];c(s)&&(s.length=0)}let n=this._clippingPlanes;c(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;c(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};ar.prototype.endUpdate=function(e){if(!c(this._renderState)){this._renderState=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:lc.LESS}}),this._blendRenderState=Oe.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:lc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=He(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Oe.fromCache(s),s=He(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Oe.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&sL.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(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let l=r[s];if(c(l))for(let d=0,u=l.length;d<u;++d){let f=l[d],p=f.data.tileBoundingRegion;Mct(this,f,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function oge(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)}ar.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)oge(t[n],e)};ar.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};ar.prototype.getLevelMaximumGeometricError=function(e){return c(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};ar.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;c(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Jn.CULLED_BUT_NEEDED,o=n.terrainState),um.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)!==yr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,um.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var pct=new ue,rge=new de,bct=new de,yct=new pe;function qO(e,t){if(t.west<t.east)return t;let n=de.clone(t,bct);return de.center(e,yct).longitude>0?n.east=w.PI:n.west=-w.PI,n}function sge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(c(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(c(i)&&i.enabled||!de.equals(e.cartographicLimitRectangle,de.MAX_VALUE))}ar.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=sge(this,t);if(t.fog.enabled&&!o&&w.fog(i,t.fog.density)>=1)return yr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return yr.PARTIAL;let a=t.cullingVolume,l=s.boundingVolume;c(l)||(l=s.boundingSphere),r.clippedByBoundaries=!1;let d=qO(e.rectangle,this.cartographicLimitRectangle),u=de.simpleIntersection(d,e.rectangle,rge);if(!c(u))return yr.NONE;if(de.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==se.SCENE3D&&(l=pct,ue.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,l),m.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===se.MORPHING&&c(r.renderedMesh)&&(l=ue.union(s.boundingSphere,l,l))),!c(l))return yr.PARTIAL;let f=this._clippingPlanes;if(c(f)&&f.enabled){let x=f.computeIntersectionWithBoundingVolume(l);if(e.isClipped=x!==zt.INSIDE,x===zt.OUTSIDE)return yr.NONE}let p=this._clippingPolygons;if(c(p)&&p.enabled){let x=p.computeIntersectionWithBoundingVolume(s);e.isClipped=x!==zt.OUTSIDE}let y,h=a.computeVisibility(l);if(h===zt.OUTSIDE?y=yr.NONE:h===zt.INTERSECTING?y=yr.PARTIAL:h===zt.INSIDE&&(y=yr.FULL),y===yr.NONE)return y;let g=t.mode===se.SCENE3D&&t.camera.frustum instanceof sn;if(t.mode===se.SCENE3D&&!g&&c(n)&&!o){let x=r.occludeePointInScaledSpace;return!c(x)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(x,s.minimumHeight)?y:yr.NONE}return y};ar.prototype.canRefine=function(e){return c(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var gct=[],xct=[];ar.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=gct;i.length=this._imageryLayers.length;let o=!1,r=!1,s;c(n)&&(o=n.terrainState===uo.READY,r=!0,s=n.imagery);let a,l;for(a=0,l=i.length;a<l;++a)i[a]=r;if(c(s))for(a=0,l=s.length;a<l;++a){let f=s[a],p=f.loadingImagery,y=!c(p)||p.state===ci.FAILED||p.state===ci.INVALID,h=(f.loadingImagery||f.readyImagery).imageryLayer._layerIndex;i[h]=y&&i[h]}let d=this.quadtree._lastSelectionFrameNumber,u=xct;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let f=u.pop(),p=f._lastSelectionResultFrame===d?f._lastSelectionResult:Jn.NONE;if(p===Jn.RENDERED){let y=f.data;if(!c(y))continue;if(!o&&f.data.terrainState===uo.READY)return!1;let h=f.data.imagery;for(a=0,l=h.length;a<l;++a){let g=h[a],x=g.loadingImagery,S=!c(x)||x.state===ci.FAILED||x.state===ci.INVALID,V=(g.loadingImagery||g.readyImagery).imageryLayer._layerIndex;if(S&&!i[V])return!1}}else p===Jn.REFINED&&u.push(f.southwestChild,f.southeastChild,f.northwestChild,f.northeastChild)}return!0};var _ct=new m;ar.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=m.subtract(i.center,o,_ct),a=m.magnitude(s);return a<w.EPSILON5?0:(m.divideByScalar(s,a,s),(1-m.dot(s,r))*e._distance)};var ege=new M,jO=new M,Tct=new ce,Sct=new ce,Cct=new ce,Vct=new m,tge=new m,Lct=new m,Zct=new m;ar.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,l=i.length;a<l;++a){let d=i[a];c(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];c(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;c(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Rct=[new m,new m,new m,new m];function nge(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Rct;return m.fromRadians(n.west,n.south,o,a,l[0]),m.fromRadians(n.east,n.south,o,a,l[1]),m.fromRadians(n.west,n.north,o,a,l[2]),m.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}ar.prototype.computeDistanceToTile=function(e,t){Gct(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 l=t.camera.positionCartographic.height,d=Math.abs(l-r),u=Math.abs(l-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Gct(e,t,n){let i=e.data;i===void 0&&(i=e.data=new um);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Xd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,l=!1,d=e,u=i.mesh,f=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,l=!0;else if(f!==void 0&&f._minimumHeight!==void 0&&f._maximumHeight!==void 0)r.minimumHeight=f._minimumHeight,r.maximumHeight=f._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let y=p.data;if(y!==void 0){let h=y.mesh,g=y.terrainData;if(h!==void 0&&h.minimumHeight!==void 0&&h.maximumHeight!==void 0){r.minimumHeight=h.minimumHeight,r.maximumHeight=h.maximumHeight;break}else if(g!==void 0&&g._minimumHeight!==void 0&&g._maximumHeight!==void 0){r.minimumHeight=g._minimumHeight,r.maximumHeight=g._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,y=n.verticalExaggerationRelativeHeight;if(p!==1&&(l=!1,r.minimumHeight=Lr.getHeight(r.minimumHeight,p,y),r.maximumHeight=Lr.getHeight(r.maximumHeight,p,y)),l)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Xn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ue.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=m.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),c(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=nge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let g=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||g)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=nge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=l}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}ar.prototype.isDestroyed=function(){return!1};ar.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(),he(this)};function Ect(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,l=a.length,d;for(d=0;d<l;++d)if(o=a[d],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=c(o)?o.readyImagery??o.loadingImagery:void 0,!c(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}ar.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(c(s._loadedCallbacks[e._layerIndex]))return;let a,l=s.data.imagery,d=l.length,u=-1,f=0;for(a=0;a<d;++a){let y=l[a];if((y.readyImagery??y.loadingImagery).imageryLayer===e)u===-1&&(u=a),++f;else if(u!==-1)break}if(u===-1)return;let p=u+f;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Ect(f,e,n),s.state=$s.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=$s.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Jn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};ar.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 l=i[s],d=l.loadingImagery;if(c(d)||(d=l.readyImagery),d.imageryLayer===e)o===-1&&(o=s),l.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};ar.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};ar.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Xct=new M,Ict=new M;function ige(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,tge);return M.setTranslation(i,o,ege),ege},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,tge);return M.setTranslation(i,r,jO),M.multiply(o,jO,jO),jO},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 c(i)&&c(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=c(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,Xct):M.IDENTITY;return M.inverseTranspose(o,Ict)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return c(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return c(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new ce(0,0,.5,1),fillHighlightColor:new Y(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new D(65e5,9e6),nightFadeDistance:new D(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new m(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new m(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new m,center3D:void 0,rtc:new m,modifiedModelView:new M,tileRectangle:new ce,verticalExaggerationAndRelativeHeight:new D(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new D,southMercatorYAndOneOverHeight:new D,waterMask:void 0,waterMaskTranslationAndScale:new ce,minMaxHeight:new D,scaleAndBias:new M,clippingPlanesEdgeColor:Y.clone(Y.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ce,frontFaceAlphaByDistance:new ce,backFaceAlphaByDistance:new ce,localizedTranslucencyRectangle:new ce,undergroundColor:Y.clone(Y.TRANSPARENT),undergroundColorAlphaByDistance:new ce,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return c(t.materialUniformMap)?St(n,t.materialUniformMap):n}function Wct(e,t,n){let i=n.data,o,r;if(c(i.vertexArray)?(o=i.mesh,r=i.vertexArray):c(i.fill)&&c(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!c(o)||!c(r))){if(c(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=wct(e,r,o),i.wireframeVertexArray.mesh=o}}function wct(e,t,n){let o={indices:n.indices,primitiveType:ve.TRIANGLES};An.toWireframe(o);let r=o.indices,s=_t.createIndexBuffer({context:e,typedArray:r,usage:Ne.STATIC_DRAW,indexDatatype:Me.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var age,cge,$O;(function(){let e=new Rt({geometry:Fm.fromDimensions({dimensions:new m(2,2,2)})}),t=new Rt({geometry:new Ib({radius:1})}),n=new M,i,o;function r(s){return new In({geometryInstances:s,appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}age=function(s,a){return s===i||($O(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Yt.fromColor(a),o=r(e)),o},cge=function(s,a){return s===i||($O(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Yt.fromColor(a),o=r(t)),o},$O=function(){c(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Pct=new ce(0,0,0,0),vct={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},Fct=Y.TRANSPARENT,Act=new Nt;function Mct(e,t,n){let i=t.data;c(i.vertexArray)||(i.fill===void 0&&(i.fill=new sL(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(c(r)&&c(r.credits)){let ge=r.credits;for(let Le=0,yn=ge.length;Le<yn;++Le)o.addCreditToNextFrame(ge[Le])}let s=mt.maximumTextureImageUnits,a=i.waterMaskTexture,l=i.waterMaskTranslationAndScale;!c(a)&&c(i.fill)&&(a=i.fill.waterMaskTexture,l=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,f=u.translucent,p=u.frontFaceAlphaByDistance,y=u.backFaceAlphaByDistance,h=u.rectangle,g=e.undergroundColor??Fct,x=e.undergroundColorAlphaByDistance??Act,S=sge(e,n)&&n.mode===se.SCENE3D&&g.alpha>0&&(x.nearValue>0||x.farValue>0),V=e.lambertDiffuseMultiplier,Z=e.vertexShadowDarkness,R=e.hasWaterMask&&c(a),E=R&&e.showWaterEffect,I=e.oceanNormalMap,v=E&&c(I),P=e.terrainProvider,F=c(P)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!d,b=e.showGroundAtmosphere&&n.mode===se.SCENE3D,G=Sn.castShadows(e.shadows)&&!f,X=Sn.receiveShadows(e.shadows)&&!f,W=e.hueShift,A=e.saturationShift,k=e.brightnessShift,B=!(w.equalsEpsilon(W,0,w.EPSILON7)&&w.equalsEpsilon(A,0,w.EPSILON7)&&w.equalsEpsilon(k,0,w.EPSILON7)),O=!1;if(b){let ge=m.magnitude(n.camera.positionWC),Le=e.nightFadeOutDistance;O=ge>Le}R&&--s,v&&--s,c(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,c(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,c(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let H=i.renderedMesh,U=H.center,K=H.encoding,Q=i.tileBoundingRegion,ie=n.verticalExaggeration,j=n.verticalExaggerationRelativeHeight,$=ie!==1,ne=K.hasGeodeticSurfaceNormals,be=Tct,Ce=0,me=0,_e=0,Ve=0,Ie=!1;if(n.mode!==se.SCENE3D){let ge=n.mapProjection,Le=ge.project(de.southwest(t.rectangle),Lct),yn=ge.project(de.northeast(t.rectangle),Zct);if(be.x=Le.x,be.y=Le.y,be.z=yn.x,be.w=yn.y,n.mode!==se.MORPHING&&(U=Vct,U.x=0,U.y=(be.z+be.x)*.5,U.z=(be.w+be.y)*.5,be.x-=U.y,be.y-=U.z,be.z-=U.y,be.w-=U.z),n.mode===se.SCENE2D&&K.quantization===qs.BITS12){let bt=1/(Math.pow(2,12)-1)*.5,ro=(be.z-be.x)*bt,Xo=(be.w-be.y)*bt;be.x-=ro,be.y-=Xo,be.z+=ro,be.w+=Xo}ge instanceof Wi&&(Ce=t.rectangle.south,me=t.rectangle.north,_e=Wi.geodeticLatitudeToMercatorAngle(Ce),Ve=1/(Wi.geodeticLatitudeToMercatorAngle(me)-_e),Ie=!0)}let Ze=vct;Ze.frameState=n,Ze.surfaceTile=i,Ze.hasWaterMask=R,Ze.showReflectiveOcean=E,Ze.showOceanWaves=v,Ze.enableLighting=e.enableLighting,Ze.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ze.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ze.showGroundAtmosphere=b,Ze.atmosphereLightIntensity=e.atmosphereLightIntensity,Ze.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ze.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ze.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ze.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ze.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ze.perFragmentGroundAtmosphere=O,Ze.hasVertexNormals=F,Ze.useWebMercatorProjection=Ie,Ze.clippedByBoundaries=i.clippedByBoundaries,Ze.hasGeodeticSurfaceNormals=ne,Ze.hasExaggeration=$;let De=i.imagery,Ke=0,rt=De.length,Xt=e.showSkirts&&!d&&!f,Ht=e.backFaceCulling&&!d&&!f,qe=Ht?e._renderState:e._disableCullingRenderState,mn=Ht?e._blendRenderState:e._disableCullingBlendRenderState,Dt=qe,Lt=e._firstPassInitialColor,Vi=n.context;if(c(e._debug.boundingSphereTile)||$O(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let ge=e._drawCommands.length;for(let Le=0;Le<ge;++Le)e._uniformMaps[Le]=ige(n,e)}do{let ge=0,Le,yn;if(e._drawCommands.length<=e._usedDrawCommands?(Le=new et,Le.owner=t,Le.cull=!1,Le.boundingVolume=new ue,Le.orientedBoundingBox=void 0,yn=ige(n,e),e._drawCommands.push(Le),e._uniformMaps.push(yn)):(Le=e._drawCommands[e._usedDrawCommands],yn=e._uniformMaps[e._usedDrawCommands]),Le.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let aa=Q.boundingVolume,_l=Q.boundingSphere;c(aa)?age(aa,Y.RED).update(n):c(_l)&&cge(_l,Y.RED).update(n)}let bt=yn.properties;ce.clone(Lt,bt.initialColor),bt.oceanNormalMap=I,bt.lightingFadeDistance.x=e.lightingFadeOutDistance,bt.lightingFadeDistance.y=e.lightingFadeInDistance,bt.nightFadeDistance.x=e.nightFadeOutDistance,bt.nightFadeDistance.y=e.nightFadeInDistance,bt.atmosphereLightIntensity=e.atmosphereLightIntensity,bt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,bt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,bt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,bt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,bt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,bt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ro=d?y:p,Xo=d?p:y;c(ro)&&(ce.fromElements(ro.near,ro.nearValue,ro.far,ro.farValue,bt.frontFaceAlphaByDistance),ce.fromElements(Xo.near,Xo.nearValue,Xo.far,Xo.farValue,bt.backFaceAlphaByDistance)),ce.fromElements(x.near,x.nearValue,x.far,x.farValue,bt.undergroundColorAlphaByDistance),Y.clone(g,bt.undergroundColor),bt.lambertDiffuseMultiplier=V,bt.vertexShadowDarkness=Z;let ra=!c(i.vertexArray)&&c(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;ra&&Y.clone(e.fillHighlightColor,bt.fillHighlightColor),bt.verticalExaggerationAndRelativeHeight.x=ie,bt.verticalExaggerationAndRelativeHeight.y=j,bt.center3D=H.center,m.clone(U,bt.rtc),ce.clone(be,bt.tileRectangle),bt.southAndNorthLatitude.x=Ce,bt.southAndNorthLatitude.y=me,bt.southMercatorYAndOneOverHeight.x=_e,bt.southMercatorYAndOneOverHeight.y=Ve;let Wr=Sct,_s=qO(t.rectangle,e.cartographicLimitRectangle),Ae=Cct,st=qO(t.rectangle,h);m.fromElements(W,A,k,bt.hsbShift);let Qe=t.rectangle,$e=1/Qe.width,yt=1/Qe.height;Wr.x=(_s.west-Qe.west)*$e,Wr.y=(_s.south-Qe.south)*yt,Wr.z=(_s.east-Qe.west)*$e,Wr.w=(_s.north-Qe.south)*yt,ce.clone(Wr,bt.localizedCartographicLimitRectangle),Ae.x=(st.west-Qe.west)*$e,Ae.y=(st.south-Qe.south)*yt,Ae.z=(st.east-Qe.west)*$e,Ae.w=(st.north-Qe.south)*yt,ce.clone(Ae,bt.localizedTranslucencyRectangle);let Bt=N&&w.fog(t._distance,n.fog.density)>w.EPSILON3;B=B&&(Bt||b);let Ln=!1,Io=!1,To=!1,Ka=!1,Ja=!1,Li=!1,bi=!1,sa=!1,Qr=!1,xl=!1;for(;ge<s&&Ke<rt;){let aa=De[Ke],_l=aa.readyImagery;if(++Ke,!c(_l)||_l.imageryLayer.alpha===0)continue;let ja=aa.useWebMercatorT?_l.textureWebMercator:_l.texture;if(!c(ja))throw new L("readyImagery is not actually ready!");let ds=_l.imageryLayer;c(aa.textureTranslationAndScale)||(aa.textureTranslationAndScale=ds._calculateTextureTranslationAndScale(t,aa)),bt.dayTextures[ge]=ja,bt.dayTextureTranslationAndScale[ge]=aa.textureTranslationAndScale,bt.dayTextureTexCoordsRectangle[ge]=aa.textureCoordinateRectangle,bt.dayTextureUseWebMercatorT[ge]=aa.useWebMercatorT,bt.dayTextureAlpha[ge]=ds.alpha,Li=Li||bt.dayTextureAlpha[ge]!==1,bt.dayTextureNightAlpha[ge]=ds.nightAlpha,bi=bi||bt.dayTextureNightAlpha[ge]!==1,bt.dayTextureDayAlpha[ge]=ds.dayAlpha,bi=bi||bt.dayTextureDayAlpha[ge]!==1,bt.dayTextureBrightness[ge]=ds.brightness,Ln=Ln||bt.dayTextureBrightness[ge]!==Ya.DEFAULT_BRIGHTNESS,bt.dayTextureContrast[ge]=ds.contrast,Io=Io||bt.dayTextureContrast[ge]!==Ya.DEFAULT_CONTRAST,bt.dayTextureHue[ge]=ds.hue,To=To||bt.dayTextureHue[ge]!==Ya.DEFAULT_HUE,bt.dayTextureSaturation[ge]=ds.saturation,Ka=Ka||bt.dayTextureSaturation[ge]!==Ya.DEFAULT_SATURATION,bt.dayTextureOneOverGamma[ge]=1/ds.gamma,Ja=Ja||bt.dayTextureOneOverGamma[ge]!==1/Ya.DEFAULT_GAMMA,bt.dayTextureSplit[ge]=ds.splitDirection,sa=sa||bt.dayTextureSplit[ge]!==0;let uu=bt.dayTextureCutoutRectangles[ge];if(c(uu)||(uu=bt.dayTextureCutoutRectangles[ge]=new ce),ce.clone(ce.ZERO,uu),c(ds.cutoutRectangle)){let Ao=qO(Qe,ds.cutoutRectangle),dn=de.simpleIntersection(Ao,Qe,rge);Qr=c(dn)||Qr,uu.x=(Ao.west-Qe.west)*$e,uu.y=(Ao.south-Qe.south)*yt,uu.z=(Ao.east-Qe.west)*$e,uu.w=(Ao.north-Qe.south)*yt}let mu=bt.colorsToAlpha[ge];c(mu)||(mu=bt.colorsToAlpha[ge]=new ce);let fu=c(ds.colorToAlpha)&&ds.colorToAlphaThreshold>0;if(xl=xl||fu,fu){let Ao=ds.colorToAlpha;mu.x=Ao.red,mu.y=Ao.green,mu.z=Ao.blue,mu.w=ds.colorToAlphaThreshold}else mu.w=-1;if(c(_l.credits)){let Ao=_l.credits;for(let dn=0,Re=Ao.length;dn<Re;++dn)o.addCreditToNextFrame(Ao[dn])}++ge}bt.dayTextures.length=ge,bt.waterMask=a,ce.clone(l,bt.waterMaskTranslationAndScale),bt.minMaxHeight.x=K.minimumHeight,bt.minMaxHeight.y=K.maximumHeight,M.clone(K.matrix,bt.scaleAndBias);let yo=e._clippingPlanes,wr=c(yo)&&yo.enabled&&t.isClipped;wr&&(bt.clippingPlanesEdgeColor=Y.clone(yo.edgeColor,bt.clippingPlanesEdgeColor),bt.clippingPlanesEdgeWidth=yo.edgeWidth);let gp=e._clippingPolygons,jr=c(gp)&&gp.enabled&&t.isClipped;Ze.numberOfDayTextures=ge,Ze.applyBrightness=Ln,Ze.applyContrast=Io,Ze.applyHue=To,Ze.applySaturation=Ka,Ze.applyGamma=Ja,Ze.applyAlpha=Li,Ze.applyDayNightAlpha=bi,Ze.applySplit=sa,Ze.enableFog=Bt,Ze.enableClippingPlanes=wr,Ze.clippingPlanes=yo,Ze.enableClippingPolygons=jr,Ze.clippingPolygons=gp,Ze.hasImageryLayerCutout=Qr,Ze.colorCorrect=B,Ze.highlightFillTile=ra,Ze.colorToAlpha=xl,Ze.showUndergroundColor=S,Ze.translucent=f;let du=i.renderedMesh.indices.length;Xt||(du=i.renderedMesh.indexCountWithoutSkirts),Le.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ze),Le.castShadows=G,Le.receiveShadows=X,Le.renderState=Dt,Le.primitiveType=ve.TRIANGLES,Le.vertexArray=i.vertexArray||i.fill.vertexArray,Le.count=du,Le.uniformMap=yn,Le.pass=Xe.GLOBE,e._debug.wireframe&&(Wct(Vi,e,t),c(i.wireframeVertexArray)&&(Le.vertexArray=i.wireframeVertexArray,Le.primitiveType=ve.LINES,Le.count=du*2));let Qa=Le.boundingVolume,ex=Le.orientedBoundingBox;n.mode!==se.SCENE3D?(ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,Q.minimumHeight,Q.maximumHeight,Qa),m.fromElements(Qa.center.z,Qa.center.x,Qa.center.y,Qa.center),n.mode===se.MORPHING&&(Qa=ue.union(Q.boundingSphere,Qa,Qa))):(Le.boundingVolume=ue.clone(Q.boundingSphere,Qa),Le.orientedBoundingBox=Xn.clone(Q.boundingVolume,ex)),Le.dirty=!0,f&&u.updateDerivedCommands(Le,n),oge(Le,n),Dt=mn,Lt=Pct}while(Ke<rt)}var mF=ar;var tFi=_(T(),1);function lge(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=de.clone(de.MAX_VALUE)}Object.defineProperties(lge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){C.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){C.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),C.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new L("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=Nt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){C.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),C.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new L("far distance must be greater than near distance.");this._backFaceAlphaByDistance=Nt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){c(e)||(e=de.clone(de.MAX_VALUE)),de.clone(e,this._rectangle)}}});var fF=lge;var dFi=_(T(),1);function Ps(){this._layers=[],this.layerAdded=new ye,this.layerRemoved=new ye,this.layerMoved=new ye,this.layerShownOrHidden=new ye}Object.defineProperties(Ps.prototype,{length:{get:function(){return this._layers.length}}});Ps.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new L("layer is required.");if(n){if(t<0)throw new L("index must be greater than or equal to zero.");if(t>this._layers.length)throw new L("index must be less than or equal to the number of layers.")}n?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()})};Ps.prototype.addImageryProvider=function(e,t){if(!c(e))throw new L("imageryProvider is required.");let n=new Ya(e);return this.add(n,t),n};Ps.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};Ps.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=[]};Ps.prototype.contains=function(e){return this.indexOf(e)!==-1};Ps.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ps.prototype.get=function(e){if(!c(e))throw new L("index is required.","index");return this._layers[e]};function eD(e,t){if(!c(t))throw new L("layer is required.");let n=e.indexOf(t);if(n===-1)throw new L("layer is not in this collection.");return n}function dge(e,t,n){let i=e._layers;if(t=w.clamp(t,0,i.length-1),n=w.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)}Ps.prototype.raise=function(e){let t=eD(this._layers,e);dge(this,t,t+1)};Ps.prototype.lower=function(e){let t=eD(this._layers,e);dge(this,t,t-1)};Ps.prototype.raiseToTop=function(e){let t=eD(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))};Ps.prototype.lowerToBottom=function(e){let t=eD(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 Nct=new de;function uge(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!c(r)&&a<o.length;++a){let l=o[a];de.contains(l.rectangle,t)&&(r=l)}if(!c(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let l=s[a],d=l.readyImagery;if(!c(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!c(u.pickFeatures)||!de.contains(d.rectangle,t))continue;let f=Nct,p=1/1024;f.west=w.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.x-p),f.east=w.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.z+p),f.south=w.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.y-p),f.north=w.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.w+p),de.contains(f,t)&&i(d)}}Ps.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(uge(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ps.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(uge(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let l=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);c(l)&&(o.push(l),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let l=0;l<s.length;++l){let d=s[l],u=r[l];if(c(d)&&d.length>0)for(let f=0;f<d.length;++f){let p=d[f];p.imageryLayer=u,c(p.position)||(p.position=i),a.push(p)}}return a})};Ps.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ps.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ps.prototype.isDestroyed=function(){return!1};Ps.prototype.destroy=function(){return this.removeAll(!0),he(this)};Ps.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&&(c(i._show)&&(c(n)||(n=[]),n.push(i)),i._show=i.show);if(c(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var hF=Ps;var YFi=_(T(),1);var hFi=_(T(),1);function mge(e){this._ellipsoid=new kb(e.ellipsoid,m.ZERO)}Object.defineProperties(mge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var pF=mge;var TFi=_(T(),1);var u4=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()}},kct=1e3;function ea(e){if(!c(e))throw new L("options is required.");if(c(e.x))if(c(e.y)){if(e.x<0||e.y<0)throw new L("options.x and options.y must be greater than or equal to zero.")}else throw new L("options.y is required.");else throw new L("options.x is required.");if(!c(e.level))throw new L("options.level is required and must be greater than or equal to zero.");if(!c(e.tilingScheme))throw new L("options.tilingScheme is required.");this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Jn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new u4(kct),this.state=$s.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}ea.createLevelZeroTiles=function(e){if(!c(e))throw new L("tilingScheme is required.");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 ea({tilingScheme:e,x:s,y:r,level:0});return i};var Uct=256;function Oct(e,t,n,i){let o=n.width/Uct*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}ea.prototype._getCacheKey=function(e,t){return Oct(e.longitude,e.latitude,this._rectangle,t)};ea.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};ea.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};ea.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};ea.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(c(t)&&c(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(c(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let l=a.customData;for(o=0;o<l.length;++o)r=l[o],de.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(ea.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 c(this._southwestChild)||(this._southwestChild=new ea({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return c(this._southeastChild)||(this._southeastChild=new ea({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 c(this._northwestChild)||(this._northwestChild=new ea({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return c(this._northeastChild)||(this._northeastChild=new ea({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<$s.DONE}},eligibleForUnloading:{get:function(){let e=!0;return c(this.data)&&(e=this.data.eligibleForUnloading,c(e)||(e=!0)),e}}});ea.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]};ea.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};ea.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};ea.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};ea.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};ea.prototype.freeResources=function(){this.clearPositionCache(),this.state=$s.START,this.renderable=!1,this.upsampledFromParent=!1,c(this.data)&&c(this.data.freeResources)&&this.data.freeResources(),tD(this._southwestChild),this._southwestChild=void 0,tD(this._southeastChild),this._southeastChild=void 0,tD(this._northwestChild),this._northwestChild=void 0,tD(this._northeastChild),this._northeastChild=void 0};function tD(e){c(e)&&e.freeResources()}var bF=ea;var VFi=_(T(),1);function nD(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}nD.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};nD.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&c(this._lastBeforeStartOfFrame)&&this.count>e&&c(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),fge(this,t)),t=i}};function fge(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}nD.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!c(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(c(e.replacementPrevious)||c(e.replacementNext))&&fge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var yF=nD;function fm(e){if(!c(e)||!c(e.tileProvider))throw new L("options.tileProvider is required.");if(c(e.tileProvider.quadtree))throw new L("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new yF,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new pF({ellipsoid:n}),this._tileLoadProgressEvent=new ye,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(fm.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});fm.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Dct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,pge(e);let n=e._levelZeroTiles;if(c(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let l=r[a];l.level=0,e._addHeightCallbacks.push(l)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}fm.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;c(t);)t.state!==$s.START&&e(t),t=t.replacementNext};fm.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};fm.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};fm.prototype.update=function(e){c(this._tileProvider.update)&&this._tileProvider.update(e)};function pge(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}fm.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Dct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),pge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};fm.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),zct(this,e),ilt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Bct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=ye.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))}fm.prototype.endFrame=function(e){!e.passes.render||e.mode===se.MORPHING||($ct(this,e),nlt(this,e),Bct(this,e))};fm.prototype.isDestroyed=function(){return!1};fm.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var xF,hge=new pe;function Yct(e,t){let n=de.center(e.rectangle,hge),i=n.longitude-xF.longitude,o=n.latitude-xF.latitude;n=de.center(t.rectangle,hge);let r=n.longitude-xF.longitude,s=n.latitude-xF.latitude;return i*i+o*o-(r*r+s*s)}var Hct=new m,gF=[];function zct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!c(e._levelZeroTiles)){let g=r.tilingScheme;if(c(g)){let x=r.tilingScheme;e._levelZeroTiles=bF.createLevelZeroTiles(x);let S=e._levelZeroTiles.length;if(gF.length<S)for(gF=new Array(S),o=0;o<S;++o)gF[o]===void 0&&(gF[o]=new _F)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,l=a.length>1?e._occluders:void 0;xF=t.camera.positionCartographic,a.sort(Yct);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,f=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(f,d,u);d.length=0,u.length=0}let y=t.camera;e._cameraPositionCartographic=y.positionCartographic;let h=M.getTranslation(y.transform,Hct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(h,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ha(e,s,r,t,l,!1,gF[o]):(f0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=f}function f0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function _F(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function bge(){this.southwest=new _F,this.southeast=new _F,this.northwest=new _F,this.northeast=new _F}bge.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 f4=new Array(31);for(let e=0;e<f4.length;++e)f4[e]=new bge;function Kct(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=jct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,l=n.southeastChild,d=n.northwestChild,u=n.northeastChild,f=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===f?n._lastSelectionResult:Jn.NONE,y=e.tileProvider;if(s||i){let h=Jn.originalResult(p)===Jn.RENDERED,g=Jn.originalResult(p)===Jn.CULLED||p===Jn.NONE,x=n.state===$s.DONE,S=h||g||x;if(S||c(y.canRenderWithoutLosingDetail)&&(S=y.canRenderWithoutLosingDetail(n)),S){s&&f0(e,e._tileLoadQueueMedium,n,t),iD(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&f0(e,e._tileLoadQueueHigh,n,t)}if(y.canRefine(n)){if(a.upsampledFromParent&&l.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){iD(e,n),f0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.REFINED;let g=e._tilesToRender.length,x=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,Z=e._tileToUpdateHeights.length;if(Jct(e,a,l,d,u,t,i,o),g!==e._tilesToRender.length){let R=o.allAreRenderable,E=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,v=!1;if(!R&&!E){let P=e._tilesToRender;for(let N=g;N<P.length;++N){let b=P[N];for(;b!==void 0&&b._lastSelectionResult!==Jn.KICKED&&b!==n;)b._lastSelectionResult=Jn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=g,e._tileToUpdateHeights.length=Z,iD(e,n),n._lastSelectionResult=Jn.RENDERED;let F=p===Jn.RENDERED;!F&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=x,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=V,f0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=F,F||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&f0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Jn.RENDERED,iD(e,n),f0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Jn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Jct(e,t,n,i,o,r,s,a){let l=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,f=f4[t.level],p=f.southwest,y=f.southeast,h=f.northwest,g=f.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(Ha(e,t,d,r,u,s,p),Ha(e,n,d,r,u,s,y),Ha(e,i,d,r,u,s,h),Ha(e,o,d,r,u,s,g)):(Ha(e,i,d,r,u,s,h),Ha(e,t,d,r,u,s,p),Ha(e,o,d,r,u,s,g),Ha(e,n,d,r,u,s,y)):l.latitude<t.rectangle.north?(Ha(e,n,d,r,u,s,y),Ha(e,t,d,r,u,s,p),Ha(e,o,d,r,u,s,g),Ha(e,i,d,r,u,s,h)):(Ha(e,o,d,r,u,s,g),Ha(e,i,d,r,u,s,h),Ha(e,n,d,r,u,s,y),Ha(e,t,d,r,u,s,p)),f.combine(a)}function Qct(e,t){let n=t.rectangle;return c(e._cameraPositionCartographic)&&de.contains(n,e._cameraPositionCartographic)||c(e._cameraReferenceFrameOriginCartographic)&&de.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ha(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==yr.NONE)return Kct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,Qct(e,t)){(!c(t.data)||!c(t.data.vertexArray))&&f0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===a?t._lastSelectionResult:Jn.NONE;l!==Jn.CULLED_BUT_NEEDED&&l!==Jn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Jn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(f0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Jn.CULLED):t._lastSelectionResult=Jn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function jct(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof sn||t.camera.frustum instanceof Oo)return qct(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-=w.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function qct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;c(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,l=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,l),f=d/u;return t.fog.enabled&&t.mode!==se.SCENE2D&&(f-=w.fog(n._distance,t.fog.density)*t.fog.sse),f/=t.pixelRatio,f}function iD(e,t){e._tilesToRender.push(t)}function $ct(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=Ti()+e._loadQueueTimeSlice,s=e._tileProvider,a=m4(e,t,s,r,n,!1);a=m4(e,t,s,r,i,a),m4(e,t,s,r,o,a)}function elt(e,t){return e._loadPriority-t._loadPriority}function m4(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(elt);for(let s=0,a=o.length;s<a&&(Ti()<i||!r);++s){let l=o[s];e._tileReplacementQueue.markTileRendered(l),n.loadTile(t,l),r=!0}return r}var aL=new bn,oD=new pe,Gg=new m,tlt=[];function nlt(e,t){if(!c(e.tileProvider.tilingScheme))return;let n=tlt;n.length=0;let i=e._tileToUpdateHeights,o=Ti(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,l=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let f=i[0];if(!c(f.data)||!c(f.data.mesh)){let g=f._lastSelectionResultFrame===e._lastSelectionFrameNumber?f._lastSelectionResult:Jn.NONE;(g===Jn.RENDERED||g===Jn.CULLED_BUT_NEEDED)&&n.push(f),f.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=f.customData,y=p.length,h=!1;for(u=e._lastTileIndex;u<y;++u){let g=p[u],x=f.data.terrainData,S=c(x)&&x.wasCreatedByUpsampling();if(f.level>g.level&&!S){let V,Z=f.getPositionCacheEntry(g.positionCartographic,e.maximumScreenSpaceError);if(c(Z))V=Z;else{if(c(g.positionOnEllipsoidSurface)||(g.positionOnEllipsoidSurface=m.fromRadians(g.positionCartographic.longitude,g.positionCartographic.latitude,0,d)),a===se.SCENE3D){let R=d.geodeticSurfaceNormal(g.positionOnEllipsoidSurface,aL.direction),E=d.getSurfaceNormalIntersectionWithZAxis(g.positionOnEllipsoidSurface,11500,aL.origin);if(!c(E)){let I=0;c(f.data.tileBoundingRegion)&&(I=f.data.tileBoundingRegion.minimumHeight);let v=Math.min(I,-11500),P=m.multiplyByScalar(R,Math.abs(v)+1,Gg);m.subtract(g.positionOnEllipsoidSurface,P,aL.origin)}}else pe.clone(g.positionCartographic,oD),oD.height=-11500,l.project(oD,Gg),m.fromElements(Gg.z,Gg.x,Gg.y,Gg),m.clone(Gg,aL.origin),m.clone(m.UNIT_X,aL.direction);V=f.data.pick(aL,a,l,!1,Gg),c(V)&&f.setPositionCacheEntry(g.positionCartographic,e.maximumScreenSpaceError,V)}if(c(V)){if(c(g.callback)){let R=d.cartesianToCartographic(V,oD);g.callback(R)}g.level=f.level}}if(Ti()>=s){h=!0;break}}if(h){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function ilt(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 TF=fm;function kf(e){e=e??re.default;let t=new ep({ellipsoid:e}),n=new hF;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new qv,this._material=void 0,this._surface=new TF({tileProvider:new mF({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new ye,this._undergroundColor=Y.clone(Y.BLACK),this._undergroundColorAlphaByDistance=new Nt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new fF,p4(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ge({url:on("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=re.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=w.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=w.PI*e.minimumRadius,this.nightFadeOutDistance=w.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*w.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Sn.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(kf.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 c(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){c(e)||(e=de.clone(de.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),c(this._material)&&p4(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,p4(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=Y.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new L("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=Nt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function p4(e){let t=[],n=c(e._material)&&(c(e._material.shaderSource.match(/slope/))||c(e._material.shaderSource.match("normalEC"))),i=[$m,DV];c(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(Nv),e._surfaceShaderSet.baseVertexShaderSource=new Be({sources:[$m,DV,kv],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Be({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function olt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),o=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var rlt=[],slt={start:0,stop:0};kf.prototype.pickWorldCoordinates=function(e,t,n,i){if(!c(e))throw new L("ray is required");if(!c(t))throw new L("scene is required");n=n??!0;let o=t.mode,r=t.mapProjection,s=rlt;s.length=0;let a=this._surface._tilesToRender,l=a.length,d,u;for(u=0;u<l;++u){d=a[u];let p=d.data;if(!c(p))continue;let y=p.pickBoundingSphere;if(o!==se.SCENE3D)p.pickBoundingSphere=y=ue.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,y),m.fromElements(y.center.z,y.center.x,y.center.y,y.center);else if(c(p.renderedMesh))ue.clone(p.tileBoundingRegion.boundingSphere,y);else continue;let h=qn.raySphere(e,y,slt);c(h)&&s.push(p)}s.sort(olt(e.origin));let f;for(l=s.length,u=0;u<l&&(f=s[u].pick(e,t.mode,t.mapProjection,n,i),!c(f));++u);return f};var alt=new pe;kf.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),c(n)&&t.mode!==se.SCENE3D){n=m.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,alt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var clt=new m,yge=new m,llt=new pe,dlt=new bn;function h4(e,t){return c(e)&&de.contains(e.rectangle,t)?e:void 0}kf.prototype.getHeight=function(e){if(!c(e))throw new L("cartographic is required");let t=this._surface._levelZeroTiles;if(!c(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!de.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;c(n);)n=h4(n._southwestChild,e)||h4(n._southeastChild,e)||h4(n._northwestChild,e)||n._northeastChild,c(n)&&c(n.data)&&c(n.data.renderedMesh)&&(r=n);if(n=r,!c(n)||!c(n.data)||!c(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,l=m.fromRadians(e.longitude,e.latitude,0,a,clt),d=dlt,u=a.geodeticSurfaceNormal(l,d.direction),f=a.getSurfaceNormalIntersectionWithZAxis(l,11500,d.origin);if(!c(f)){let y;c(n.data.tileBoundingRegion)&&(y=n.data.tileBoundingRegion.minimumHeight);let h=Math.min(y??0,-11500),g=m.multiplyByScalar(u,Math.abs(h)+1,yge);m.subtract(l,g,d.origin)}let p=n.data.pick(d,void 0,s,!1,yge);if(c(p))return a.cartesianToCartographic(p,llt).height};kf.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};kf.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=c(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,l=a.url;if(c(l)){let d=this;a.fetchImage().then(function(u){l===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new Pt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===se.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};kf.prototype.render=function(e){this.show&&(c(this._material)&&this._material.update(e.context),this._surface.render(e))};kf.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};kf.prototype.isDestroyed=function(){return!1};kf.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(),he(this)};var SF=kf;var R9i=_(T(),1);var UAi=_(T(),1);var WAi=_(T(),1);var LAi=_(T(),1);function ult(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var CF=ult;var Ige={},mlt=32.184,flt=2451545,gge=-.0529921,xge=-.1059842,_ge=13.0120009,Tge=13.3407154,Sge=.9856003,Cge=26.4057084,Vge=13.064993,Lge=.3287146,Zge=1.7484877,Rge=-.1589763,Gge=.0036096,Ege=.1643573,Xge=12.9590088,b4=new ee;Ige.ComputeMoon=function(e,t){c(e)||(e=ee.now()),b4=ee.addSeconds(e,mlt,b4);let n=ee.totalDays(b4)-flt,i=n/Kn.DAYS_PER_JULIAN_CENTURY,o=(125.045+gge*n)*w.RADIANS_PER_DEGREE,r=(250.089+xge*n)*w.RADIANS_PER_DEGREE,s=(260.008+_ge*n)*w.RADIANS_PER_DEGREE,a=(176.625+Tge*n)*w.RADIANS_PER_DEGREE,l=(357.529+Sge*n)*w.RADIANS_PER_DEGREE,d=(311.589+Cge*n)*w.RADIANS_PER_DEGREE,u=(134.963+Vge*n)*w.RADIANS_PER_DEGREE,f=(276.617+Lge*n)*w.RADIANS_PER_DEGREE,p=(34.226+Zge*n)*w.RADIANS_PER_DEGREE,y=(15.134+Rge*n)*w.RADIANS_PER_DEGREE,h=(119.743+Gge*n)*w.RADIANS_PER_DEGREE,g=(239.961+Ege*n)*w.RADIANS_PER_DEGREE,x=(25.053+Xge*n)*w.RADIANS_PER_DEGREE,S=Math.sin(o),V=Math.sin(r),Z=Math.sin(s),R=Math.sin(a),E=Math.sin(l),I=Math.sin(d),v=Math.sin(u),P=Math.sin(f),F=Math.sin(p),N=Math.sin(y),b=Math.sin(h),G=Math.sin(g),X=Math.sin(x),W=Math.cos(o),A=Math.cos(r),k=Math.cos(s),B=Math.cos(a),O=Math.cos(l),H=Math.cos(d),U=Math.cos(u),K=Math.cos(f),Q=Math.cos(p),ie=Math.cos(y),j=Math.cos(h),$=Math.cos(g),ne=Math.cos(x),be=(269.9949+.0031*i-3.8787*S-.1204*V+.07*Z-.0172*R+.0072*I-.0052*N+.0043*X)*w.RADIANS_PER_DEGREE,Ce=(66.5392+.013*i+1.5419*W+.0239*A-.0278*k+.0068*B-.0029*H+9e-4*U+8e-4*ie-9e-4*ne)*w.RADIANS_PER_DEGREE,me=(38.3213+13.17635815*n-14e-13*n*n+3.561*S+.1208*V-.0642*Z+.0158*R+.0252*E-.0066*I-.0047*v-.0046*P+.0028*F+.0052*N+.004*b+.0019*G-.0044*X)*w.RADIANS_PER_DEGREE,_e=(13.17635815-14e-13*(2*n)+3.561*W*gge+.1208*A*xge-.0642*k*_ge+.0158*B*Tge+.0252*O*Sge-.0066*H*Cge-.0047*U*Vge-.0046*K*Lge+.0028*Q*Zge+.0052*ie*Rge+.004*j*Gge+.0019*$*Ege-.0044*ne*Xge)/86400*w.RADIANS_PER_DEGREE;return c(t)||(t=new CF),t.rightAscension=be,t.declination=Ce,t.rotation=me,t.rotationRate=_e,t};var VF=Ige;function Wge(e){(!c(e)||typeof e!="function")&&(e=VF.ComputeMoon),this._computeFunction=e}var hlt=new m,plt=new m,blt=new m;function ylt(e,t,n){let i=hlt;i.x=Math.cos(e+w.PI_OVER_TWO),i.y=Math.sin(e+w.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=blt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=m.cross(r,i,plt);return c(n)||(n=new te),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 glt=new te,xlt=new Fe;Wge.prototype.evaluate=function(e,t){c(e)||(e=ee.now());let n=this._computeFunction(e),i=ylt(n.rightAscension,n.declination,t),o=w.zeroToTwoPi(n.rotation),r=Fe.fromAxisAngle(m.UNIT_Z,o,xlt),s=te.fromQuaternion(Fe.conjugate(r,r),glt);return te.multiply(s,i,i)};var LF=Wge;var m9i=_(T(),1);var y4={position:0};function rD(e){e=e??z.EMPTY_OBJECT,this.center=m.clone(e.center??m.ZERO),this._center=new m,this.radii=m.clone(e.radii),this._radii=new m,this._oneOverEllipsoidRadiiSquared=new m,this._boundingSphere=new ue,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??zi.fromType(zi.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 _lt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(c(t))return t;let n=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:We.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:y4,bufferUsage:Ne.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}rD.prototype.update=function(e){if(!this.show||e.mode!==se.SCENE3D||!c(this.center)||!c(this.radii))return;if(!c(this.material))throw new L("this.material must be defined.");let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!c(this._rs)||i)&&(this._translucent=n,this._rs=Oe.fromCache({cull:{enabled:!0,face:_i.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),c(this._va)||(this._va=_lt(t));let o=!1,r=this.radii;if(!m.equals(this._radii,r)){m.clone(r,this._radii);let g=this._oneOverEllipsoidRadiiSquared;g.x=1/(r.x*r.x),g.y=1/(r.y*r.y),g.z=1/(r.z*r.z),o=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!m.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),m.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(m.clone(m.ZERO,this._boundingSphere.center),this._boundingSphere.radius=m.maximumComponent(r),ue.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let l=e.useLogDepth,d=this._useLogDepth!==l;this._useLogDepth=l;let u=this._colorCommand,f,p;(s||a||i||d)&&(f=new Be({sources:[OV]}),p=new Be({sources:[this.material.shaderSource,UV]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(f.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:y4}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=St(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let y=e.commandList,h=e.passes;if(h.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Xe.TRANSLUCENT:Xe.OPAQUE,y.push(u)),h.pick){let g=this._pickCommand;(!c(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||!c(this._pickSP)||d)&&(f=new Be({sources:[OV]}),p=new Be({sources:[this.material.shaderSource,UV],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(f.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=tn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:f,fragmentShaderSource:p,attributeLocations:y4}),g.vertexArray=this._va,g.renderState=this._rs,g.shaderProgram=this._pickSP,g.uniformMap=St(St(this._uniforms,this._pickUniforms),this.material._uniforms),g.executeInClosestFrustum=n),g.boundingVolume=this._boundingSphere,g.modelMatrix=this._computedModelMatrix,g.pass=n?Xe.TRANSLUCENT:Xe.OPAQUE,y.push(g)}};rD.prototype.isDestroyed=function(){return!1};rD.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(),he(this)};var ZF=rD;function RF(e){e=e??z.EMPTY_OBJECT;let t=e.textureUrl;c(t)||(t=on("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??re.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new ZF({radii:this.ellipsoid.radii,material:zi.fromType(zi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new LF}Object.defineProperties(RF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var sD=new te,Tlt=new te,Slt=new m,aD=[];RF.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;c(wt.computeIcrfToFixedMatrix(n,sD))||wt.computeTemeToPseudoFixedMatrix(n,sD);let i=this._axes.evaluate(n,Tlt);te.transpose(i,i),te.multiply(sD,i,i);let o=Y0.computeMoonPositionInEarthInertialFrame(n,Slt);te.multiplyByVector(sD,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=aD,aD.length=0,t.update(e),e.commandList=r,aD.length===1?aD[0]:void 0};RF.prototype.isDestroyed=function(){return!1};RF.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),he(this)};var GF=RF;var c6i=_(T(),1);var I9i=_(T(),1);var g4=[],x4=[];function Clt(e,t,n,i,o,r){let s=o-i+1,a=r-o,l=g4,d=x4,u,f;for(u=0;u<s;++u)l[u]=e[i+u];for(f=0;f<a;++f)d[f]=e[o+f+1];u=0,f=0;for(let p=i;p<=r;++p){let y=l[u],h=d[f];u<s&&(f>=a||t(y,h,n)<=0)?(e[p]=y,++u):f<a&&(e[p]=h,++f)}}function _4(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);_4(e,t,n,i,r),_4(e,t,n,r+1,o),Clt(e,t,n,i,r,o)}function Vlt(e,t,n){if(!c(e))throw new L("array is required.");if(!c(t))throw new L("comparator is required.");let i=e.length,o=Math.ceil(i*.5);g4.length=o,x4.length=o,_4(e,t,n,0,i-1),g4.length=0,x4.length=0}var h0=Vlt;var U9i=_(T(),1);function Gc(e,t){if(!c(e))throw new L("occluderBoundingSphere is required.");if(!c(t))throw new L("camera position is required.");this._occluderPosition=m.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var cD=new m;Object.defineProperties(Gc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!c(e))throw new L("cameraPosition is required.");e=m.clone(e,this._cameraPosition);let t=m.subtract(this._occluderPosition,e,cD),n=m.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=m.multiplyByScalar(t,n,cD);let a=o*o*n;s=m.add(e,m.multiplyByScalar(r,a,cD),cD)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Gc.fromBoundingSphere=function(e,t,n){if(!c(e))throw new L("occluderBoundingSphere is required.");if(!c(t))throw new L("camera position is required.");return c(n)?(m.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Gc(e,t)};var Pge=new m;Gc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=m.subtract(e,this._occluderPosition,Pge),n=this._occluderRadius;if(n=m.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=m.subtract(e,this._cameraPosition,t),n*n>m.magnitudeSquared(t)}return!1};var Llt=new m;Gc.prototype.isBoundingSphereVisible=function(e){let t=m.clone(e.center,Llt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Pge),o=this._occluderRadius-n;if(o=m.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i),o*o+n*n>m.magnitudeSquared(i)):!1;if(o>0){i=m.subtract(t,this._cameraPosition,i);let r=m.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var Zlt=new m;Gc.prototype.computeVisibility=function(e){if(!c(e))throw new L("occludeeBS is required.");let t=m.clone(e.center),n=e.radius;if(n>this._occluderRadius)return yr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=m.subtract(t,this._occluderPosition,Zlt),o=this._occluderRadius-n,r=m.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=m.subtract(t,this._cameraPosition,i);let s=m.magnitudeSquared(i);return o*o+n*n<s?yr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?yr.FULL:yr.PARTIAL):(i=m.subtract(t,this._horizonPlanePosition,i),m.dot(i,this._horizonPlaneNormal)>-n?yr.PARTIAL:yr.FULL))}}return yr.NONE};var lD=new m;Gc.computeOccludeePoint=function(e,t,n){if(!c(e))throw new L("occluderBoundingSphere is required.");if(!c(n))throw new L("positions is required.");if(n.length===0)throw new L("positions must contain at least one element");let i=m.clone(t),o=m.clone(e.center),r=e.radius,s=n.length;if(m.equals(o,t))throw new L("occludeePosition must be different than occluderBoundingSphere.center");let a=m.normalize(m.subtract(i,o,lD),lD),l=-m.dot(a,o),d=Gc._anyRotationVector(o,a,l),u=Gc._horizonToPlaneNormalDotProduct(e,a,l,d,n[0]);if(!u)return;let f;for(let y=1;y<s;++y){if(f=Gc._horizonToPlaneNormalDotProduct(e,a,l,d,n[y]),!f)return;f<u&&(u=f)}if(u<.0017453283658983088)return;let p=r/u;return m.add(o,m.multiplyByScalar(a,p,lD),lD)};var Rlt=[];Gc.computeOccludeePointFromRectangle=function(e,t){if(!c(e))throw new L("rectangle is required.");t=t??re.default;let n=de.subsample(e,t,0,Rlt),i=ue.fromPoints(n),o=m.ZERO;if(!m.equals(o,i.center))return Gc.computeOccludeePoint(new ue(o,t.minimumRadius),i.center,n)};var Glt=new m;Gc._anyRotationVector=function(e,t,n){let i=m.abs(t,Glt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new m,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=m.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=m.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=m.UNIT_Z);let a=(m.dot(t,i)+n)/-m.dot(t,s);return m.normalize(m.subtract(m.add(i,m.multiplyByScalar(s,a,r),i),e,i),i)};var Elt=new m;Gc._rotationVector=function(e,t,n,i,o){let r=m.subtract(i,e,Elt);if(r=m.normalize(r,r),m.dot(t,r)<.9999999847691291){let s=m.cross(t,r,r);if(m.magnitude(s)>w.EPSILON13)return m.normalize(s,new m)}return o};var T4=new m,Xlt=new m,dD=new m,wge=new m;Gc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=m.clone(o,T4),s=m.clone(e.center,Xlt),a=e.radius,l=m.subtract(s,r,dD),d=m.magnitudeSquared(l),u=a*a;if(d<u)return!1;let f=d-u,p=Math.sqrt(f),h=1/Math.sqrt(d),x=p*h*p;l=m.normalize(l,l);let S=m.add(r,m.multiplyByScalar(l,x,wge),wge),V=Math.sqrt(f-x*x),Z=this._rotationVector(s,t,n,r,i),R=m.fromElements(Z.x*Z.x*l.x+(Z.x*Z.y-Z.z)*l.y+(Z.x*Z.z+Z.y)*l.z,(Z.x*Z.y+Z.z)*l.x+Z.y*Z.y*l.y+(Z.y*Z.z-Z.x)*l.z,(Z.x*Z.z-Z.y)*l.x+(Z.y*Z.z+Z.x)*l.y+Z.z*Z.z*l.z,T4);R=m.normalize(R,R);let E=m.multiplyByScalar(R,V,T4);Z=m.normalize(m.subtract(m.add(S,E,dD),s,dD),dD);let I=m.dot(t,Z);Z=m.normalize(m.subtract(m.subtract(S,E,Z),s,Z),Z);let v=m.dot(t,Z);return I<v?I:v};var EF=Gc;var rMi=_(T(),1);var j9i=_(T(),1);function ip(e){e=e??z.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 fs,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function S4(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new L("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;if(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new L("near must be greater than zero and less than 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(ip.prototype,{projectionMatrix:{get:function(){return S4(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return S4(this),this._infinitePerspective}}});var Ilt=new m,Wlt=new m,wlt=new m,Plt=new m;ip.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new L("position is required.");if(!c(t))throw new L("direction is required.");if(!c(n))throw new L("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,d=this.far,u=m.cross(t,n,Ilt),f=Wlt;m.multiplyByScalar(t,l,f),m.add(e,f,f);let p=wlt;m.multiplyByScalar(t,d,p),m.add(e,p,p);let y=Plt;m.multiplyByScalar(u,a,y),m.add(f,y,y),m.subtract(y,e,y),m.normalize(y,y),m.cross(y,n,y),m.normalize(y,y);let h=i[0];return c(h)||(h=i[0]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),m.multiplyByScalar(u,s,y),m.add(f,y,y),m.subtract(y,e,y),m.cross(n,y,y),m.normalize(y,y),h=i[1],c(h)||(h=i[1]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),m.multiplyByScalar(n,r,y),m.add(f,y,y),m.subtract(y,e,y),m.cross(u,y,y),m.normalize(y,y),h=i[2],c(h)||(h=i[2]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),m.multiplyByScalar(n,o,y),m.add(f,y,y),m.subtract(y,e,y),m.cross(y,u,y),m.normalize(y,y),h=i[3],c(h)||(h=i[3]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,e),h=i[4],c(h)||(h=i[4]=new ce),h.x=t.x,h.y=t.y,h.z=t.z,h.w=-m.dot(t,f),m.negate(t,y),h=i[5],c(h)||(h=i[5]=new ce),h.x=y.x,h.y=y.y,h.z=y.z,h.w=-m.dot(y,p),this._cullingVolume};ip.prototype.getPixelDimensions=function(e,t,n,i,o){if(S4(this),!c(e)||!c(t))throw new L("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new L("drawingBufferWidth must be greater than zero.");if(t<=0)throw new L("drawingBufferHeight must be greater than zero.");if(!c(n))throw new L("distance is required.");if(!c(i))throw new L("pixelRatio is required");if(i<=0)throw new L("pixelRatio must be greater than zero.");if(!c(o))throw new L("A result object is required.");let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let l=2*i*n*s/e;return o.x=l,o.y=a,o};ip.prototype.clone=function(e){return c(e)||(e=new ip),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};ip.prototype.equals=function(e){return c(e)&&e instanceof ip&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};ip.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof ip&&w.equalsEpsilon(this.right,e.right,t,n)&&w.equalsEpsilon(this.left,e.left,t,n)&&w.equalsEpsilon(this.top,e.top,t,n)&&w.equalsEpsilon(this.bottom,e.bottom,t,n)&&w.equalsEpsilon(this.near,e.near,t,n)&&w.equalsEpsilon(this.far,e.far,t,n)};var hl=ip;function $l(e){e=e??z.EMPTY_OBJECT,this._offCenterFrustum=new hl,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}$l.packedLength=6;$l.pack=function(e,t,n){return C.typeOf.object("value",e),C.defined("array",t),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};$l.unpack=function(e,t,n){return C.defined("array",e),t=t??0,c(n)||(n=new $l),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 Uf(e){if(!c(e.fov)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new L("fov, aspectRatio, near, or far parameters are not set.");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;if(C.typeOf.number.greaterThanOrEquals("fov",e.fov,0),C.typeOf.number.lessThan("fov",e.fov,Math.PI),C.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),C.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new L("near must be less than far.");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($l.prototype,{projectionMatrix:{get:function(){return Uf(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Uf(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Uf(this),this._fovy}},sseDenominator:{get:function(){return Uf(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Uf(this),this._offCenterFrustum}}});$l.prototype.computeCullingVolume=function(e,t,n){return Uf(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};$l.prototype.getPixelDimensions=function(e,t,n,i,o){return Uf(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};$l.prototype.clone=function(e){return c(e)||(e=new $l),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};$l.prototype.equals=function(e){return!c(e)||!(e instanceof $l)?!1:(Uf(this),Uf(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};$l.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof $l)?!1:(Uf(this),Uf(e),w.equalsEpsilon(this.fov,e.fov,t,n)&&w.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ci=$l;var yMi=_(T(),1);function XF(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(XF.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function vlt(e,t,n){let i=t.createViewportQuadCommand(Ev,{framebuffer:n,renderState:Oe.fromCache({viewport:new je(0,0,256,256)})});e._drawCommand=i}XF.prototype.update=function(e){if(!c(this._colorTexture)){let t=e.context,n=new Pt({context:t,width:256,height:256,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:en.NEAREST});this._colorTexture=n;let i=new Fr({context:t,colorTextures:[n],destroyAttachments:!1});vlt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};XF.prototype.isDestroyed=function(){return!1};XF.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),he(this)};var IF=XF;var dNi=_(T(),1);var XMi=_(T(),1);var Mge={};function Flt(e,t,n){let i,o,r;if(e instanceof Ci){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 hl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Alt=new m,vge=new m;function Nge(e,t,n,i){if(c(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,l=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return w.lerp(e,-w.PI_OVER_TWO,p)}let f=(u-r)/l;return w.lerp(-w.PI_OVER_TWO,t,1-f)}}return function(o){return w.lerp(e,t,o)}}function V4(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!c(r)){let a=e.position,l=t,d=e.up,u=e.right,f=e.frustum,p=m.subtract(a,l,Alt),y=m.magnitude(m.multiplyByScalar(d,m.dot(p,d),vge)),h=m.magnitude(m.multiplyByScalar(u,m.dot(p,u),vge));r=Math.min(Flt(f,y,h)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(f){let p=f*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return w.lerp(n,i,a)}}function WF(e,t){return w.equalsEpsilon(e,w.TWO_PI,w.EPSILON11)&&(e=0),t>e+Math.PI?e+=w.TWO_PI:t<e-Math.PI&&(e-=w.TWO_PI),e}var kge=new m;function Mlt(e,t,n,i,o,r,s,a){let l=e.camera,d=m.clone(l.position,kge),u=l.pitch,f=WF(l.heading,i),p=WF(l.roll,r),y=V4(l,n,d.z,n.z,s),h=Nge(u,o,y,a);function g(x){let S=x.time/t;l.setView({orientation:{heading:w.lerp(f,i,S),pitch:h(S),roll:w.lerp(p,r,S)}}),D.lerp(d,n,S,l.position),l.position.z=y(S)}return g}function Nlt(e,t){e.longitude<t.longitude?e.longitude+=w.TWO_PI:t.longitude+=w.TWO_PI}function klt(e,t){let n=e.longitude-t.longitude;n<-w.PI?e.longitude+=w.TWO_PI:n>w.PI&&(t.longitude+=w.TWO_PI)}var Ult=new pe,Olt=new pe;function Dlt(e,t,n,i,o,r,s,a,l,d){let u=e.camera,p=e.mapProjection.ellipsoid,y=pe.clone(u.positionCartographic,Ult),h=u.pitch,g=WF(u.heading,i),x=WF(u.roll,r),S=p.cartesianToCartographic(n,Olt);y.longitude=w.zeroToTwoPi(y.longitude),S.longitude=w.zeroToTwoPi(S.longitude);let V=!1;if(c(a)){let I=w.zeroToTwoPi(a),v=Math.min(y.longitude,S.longitude),P=Math.max(y.longitude,S.longitude),F=I>=v&&I<=P;if(c(l)){let N=Math.abs(y.longitude-S.longitude),b=w.TWO_PI-N;(F?N:b)<(F?b:N)*l&&!F&&(V=!0)}else F||(V=!0)}V?Nlt(y,S):klt(y,S);let Z=V4(u,n,y.height,S.height,s),R=Nge(h,o,Z,d);function E(){let I=y.longitude,v=S.longitude,P=y.latitude,F=S.latitude;return function(b){let G=b.time/t,X=m.fromRadians(w.lerp(I,v,G),w.lerp(P,F,G),Z(G),p);u.setView({destination:X,orientation:{heading:w.lerp(g,i,G),pitch:R(G),roll:w.lerp(x,r,G)}})}}return E()}function Blt(e,t,n,i,o,r,s){let a=e.camera,l=m.clone(a.position,kge),d=WF(a.heading,i),u=a.frustum.right-a.frustum.left,f=V4(a,n,u,n.z,s);function p(y){let h=y.time/t;a.setView({orientation:{heading:w.lerp(d,i,h)}}),D.lerp(l,n,h,a.position);let g=f(h),x=a.frustum,S=x.top/x.right,V=(g-(x.right-x.left))*.5;x.right+=V,x.left-=V,x.top=S*x.right,x.bottom=-x.top}return p}var Fge=new pe,Ylt=new m;function C4(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Age(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Mge.createTween=function(e,t){t=t??z.EMPTY_OBJECT;let n=t.destination;if(!c(e))throw new L("scene is required.");if(!c(n))throw new L("destination is required.");let i=e.mode;if(i===se.MORPHING)return C4();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,l=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,f=t.easingFunction;o&&i!==se.SCENE3D&&(s.cartesianToCartographic(n,Fge),n=r.project(Fge,Ylt));let p=e.camera,y=t.endTransform;c(y)&&p._setTransform(y);let h=t.duration;c(h)||(h=Math.ceil(m.distance(p.position,n)/1e6)+2,h=Math.min(h,3));let g=t.heading??0,x=t.pitch??-w.PI_OVER_TWO,S=t.roll??0,V=e.screenSpaceCameraController;V.enableInputs=!1;let Z=Age(V,t.complete),R=Age(V,t.cancel),E=p.frustum,I=e.mode===se.SCENE2D;if(I=I&&D.equalsEpsilon(p.position,n,w.EPSILON6),I=I&&w.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,w.EPSILON6),I=I||e.mode!==se.SCENE2D&&m.equalsEpsilon(n,p.position,w.EPSILON10),I=I&&w.equalsEpsilon(w.negativePiToPi(g),w.negativePiToPi(p.heading),w.EPSILON10)&&w.equalsEpsilon(w.negativePiToPi(x),w.negativePiToPi(p.pitch),w.EPSILON10)&&w.equalsEpsilon(w.negativePiToPi(S),w.negativePiToPi(p.roll),w.EPSILON10),I)return C4(Z,R);let v=new Array(4);if(v[se.SCENE2D]=Blt,v[se.SCENE3D]=Dlt,v[se.COLUMBUS_VIEW]=Mlt,h<=0)return C4(function(){v[i](e,1,n,g,x,S,a,l,d,u)({time:1}),typeof Z=="function"&&Z()},R);let P=v[i](e,h,n,g,x,S,a,l,d,u);if(!c(f)){let F=p.positionCartographic.height,N=i===se.SCENE3D?s.cartesianToCartographic(n).height:n.z;F>N&&F>11500?f=Jr.CUBIC_OUT:f=Jr.QUINTIC_IN_OUT}return{duration:h,easingFunction:f,startObject:{time:0},stopObject:{time:h},update:P,complete:Z,cancel:R}};var wF=Mge;var WMi=_(T(),1),Hlt={ROTATE:0,INFINITE_SCROLL:1},ed=Object.freeze(Hlt);function nn(e){if(!c(e))throw new L("scene is required.");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 m,this._position=new m,this._positionWC=new m,this._positionCartographic=new pe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new m,this._direction=new m,this._directionWC=new m,this.up=new m,this._up=new m,this._upWC=new m,this.right=new m,this._right=new m,this._rightWC=new m,this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=w.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 ye,this._moveEnd=new ye,this._changed=new ye,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,Kge(this),this._mode=se.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new pe(Math.PI,w.PI_OVER_TWO)),this._max2Dfrustum=void 0,sxe(this,nn.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=m.magnitude(this.position);n+=n*nn.DEFAULT_VIEW_FACTOR,m.normalize(this.position,this.position),m.multiplyByScalar(this.position,n,this.position)}nn.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);nn.TRANSFORM_2D_INVERSE=M.inverseTransformation(nn.TRANSFORM_2D,new M);nn.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-95,-20,-70,90);nn.DEFAULT_VIEW_FACTOR=.5;nn.DEFAULT_OFFSET=new rm(0,-w.PI_OVER_FOUR,0);function Kge(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 zlt(e){if(!c(e._oldPositionWC))e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=m.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=m.magnitude(t),e._oldPositionWC=m.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ti()):e.timeSinceMoved=Math.max(Ti()-e._lastMovedTimestamp,0)/1e3}}nn.prototype.canPreloadFlight=function(){return c(this._currentFlight)&&this._mode!==se.SCENE2D};nn.prototype._updateCameraChanged=function(){let e=this;if(zlt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;c(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%w.TWO_PI;i=i>w.PI?w.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;c(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%w.TWO_PI;s=s>w.PI?w.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===se.SCENE2D){if(!c(e._changedFrustum)){e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,y=e._changedPosition,h=e.frustum,g=e._changedFrustum,x=p.x+h.left,S=p.x+h.right,V=y.x+g.left,Z=y.x+g.right,R=p.y+h.bottom,E=p.y+h.top,I=y.y+g.bottom,v=y.y+g.top,P=Math.max(x,V),F=Math.min(S,Z),N=Math.max(R,I),b=Math.min(E,v),G;if(P>=F||N>=E)G=1;else{let X=g;x<V&&S>Z&&R<I&&E>v&&(X=h),G=1-(F-P)*(b-N)/((X.right-X.left)*(X.top-X.bottom))}G>t&&(e._changed.raiseEvent(G),e._changedPosition=m.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!c(e._changedDirection)){e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection);return}let l=w.acosClamped(m.dot(e.directionWC,e._changedDirection)),d;c(e.frustum.fovy)?d=l/(e.frustum.fovy*.5):d=l;let f=m.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||f>t)&&(e._changed.raiseEvent(Math.max(d,f)),e._changedPosition=m.clone(e.positionWC,e._changedPosition),e._changedDirection=m.clone(e.directionWC,e._changedDirection))};function Klt(e){wt.basisTo2D(e._projection,e._transform,e._actualTransform)}var Jlt=new pe,Qlt=new m,uD=new m,jlt=new ce,qlt=new ce,$lt=new ce,edt=new ce,tdt=new ce;function ndt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,jlt),o=n.cartesianToCartographic(i,Jlt),r=t.project(o,Qlt),s=qlt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,tdt),l=ce.add(M.getColumn(e._transform,0,uD),i,uD);n.cartesianToCartographic(l,o),t.project(o,r);let d=$lt;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,m.subtract(d,s,d),d.x=0;let u=edt;if(m.magnitudeSquared(d)>w.EPSILON10)m.cross(a,d,u);else{let f=ce.add(M.getColumn(e._transform,1,uD),i,uD);n.cartesianToCartographic(f,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,m.subtract(u,s,u),u.x=0,m.magnitudeSquared(u)<w.EPSILON10&&(ce.clone(ce.UNIT_Y,d),ce.clone(ce.UNIT_Z,u))}m.cross(u,a,d),m.normalize(d,d),m.cross(a,d,u),m.normalize(u,u),M.setColumn(e._actualTransform,0,d,e._actualTransform),M.setColumn(e._actualTransform,1,u,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var L4=new m;function Xc(e){let t=e._mode,n=!1,i=0;t===se.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!m.equals(o,e.position)||n;r&&(o=m.clone(e.position,e._position));let s=e._direction,a=!m.equals(s,e.direction);a&&(m.normalize(e.direction,e.direction),s=m.clone(e.direction,e._direction));let l=e._up,d=!m.equals(l,e.up);d&&(m.normalize(e.up,e.up),l=m.clone(e.up,e._up));let u=e._right,f=!m.equals(u,e.right);f&&(m.normalize(e.right,e.right),u=m.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===se.COLUMBUS_VIEW||e._mode===se.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(nn.TRANSFORM_2D,e._actualTransform):e._mode===se.COLUMBUS_VIEW?Klt(e):ndt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let y=e._actualTransform;if(r||p)if(e._positionWC=M.multiplyByPoint(y,o,e._positionWC),t===se.SCENE3D||t===se.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let h=L4;h.x=e._positionWC.y,h.y=e._positionWC.z,h.z=e._positionWC.x,t===se.SCENE2D&&(h.z=i),e._projection.unproject(h,e._positionCartographic)}if(a||d||f){let h=m.dot(s,m.cross(l,u,L4));if(Math.abs(1-h)>w.EPSILON2){let g=1/m.magnitudeSquared(l),x=m.dot(l,s)*g,S=m.multiplyByScalar(s,x,L4);l=m.normalize(m.subtract(l,S,e._up),e._up),m.clone(l,e.up),u=m.cross(s,l,e._right),m.clone(u,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(y,s,e._directionWC),m.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=M.multiplyByPointAsVector(y,l,e._upWC),m.normalize(e._upWC,e._upWC)),(f||p)&&(e._rightWC=M.multiplyByPointAsVector(y,u,e._rightWC),m.normalize(e._rightWC,e._rightWC)),(r||a||d||f||p)&&Kge(e)}function Jge(e,t){let n;return w.equalsEpsilon(Math.abs(e.z),1,w.EPSILON3)?n=Math.atan2(t.y,t.x)-w.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-w.PI_OVER_TWO,w.TWO_PI-w.zeroToTwoPi(n)}function Qge(e){return w.PI_OVER_TWO-w.acosClamped(e.z)}function jge(e,t,n){let i=0;return w.equalsEpsilon(Math.abs(e.z),1,w.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=w.zeroToTwoPi(i+w.TWO_PI)),i}var hD=new M,pD=new M;Object.defineProperties(nn.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Xc(this),this._invTransform}},viewMatrix:{get:function(){return Xc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Xc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Xc(this),this._positionCartographic}},positionWC:{get:function(){return Xc(this),this._positionWC}},directionWC:{get:function(){return Xc(this),this._directionWC}},upWC:{get:function(){return Xc(this),this._upWC}},rightWC:{get:function(){return Xc(this),this._rightWC}},heading:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,hD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,pD);this._setTransform(n);let i=Jge(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,hD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,pD);this._setTransform(n);let i=Qge(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,hD),n=wt.eastNorthUpToFixedFrame(this.positionWC,e,pD);this._setTransform(n);let i=jge(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}}});nn.prototype.update=function(e){if(!c(e))throw new L("mode is required.");if(e===se.SCENE2D&&!(this.frustum instanceof Oo))throw new L("An OrthographicOffCenterFrustum is required in 2D.");if((e===se.SCENE3D||e===se.COLUMBUS_VIEW)&&!(this.frustum instanceof Ci)&&!(this.frustum instanceof sn))throw new L("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==se.MORPHING,t=this._mode===se.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone();if(!(n instanceof Oo))throw new L("The camera frustum is expected to be orthographic for 2D camera control.");let i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===se.SCENE2D&&txe(this,this.position)};var idt=new m,odt=new m,rdt=new m;nn.prototype._setTransform=function(e){let t=m.clone(this.positionWC,idt),n=m.clone(this.upWC,odt),i=m.clone(this.directionWC,rdt);M.clone(e,this._transform),this._transformChanged=!0,Xc(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),m.cross(this.direction,this.up,this.right),Xc(this)};var sdt=new D,adt=new bn,cdt=new m,ldt=new m;function qge(e){if(!M.equals(M.IDENTITY,e.transform))return m.magnitude(e.position);let t=e._scene,n=t.globe,i=sdt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(c(n)){let a=e.getPickRay(i,adt);o=n.pickWorldCoordinates(a,t,!0,cdt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,ldt));let s;if(c(o)||c(r)){let a=c(r)?m.distance(r,e.positionWC):Number.POSITIVE_INFINITY,l=c(o)?m.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,l)}else s=Math.max(e.positionCartographic.height,0);return s}nn.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof sn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=qge(this)))};var bD=new m,X4=new M,ddt=new M,I4=new Fe,W4=new te,$ge=new pe;function udt(e,t,n){if(isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new L("position has a NaN component");let i=M.clone(e.transform,X4),o=wt.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,ddt);e._setTransform(o),m.clone(m.ZERO,e.position),n.heading=n.heading-w.PI_OVER_TWO;let r=Fe.fromHeadingPitchRoll(n,I4),s=te.fromQuaternion(r,W4);te.getColumn(s,0,e.direction),te.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function mdt(e,t,n,i){let o=M.clone(e.transform,X4);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let a=e._projection,l=a.ellipsoid.cartesianToCartographic(t,$ge);t=a.project(l,bD)}m.clone(t,e.position)}n.heading=n.heading-w.PI_OVER_TWO;let r=Fe.fromHeadingPitchRoll(n,I4),s=te.fromQuaternion(r,W4);te.getColumn(s,0,e.direction),te.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function fdt(e,t,n,i){let o=M.clone(e.transform,X4);if(e._setTransform(M.IDENTITY),!m.equals(t,e.positionWC)){if(i){let l=e._projection,d=l.ellipsoid.cartesianToCartographic(t,$ge);t=l.project(d,bD)}D.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let l=a.top/a.right;a.right=s,a.left=r,a.top=a.right*l,a.bottom=-a.top}}if(e._scene.mapMode2D===ed.ROTATE){n.heading=n.heading-w.PI_OVER_TWO,n.pitch=-w.PI_OVER_TWO,n.roll=0;let r=Fe.fromHeadingPitchRoll(n,I4),s=te.fromQuaternion(r,W4);te.getColumn(s,2,e.up),m.cross(e.direction,e.up,e.right)}e._setTransform(o)}var hdt=new m,pdt=new m,bdt=new m;function exe(e,t,n,i){let o=m.clone(n.direction,hdt),r=m.clone(n.up,pdt);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,l=wt.eastNorthUpToFixedFrame(t,a,hD),d=M.inverseTransformation(l,pD);M.multiplyByPointAsVector(d,o,o),M.multiplyByPointAsVector(d,r,r)}let s=m.cross(o,r,bdt);return i.heading=Jge(o,r),i.pitch=Qge(o),i.roll=jge(o,r,s),i}var E4={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},cL=new Ea;nn.prototype.setView=function(e){e=e??z.EMPTY_OBJECT;let t=e.orientation??z.EMPTY_OBJECT,n=this._mode;if(n===se.MORPHING)return;c(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??m.clone(this.positionWC,bD);if(c(o)&&c(o.west)){if(o=this.getRectangleCameraCoordinates(o,bD),isNaN(o.x)||isNaN(o.y))throw new L("destination has a NaN component");i=!1}c(t.direction)&&(t=exe(this,o,t,E4.orientation)),cL.heading=t.heading??0,cL.pitch=t.pitch??-w.PI_OVER_TWO,cL.roll=t.roll??0,n===se.SCENE3D?udt(this,o,cL):n===se.SCENE2D?fdt(this,o,cL,i):mdt(this,o,cL,i)};var ydt=new m;nn.prototype.flyHome=function(e){let t=this._mode;if(t===se.MORPHING&&this._scene.completeMorph(),t===se.SCENE2D)this.flyTo({destination:nn.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===se.SCENE3D){let n=this.getRectangleCameraCoordinates(nn.DEFAULT_VIEW_RECTANGLE),i=m.magnitude(n);i+=i*nn.DEFAULT_VIEW_FACTOR,m.normalize(n,n),m.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===se.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new m(0,-1,1);i=m.multiplyByScalar(m.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(m.normalize(i,ydt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};nn.prototype.worldToCameraCoordinates=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new ce),Xc(this),M.multiplyByVector(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPoint(this._actualInvTransform,e,t)};nn.prototype.worldToCameraCoordinatesVector=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};nn.prototype.cameraToWorldCoordinates=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new ce),Xc(this),M.multiplyByVector(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPoint(this._actualTransform,e,t)};nn.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!c(e))throw new L("cartesian is required.");return c(t)||(t=new m),Xc(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function txe(e,t){let n=e._scene.mapMode2D===ed.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 Uge=new m;nn.prototype.move=function(e,t){if(!c(e))throw new L("direction is required.");let n=this.position;m.multiplyByScalar(e,t,Uge),m.add(n,Uge,n),this._mode===se.SCENE2D&&txe(this,n),this._adjustOrthographicFrustum(!0)};nn.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?yD(this,e):this.move(this.direction,e)};nn.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?yD(this,-e):this.move(this.direction,-e)};nn.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};nn.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};nn.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};nn.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};nn.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,-e)};nn.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,e)};nn.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,-e)};nn.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,e)};var gdt=new Fe,xdt=new te;nn.prototype.look=function(e,t){if(!c(e))throw new L("axis is required.");let n=t??this.defaultLookAmount,i=Fe.fromAxisAngle(e,-n,gdt),o=te.fromQuaternion(i,xdt),r=this.direction,s=this.up,a=this.right;te.multiplyByVector(o,r,r),te.multiplyByVector(o,s,s),te.multiplyByVector(o,a,a)};nn.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};nn.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var _dt=new Fe,Tdt=new te;nn.prototype.rotate=function(e,t){if(!c(e))throw new L("axis is required.");let n=t??this.defaultRotateAmount,i=Fe.fromAxisAngle(e,-n,_dt),o=te.fromQuaternion(i,Tdt);te.multiplyByVector(o,this.position,this.position),te.multiplyByVector(o,this.direction,this.direction),te.multiplyByVector(o,this.up,this.up),m.cross(this.direction,this.up,this.right),m.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};nn.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,nxe(this,e)};nn.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,nxe(this,-e)};var Sdt=new m,Cdt=new m,Vdt=new m,Oge=new m;function nxe(e,t){let n=e.position;if(c(e.constrainedAxis)&&!m.equalsEpsilon(e.position,m.ZERO,w.EPSILON2)){let i=m.normalize(n,Sdt),o=m.equalsEpsilon(i,e.constrainedAxis,w.EPSILON2),r=m.equalsEpsilon(i,m.negate(e.constrainedAxis,Oge),w.EPSILON2);if(!o&&!r){let s=m.normalize(e.constrainedAxis,Cdt),a=m.dot(i,s),l=w.acosClamped(a);t>0&&t>l&&(t=l-w.EPSILON4),a=m.dot(i,m.negate(s,Oge)),l=w.acosClamped(a),t<0&&-t>l&&(t=-l+w.EPSILON4);let d=m.cross(s,i,Vdt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}nn.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,ixe(this,-e)};nn.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,ixe(this,e)};function ixe(e,t){c(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function yD(e,t){let n=e.frustum;if(!(n instanceof Oo)||!c(n.left)||!c(n.right)||!c(n.bottom)||!c(n.top))throw new L("The camera frustum is expected to be orthographic for 2D camera control.");let 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===ed.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===ed.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 oxe(e,t){e.move(e.direction,t)}nn.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?yD(this,e):oxe(this,e)};nn.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?yD(this,-e):oxe(this,-e)};nn.prototype.getMagnitude=function(){if(this._mode===se.SCENE3D)return m.magnitude(this.position);if(this._mode===se.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===se.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Ldt=new M;nn.prototype.lookAt=function(e,t){if(!c(e))throw new L("target is required");if(!c(t))throw new L("offset is required");if(this._mode===se.MORPHING)throw new L("lookAt is not supported while morphing.");let i=this._scene.ellipsoid??re.default,o=wt.eastNorthUpToFixedFrame(e,i,Ldt);this.lookAtTransform(o,t)};var Zdt=new m,Rdt=new Fe,Gdt=new Fe,Edt=new te;function rxe(e,t,n){t=w.clamp(t,-w.PI_OVER_TWO,w.PI_OVER_TWO),e=w.zeroToTwoPi(e)-w.PI_OVER_TWO;let i=Fe.fromAxisAngle(m.UNIT_Y,-t,Rdt),o=Fe.fromAxisAngle(m.UNIT_Z,-e,Gdt),r=Fe.multiply(o,i,o),s=te.fromQuaternion(r,Edt),a=m.clone(m.UNIT_X,Zdt);return te.multiplyByVector(s,a,a),m.negate(a,a),m.multiplyByScalar(a,n,a),a}nn.prototype.lookAtTransform=function(e,t){if(!c(e))throw new L("transform is required");if(this._mode===se.MORPHING)throw new L("lookAtTransform is not supported while morphing.");if(this._setTransform(e),!c(t))return;let n;if(c(t.heading)?n=rxe(t.heading,t.pitch,t.range):n=t,this._mode===se.SCENE2D){D.clone(D.ZERO,this.position),m.negate(n,this.up),this.up.z=0,m.magnitudeSquared(this.up)<w.EPSILON10&&m.clone(m.UNIT_Y,this.up),m.normalize(this.up,this.up),this._setTransform(M.IDENTITY),m.negate(m.UNIT_Z,this.direction),m.cross(this.direction,this.up,this.right),m.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=m.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}m.clone(n,this.position),m.negate(this.position,this.direction),m.normalize(this.direction,this.direction),m.cross(this.direction,m.UNIT_Z,this.right),m.magnitudeSquared(this.right)<w.EPSILON10&&m.clone(m.UNIT_X,this.right),m.normalize(this.right,this.right),m.cross(this.right,this.direction,this.up),m.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var PF=new pe,Xdt=new pe,Idt=new m,Wdt=new m,wdt=new m,Pdt=new m,vdt=new m,Fdt=new m,Adt=new m,Z4=new m,Mdt={direction:new m,right:new m,up:new m},Dge;function Ec(e,t,n,i){return Math.abs(m.dot(t,n))/i-m.dot(e,n)}function sxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Mdt,{north:s,south:a,west:l}=t,{east:d}=t;l>d&&(d+=w.TWO_PI);let u=(l+d)*.5,f;if(a<-w.PI_OVER_TWO+w.RADIANS_PER_DEGREE&&s>w.PI_OVER_TWO-w.RADIANS_PER_DEGREE)f=0;else{let F=PF;F.longitude=u,F.latitude=s,F.height=0;let N=Xdt;N.longitude=u,N.latitude=a,N.height=0;let b=Dge;(!c(b)||b.ellipsoid!==o)&&(Dge=b=new Fp(void 0,void 0,o)),b.setEndPoints(F,N),f=b.interpolateUsingFraction(.5,PF).latitude}let p=PF;p.longitude=u,p.latitude=f,p.height=0;let y=o.cartographicToCartesian(p,Adt),h=PF;h.longitude=d,h.latitude=s;let g=o.cartographicToCartesian(h,Idt);h.longitude=l;let x=o.cartographicToCartesian(h,wdt);h.longitude=u;let S=o.cartographicToCartesian(h,vdt);h.latitude=a;let V=o.cartographicToCartesian(h,Fdt);h.longitude=d;let Z=o.cartographicToCartesian(h,Pdt);h.longitude=l;let R=o.cartographicToCartesian(h,Wdt);m.subtract(x,y,x),m.subtract(Z,y,Z),m.subtract(g,y,g),m.subtract(R,y,R),m.subtract(S,y,S),m.subtract(V,y,V);let E=o.geodeticSurfaceNormal(y,r.direction);m.negate(E,E);let I=m.cross(E,m.UNIT_Z,r.right);m.normalize(I,I);let v=m.cross(I,E,r.up),P;if(e.frustum instanceof sn){let F=Math.max(m.distance(g,x),m.distance(Z,R)),N=Math.max(m.distance(g,Z),m.distance(x,R)),b,G,X=e.frustum._offCenterFrustum,W=X.right/X.top,A=N*W;F>A?(b=F,G=b/W):(G=N,b=A),P=Math.max(b,G)}else{let F=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*F;if(P=Math.max(Ec(E,v,x,F),Ec(E,v,Z,F),Ec(E,v,g,F),Ec(E,v,R,F),Ec(E,v,S,F),Ec(E,v,V,F),Ec(E,I,x,N),Ec(E,I,Z,N),Ec(E,I,g,N),Ec(E,I,R,N),Ec(E,I,S,N),Ec(E,I,V,N)),a<0&&s>0){let b=PF;b.longitude=l,b.latitude=0,b.height=0;let G=o.cartographicToCartesian(b,Z4);m.subtract(G,y,G),P=Math.max(P,Ec(E,v,G,F),Ec(E,I,G,N)),b.longitude=d,G=o.cartographicToCartesian(b,Z4),m.subtract(G,y,G),P=Math.max(P,Ec(E,v,G,F),Ec(E,I,G,N))}}return m.add(y,m.multiplyByScalar(E,-P,Z4),n)}var Ndt=new pe,kdt=new m,Udt=new m;function Odt(e,t,n){let i=e._projection;t.west>t.east&&(t=de.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Ndt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,kdt);M.multiplyByPoint(o,a,a),M.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let l=i.project(s,Udt);if(M.multiplyByPoint(o,l,l),M.multiplyByPoint(r,l,l),n.x=(a.x-l.x)*.5+l.x,n.y=(a.y-l.y)*.5+l.y,c(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-l.x)/u,(a.y-l.y)/d)*.5}else{let d=a.x-l.x,u=a.y-l.y;n.z=Math.max(d,u)}return n}var Ddt=new pe,Bdt=new m,Ydt=new m;function Hdt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===ed.INFINITE_SCROLL?o+=w.TWO_PI:(t=de.MAX_VALUE,o=t.east));let r=Ddt;r.longitude=o,r.latitude=t.north;let s=i.project(r,Bdt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Ydt),l=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,f,p=e.frustum.right/e.frustum.top,y=d*p;return l>y?(u=l,f=u/p):(f=d,u=y),d=Math.max(2*u,2*f),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}nn.prototype.getRectangleCameraCoordinates=function(e,t){if(!c(e))throw new L("rectangle is required");let n=this._mode;if(c(t)||(t=new m),n===se.SCENE3D)return sxe(this,e,t);if(n===se.COLUMBUS_VIEW)return Odt(this,e,t);if(n===se.SCENE2D)return Hdt(this,e,t)};var zdt=new bn;function Kdt(e,t,n,i){n=n??re.default;let o=e.getPickRay(t,zdt),r=qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return bn.getPoint(o,s,i)}var Jdt=new bn;function Qdt(e,t,n,i){let r=e.getPickRay(t,Jdt).origin;r=m.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-w.PI_OVER_TWO||s.latitude>w.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var jdt=new bn;function qdt(e,t,n,i){let o=e.getPickRay(t,jdt),r=-o.origin.x/o.direction.x;bn.getPoint(o,r,i);let s=n.unproject(new m(i.y,i.z,0));if(!(s.latitude<-w.PI_OVER_TWO||s.latitude>w.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}nn.prototype.pickEllipsoid=function(e,t,n){if(!c(e))throw new L("windowPosition is required.");let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(c(n)||(n=new m),t=t??re.default,this._mode===se.SCENE3D)n=Kdt(this,e,t,n);else if(this._mode===se.SCENE2D)n=Qdt(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=qdt(this,e,this._projection,n);else return;return n}};var $dt=new m,eut=new m,tut=new m;function nut(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,l=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,f=e.positionWC;m.clone(f,n.origin);let p=m.multiplyByScalar(e.directionWC,l,$dt);m.add(f,p,p);let y=m.multiplyByScalar(e.rightWC,d*l*a,eut),h=m.multiplyByScalar(e.upWC,u*l*s,tut),g=m.add(p,y,n.direction);return m.add(g,h,g),m.subtract(g,f,g),m.normalize(g,g),n}var mD=new m;function iut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2/o*t.x-1;l*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;return m.clone(e.positionWC,u),m.multiplyByScalar(e.rightWC,l,mD),m.add(mD,u,u),m.multiplyByScalar(e.upWC,d,mD),m.add(mD,u,u),m.clone(e.directionWC,n.direction),n}nn.prototype.getPickRay=function(e,t){if(!c(e))throw new L("windowPosition is required.");c(t)||(t=new bn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return c(i.aspectRatio)&&c(i.fov)&&c(i.near)?nut(this,e,t):iut(this,e,t)};var out=new m,rut=new m;nn.prototype.distanceToBoundingSphere=function(e){if(!c(e))throw new L("boundingSphere is required.");let t=m.subtract(this.positionWC,e.center,out),n=m.multiplyByScalar(this.directionWC,m.dot(t,this.directionWC),rut);return Math.max(0,m.magnitude(n)-e.radius)};var sut=new D;nn.prototype.getPixelSize=function(e,t,n){if(!c(e))throw new L("boundingSphere is required.");if(!c(t))throw new L("drawingBufferWidth is required.");if(!c(n))throw new L("drawingBufferHeight is required.");let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,sut);return Math.max(o.x,o.y)};function aut(e,t,n,i,o,r){let s=m.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(l){let d=m.lerp(t,s,l.time,new m);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:Jr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var cut=new m,Bge=new m,lut=new m,dut=new m;function uut(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(m.UNIT_X,cut),r=-m.dot(o,n)/m.dot(o,i),s=m.add(n,m.multiplyByScalar(i,r,Bge),Bge);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,lut);let a=Math.tan(e.frustum.fovy*.5),l=e.frustum.aspectRatio*a,d=m.magnitude(m.subtract(n,s,dut)),u=l*d,f=a*d,p=e._maxCoord.x,y=e._maxCoord.y,h=Math.max(u-p,p),g=Math.max(f-y,y);if(n.z<-h||n.z>h||n.y<-g||n.y>g){let x=s.y<-h||s.y>h,S=s.z<-g||s.z>g;if(x||S)return aut(e,n,s,h,g,t)}}nn.prototype.createCorrectPositionTween=function(e){if(!c(e))throw new L("duration is required.");if(this._mode===se.COLUMBUS_VIEW)return uut(this,e)};var mut=new m,ta={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};nn.prototype.cancelFlight=function(){c(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};nn.prototype.completeFlight=function(){if(c(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ta.destination,e.orientation.heading=ta.heading,e.orientation.pitch=ta.pitch,e.orientation.roll=ta.roll,this.setView(e),c(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};nn.prototype.flyTo=function(e){e=e??z.EMPTY_OBJECT;let t=e.destination;if(!c(t))throw new L("destination is required.");if(this._mode===se.MORPHING)return;this.cancelFlight();let i=t instanceof de;i&&(t=this.getRectangleCameraCoordinates(t,mut));let o=e.orientation??z.EMPTY_OBJECT;if(c(o.direction)&&(o=exe(this,t,o,E4.orientation)),c(e.duration)&&e.duration<=0){let u=E4;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;ta.destination=t,ta.heading=o.heading,ta.pitch=o.pitch,ta.roll=o.roll,ta.duration=e.duration,ta.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),c(e.complete)&&e.complete()},ta.cancel=e.cancel,ta.endTransform=e.endTransform,ta.convert=i?!1:e.convert,ta.maximumHeight=e.maximumHeight,ta.pitchAdjustHeight=e.pitchAdjustHeight,ta.flyOverLongitude=e.flyOverLongitude,ta.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ta.easingFunction=e.easingFunction;let a=this._scene,l=wF.createTween(a,ta);if(l.duration===0){typeof l.complete=="function"&&l.complete();return}s=a.tweens.add(l),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==se.SCENE2D&&(c(d)||(d=nn.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function fut(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function hut(e,t){let n=e.frustum,i=n.offCenterFrustum;c(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 put=100;function axe(e,t,n){n=rm.clone(c(n)?n:nn.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!c(r)||r===0){let s=t.radius;s===0?n.range=put:e.frustum instanceof sn||e._mode===se.SCENE2D?n.range=hut(e,s):n.range=fut(e,s),n.range=w.clamp(n.range,i,o)}return n}nn.prototype.viewBoundingSphere=function(e,t){if(!c(e))throw new L("boundingSphere is required.");if(this._mode===se.MORPHING)throw new L("viewBoundingSphere is not supported while morphing.");t=axe(this,e,t),this.lookAt(e.center,t)};var but=new M,yut=new m,gut=new m,xut=new m,_ut=new m,Tut=new ce,Sut=new Fe,Cut=new te;nn.prototype.flyToBoundingSphere=function(e,t){if(!c(e))throw new L("boundingSphere is required.");t=t??z.EMPTY_OBJECT;let n=this._mode===se.SCENE2D||this._mode===se.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=axe(this,e,t.offset),o;n?o=m.multiplyByScalar(m.UNIT_Z,i.range,yut):o=rxe(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??re.default,a=wt.eastNorthUpToFixedFrame(e.center,s,but);M.multiplyByPoint(a,o,o);let l,d;if(!n){if(l=m.subtract(e.center,o,gut),m.normalize(l,l),d=M.multiplyByPointAsVector(a,m.UNIT_Z,xut),1-Math.abs(m.dot(l,d))<w.EPSILON6){let f=Fe.fromAxisAngle(l,i.heading,Sut),p=te.fromQuaternion(f,Cut);m.fromCartesian4(M.getColumn(a,1,Tut),d),te.multiplyByVector(p,d,d)}let u=m.cross(l,d,_ut);m.cross(u,l,d),m.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:l,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var Yge=new m,Hge=new m,R4=new m,zge=new m,vF=[new m,new m,new m,new m];function Vut(e,t){let n=t.radii,i=e.positionWC,o=m.multiplyComponents(t.oneOverRadii,i,Yge),r=m.magnitude(o),s=m.normalize(o,Hge),a,l;m.equalsEpsilon(s,m.UNIT_Z,w.EPSILON10)?(a=new m(0,1,0),l=new m(0,0,1)):(a=m.normalize(m.cross(m.UNIT_Z,s,R4),R4),l=m.normalize(m.cross(s,a,zge),zge));let d=Math.sqrt(m.magnitudeSquared(o)-1),u=m.multiplyByScalar(s,1/r,Yge),f=d/r,p=m.multiplyByScalar(a,f,Hge),y=m.multiplyByScalar(l,f,R4),h=m.add(u,y,vF[0]);m.subtract(h,p,h),m.multiplyComponents(n,h,h);let g=m.subtract(u,y,vF[1]);m.subtract(g,p,g),m.multiplyComponents(n,g,g);let x=m.subtract(u,y,vF[2]);m.add(x,p,x),m.multiplyComponents(n,x,x);let S=m.add(u,y,vF[3]);return m.add(S,p,S),m.multiplyComponents(n,S,S),vF}var G4=new D,Lut=new m,Eg=[new pe,new pe,new pe,new pe];function fD(e,t,n,i,o,r){G4.x=e,G4.y=t;let s=i.pickEllipsoid(G4,o,Lut);return c(s)?(Eg[n]=o.cartesianToCartographic(s,Eg[n]),1):(Eg[n]=o.cartesianToCartographic(r[n],Eg[n]),0)}nn.prototype.computeViewRectangle=function(e,t){e=e??re.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ue(m.ZERO,e.maximumRadius);if(n.computeVisibility(i)===zt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,l=0,d=Vut(this,e);if(l+=fD(0,0,0,this,e,d),l+=fD(0,a,1,this,e,d),l+=fD(s,a,2,this,e,d),l+=fD(s,0,3,this,e,d),l<2)return de.MAX_VALUE;t=de.fromCartographicArray(Eg,t);let u=0,f=Eg[3].longitude;for(let p=0;p<4;++p){let y=Eg[p].longitude,h=Math.abs(y-f);h>w.PI?u+=w.TWO_PI-h:u+=h,f=y}return w.equalsEpsilon(Math.abs(u),w.TWO_PI,w.EPSILON9)&&(t.west=-w.PI,t.east=w.PI,Eg[0].latitude>=0?t.north=w.PI_OVER_TWO:t.south=-w.PI_OVER_TWO),t};nn.prototype.switchToPerspectiveFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof Ci)return;let e=this._scene;this.frustum=new Ci,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=w.toRadians(60)};nn.prototype.switchToOrthographicFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof sn)return;let e=qge(this),t=this._scene;this.frustum=new sn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};nn.clone=function(e,t){return c(t)||(t=new nn(e._scene)),m.clone(e.position,t.position),m.clone(e.direction,t.direction),m.clone(e.up,t.up),m.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var oo=nn;var fNi=_(T(),1);function Zut(e){C.typeOf.object("options",e),C.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var hm=Zut;var TNi=_(T(),1);var mxe=_(cd(),1),cxe=576,Rut=100,FF="#ffffff",gD="#48b";function fxe(e,t){this.credit=e,this.count=t??1}function Gut(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Ct.equals(o,t))return!0}return!1}function Eut(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Ct.equals(n,t)||(c(t)&&e._cesiumCreditContainer.removeChild(t.element),c(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var hxe="cesium-credit-delimiter";function lxe(e){let t=document.createElement("span");return t.textContent=e,t.className=hxe,t}function dxe(e,t){if(c(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function uxe(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(c(a)){if(r=s,c(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(lxe(n));else{let u=o[d];u.className!==hxe&&e.replaceChild(lxe(n),u)}}let l=a.element;if(o.length<=r)e.appendChild(dxe(l,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(dxe(l,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Xut(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<cxe?(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>=cxe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Iut(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: ${FF};
  position: relative;
  min-height: ${Rut}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: ${FF};
}
.cesium-credit-lightbox > ul > li a:hover {
  color: ${gD};
}
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
  border: 1px solid #444;
  border-radius: 5px;
  max-width: 370px;
}
.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: ${FF};
}
.cesium-credit-lightbox-close:hover {
  color: ${gD};
}
.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: ${FF};
}
.cesium-credit-expand-link:hover {
  color: ${gD};
}

.cesium-credit-text {
  color: ${FF};
}

.cesium-credit-delimiter {
  padding: 0 5px;
}

.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
  display: inline;
}

.cesium-credit-textContainer a:hover {
  color: ${gD}
}

.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 gr(e,t,n){C.defined("container",e);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(h){r.contains(h.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 l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="&times;",l.className="cesium-credit-lightbox-close",r.appendChild(l);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-textContainer",f.style.display="inline",e.appendChild(f);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Iut(e);let y=Ct.clone(gr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=f,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=y,this._previousCesiumCredit=void 0,this._currentCesiumCredit=y,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Zt,lightboxCredits:new Zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function pxe(e,t,n,i){i=i??1;let o=t.get(n.id);if(c(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 fxe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}gr.prototype.addCreditToNextFrame=function(e){if(C.defined("credit",e),e.isIon()){c(this._defaultCredit)||(this._defaultCredit=Ct.clone(bxe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,pxe(this,t,e)};gr.prototype.addStaticCredit=function(e){C.defined("credit",e);let t=this._staticCredits;Gut(t,e)||t.push(e)};gr.prototype.removeStaticCredit=function(e){C.defined("credit",e);let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};gr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};gr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};gr.prototype.update=function(){this._expanded&&Xut(this)};gr.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()&&Ct.equals(gr.cesiumCredit,this._cesiumCredit)||pxe(this,s,r,Number.MAX_VALUE)}Ct.equals(gr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Ct.clone(gr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};gr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;uxe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",uxe(this._creditList,t,void 0,"li"),Eut(this)};gr.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),he(this)};gr.prototype.isDestroyed=function(){return!1};gr._cesiumCredit=void 0;gr._cesiumCreditInitialized=!1;var xD;function bxe(){if(!c(xD)){let e=on("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new mxe.default(e).path()),xD=new Ct(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return gr._cesiumCreditInitialized||(gr._cesiumCredit=xD,gr._cesiumCreditInitialized=!0),xD}Object.defineProperties(gr,{cesiumCredit:{get:function(){return bxe(),gr._cesiumCredit},set:function(e){gr._cesiumCredit=e,gr._cesiumCreditInitialized=!0}}});gr.CreditDisplayElement=fxe;var AF=gr;var _5i=_(T(),1);var NNi=_(T(),1);var _D=0,Wut=1;function MT(e){C.typeOf.object("options",e),C.typeOf.object("options.frustum",e.frustum),C.typeOf.object("options.origin",e.origin),C.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??We.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Ci?(s=_D,a=Ci.packedLength):t instanceof sn&&(s=Wut,a=sn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Fe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+m.packedLength+Fe.packedLength+We.packedLength}MT.pack=function(e,t,n){C.typeOf.object("value",e),C.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===_D?(Ci.pack(o,t,n),n+=Ci.packedLength):(sn.pack(o,t,n),n+=sn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Fe.pack(e._orientation,t,n),n+=Fe.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._drawNearPlane?1:0,t};var wut=new Ci,Put=new sn,vut=new Fe,Fut=new m,Aut=new We;MT.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o;i===_D?(o=Ci.unpack(e,t,wut),t+=Ci.packedLength):(o=sn.unpack(e,t,Put),t+=sn.packedLength);let r=m.unpack(e,t,Fut);t+=m.packedLength;let s=Fe.unpack(e,t,vut);t+=Fe.packedLength;let a=We.unpack(e,t,Aut);t+=We.packedLength;let l=e[t]===1;if(!c(n))return new MT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:l});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=Fe.clone(s,n._orientation),n._vertexFormat=We.clone(a,n._vertexFormat),n._drawNearPlane=l,n};function lL(e,t,n,i,o,r,s,a){let l=e/3*2;for(let d=0;d<4;++d)c(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),c(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),c(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[l]=0,o[l+1]=0,o[l+2]=1,o[l+3]=0,o[l+4]=1,o[l+5]=1,o[l+6]=0,o[l+7]=1}var Mut=new te,Nut=new M,w4=new M,yxe=new m,gxe=new m,xxe=new m,kut=new m,Uut=new m,Out=new m,Xg=new Array(3),MF=new Array(4);MF[0]=new ce(-1,-1,1,1);MF[1]=new ce(1,-1,1,1);MF[2]=new ce(1,1,1,1);MF[3]=new ce(-1,1,1,1);var _xe=new Array(4);for(let e=0;e<4;++e)_xe[e]=new ce;MT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let l=te.fromQuaternion(t,Mut),d=r??yxe,u=s??gxe,f=a??xxe;d=te.getColumn(l,0,d),u=te.getColumn(l,1,u),f=te.getColumn(l,2,f),m.normalize(d,d),m.normalize(u,u),m.normalize(f,f),m.negate(d,d);let p=M.computeView(e,f,u,d,Nut),y,h,g=i.projectionMatrix;if(n===_D){let x=M.multiply(g,p,w4);h=M.inverse(x,w4)}else y=M.inverseTransformation(p,w4);c(h)?(Xg[0]=i.near,Xg[1]=i.far):(Xg[0]=0,Xg[1]=i.near,Xg[2]=i.far);for(let x=0;x<2;++x)for(let S=0;S<4;++S){let V=ce.clone(MF[S],_xe[S]);if(c(h)){V=M.multiplyByVector(h,V,V);let Z=1/V.w;m.multiplyByScalar(V,Z,V),m.subtract(V,e,V),m.normalize(V,V);let R=m.dot(f,V);m.multiplyByScalar(V,Xg[x]/R,V),m.add(V,e,V)}else{let Z=i.offCenterFrustum;c(Z)&&(i=Z);let R=Xg[x],E=Xg[x+1];V.x=(V.x*(i.right-i.left)+i.left+i.right)*.5,V.y=(V.y*(i.top-i.bottom)+i.bottom+i.top)*.5,V.z=(V.z*(R-E)-R-E)*.5,V.w=1,M.multiplyByVector(y,V,V)}o[12*x+S*3]=V.x,o[12*x+S*3+1]=V.y,o[12*x+S*3+2]=V.z}};MT.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,l=new Float64Array(3*4*6);MT._computeNearFarPlanes(i,o,t,n,l);let d=3*4*2;l[d]=l[3*4],l[d+1]=l[3*4+1],l[d+2]=l[3*4+2],l[d+3]=l[0],l[d+4]=l[1],l[d+5]=l[2],l[d+6]=l[3*3],l[d+7]=l[3*3+1],l[d+8]=l[3*3+2],l[d+9]=l[3*7],l[d+10]=l[3*7+1],l[d+11]=l[3*7+2],d+=3*4,l[d]=l[3*5],l[d+1]=l[3*5+1],l[d+2]=l[3*5+2],l[d+3]=l[3],l[d+4]=l[4],l[d+5]=l[5],l[d+6]=l[0],l[d+7]=l[1],l[d+8]=l[2],l[d+9]=l[3*4],l[d+10]=l[3*4+1],l[d+11]=l[3*4+2],d+=3*4,l[d]=l[3],l[d+1]=l[4],l[d+2]=l[5],l[d+3]=l[3*5],l[d+4]=l[3*5+1],l[d+5]=l[3*5+2],l[d+6]=l[3*6],l[d+7]=l[3*6+1],l[d+8]=l[3*6+2],l[d+9]=l[3*2],l[d+10]=l[3*2+1],l[d+11]=l[3*2+2],d+=3*4,l[d]=l[3*2],l[d+1]=l[3*2+1],l[d+2]=l[3*2+2],l[d+3]=l[3*6],l[d+4]=l[3*6+1],l[d+5]=l[3*6+2],l[d+6]=l[3*7],l[d+7]=l[3*7+1],l[d+8]=l[3*7+2],l[d+9]=l[3*3],l[d+10]=l[3*3+1],l[d+11]=l[3*3+2],r||(l=l.subarray(3*4));let u=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:l})});if(c(s.normal)||c(s.tangent)||c(s.bitangent)||c(s.st)){let p=c(s.normal)?new Float32Array(12*a):void 0,y=c(s.tangent)?new Float32Array(3*4*a):void 0,h=c(s.bitangent)?new Float32Array(3*4*a):void 0,g=c(s.st)?new Float32Array(2*4*a):void 0,x=yxe,S=gxe,V=xxe,Z=m.negate(x,kut),R=m.negate(S,Uut),E=m.negate(V,Out);d=0,r&&(lL(d,p,y,h,g,E,x,S),d+=3*4),lL(d,p,y,h,g,V,Z,S),d+=3*4,lL(d,p,y,h,g,Z,E,S),d+=3*4,lL(d,p,y,h,g,R,E,Z),d+=3*4,lL(d,p,y,h,g,x,V,S),d+=3*4,lL(d,p,y,h,g,S,V,Z),c(p)&&(u.normal=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:p})),c(y)&&(u.tangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:y})),c(h)&&(u.bitangent=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:h})),c(g)&&(u.st=new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:2,values:g}))}let f=new Uint16Array(6*a);for(let p=0;p<a;++p){let y=p*6,h=p*4;f[y]=h,f[y+1]=h+1,f[y+2]=h+2,f[y+3]=h,f[y+4]=h+2,f[y+5]=h+3}return new dt({attributes:u,indices:f,primitiveType:ve.TRIANGLES,boundingSphere:ue.fromVertices(l)})};var NT=MT;var e5i=_(T(),1);var P4=0,Dut=1;function NF(e){C.typeOf.object("options",e),C.typeOf.object("options.frustum",e.frustum),C.typeOf.object("options.origin",e.origin),C.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Ci?(r=P4,s=Ci.packedLength):t instanceof sn&&(r=Dut,s=sn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=m.clone(i),this._orientation=Fe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+m.packedLength+Fe.packedLength}NF.pack=function(e,t,n){C.typeOf.object("value",e),C.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===P4?(Ci.pack(o,t,n),n+=Ci.packedLength):(sn.pack(o,t,n),n+=sn.packedLength),m.pack(e._origin,t,n),n+=m.packedLength,Fe.pack(e._orientation,t,n),n+=Fe.packedLength,t[n]=e._drawNearPlane?1:0,t};var But=new Ci,Yut=new sn,Hut=new Fe,zut=new m;NF.unpack=function(e,t,n){C.defined("array",e),t=t??0;let i=e[t++],o;i===P4?(o=Ci.unpack(e,t,But),t+=Ci.packedLength):(o=sn.unpack(e,t,Yut),t+=sn.packedLength);let r=m.unpack(e,t,zut);t+=m.packedLength;let s=Fe.unpack(e,t,Hut);t+=Fe.packedLength;let a=e[t]===1;if(!c(n))return new NF({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(l),n._frustumType=i,n._origin=m.clone(r,n._origin),n._orientation=Fe.clone(s,n._orientation),n._drawNearPlane=a,n};NF.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);NT._computeNearFarPlanes(i,o,t,n,s);let a=new fn({position:new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:s})}),l,d,u=r?2:1,f=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)l=r?p*8:0,d=p*4,f[l]=d,f[l+1]=d+1,f[l+2]=d+1,f[l+3]=d+2,f[l+4]=d+2,f[l+5]=d+3,f[l+6]=d+3,f[l+7]=d;for(p=0;p<2;++p)l=(u+p)*8,d=p*4,f[l]=d,f[l+1]=d+4,f[l+2]=d+1,f[l+3]=d+5,f[l+4]=d+2,f[l+5]=d+6,f[l+6]=d+3,f[l+7]=d+7;return new dt({attributes:a,indices:f,primitiveType:ve.LINES,boundingSphere:ue.fromVertices(s)})};var kF=NF;function TD(e){if(e=e??z.EMPTY_OBJECT,!c(e.camera))throw new L("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??Y.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Kut=new m,Jut=new te,Qut=new Fe,jut=new Ci,qut=new hl,$ut=new sn,emt=new Oo,tmt=new Y,nmt=[1,1e5];TD.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 Ci?a=jut:s instanceof hl?a=qut:s instanceof sn?a=$ut:a=emt,a=s.clone(a);let l,d=this._frustumSplits;!c(d)||d.length<=1?(d=nmt,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,l=1):l=d.length-1;let u=r.positionWC,f=r.directionWC,p=r.upWC,y=r.rightWC;y=m.negate(y,Kut);let h=Jut;te.setColumn(h,0,y,h),te.setColumn(h,1,p,h),te.setColumn(h,2,f,h);let g=Fe.fromRotationMatrix(h,Qut);for(t.length=n.length=l,i=0;i<l;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Rt({geometry:new NT({origin:u,orientation:g,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(Y.fromAlpha(this._color,.1,tmt))},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Rt({geometry:new kF({origin:u,orientation:g,frustum:a,_drawNearPlane:i===0}),attributes:{color:Yt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new an({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};TD.prototype.isDestroyed=function(){return!1};TD.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 he(this)};var op=TD;var O5i=_(T(),1);function OF(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 UF=Ot.supportsTypedArrays()?new Float32Array(12):[],Txe=new m,Sxe=new m,v4=new m,Cxe=new m,SD=new m;function imt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof sn)o=m.ZERO,r=i.rightWC,s=i.upWC;else{let f=i.positionWC,p=m.multiplyComponents(e.oneOverRadii,f,Txe),y=m.normalize(p,Sxe),h=m.normalize(m.cross(m.UNIT_Z,p,v4),v4),g=m.normalize(m.cross(y,h,Cxe),Cxe),x=m.magnitude(p),S=Math.sqrt(x*x-1);o=m.multiplyByScalar(y,1/x,Txe);let V=S/x;r=m.multiplyByScalar(h,V,Sxe),s=m.multiplyByScalar(g,V,v4)}let a=m.add(o,s,SD);m.subtract(a,r,a),m.multiplyComponents(n,a,a),m.pack(a,UF,0);let l=m.subtract(o,s,SD);m.subtract(l,r,l),m.multiplyComponents(n,l,l),m.pack(l,UF,3);let d=m.add(o,s,SD);m.add(d,r,d),m.multiplyComponents(n,d,d),m.pack(d,UF,6);let u=m.subtract(o,s,SD);return m.add(u,r,u),m.multiplyComponents(n,u,u),m.pack(u,UF,9),UF}OF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==se.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new re(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(c(this._command)||(this._rs=Oe.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 ue(m.ZERO,i.maximumRadius),pass:Xe.OPAQUE,owner:this})),!c(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Be({sources:[Av]}),a=new Be({sources:[Fv]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=imt(i,e);if(c(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new dt({attributes:{position:new Ee({componentDatatype:q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:ve.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Ne.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};OF.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};OF.prototype.isDestroyed=function(){return!1};OF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var DF=OF;var j5i=_(T(),1);function uL(){}var omt=/\bgl_FragDepth\b/,rmt=/\bdiscard\b/;function smt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(c(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(omt.test(r[a])||rmt.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 Be({sources:[a]})}else if(!o&&s){let a=`void main()
{
    out_FragColor = vec4(1.0);
    czm_writeLogDepth();
}
`;i=new Be({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function amt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(c(i))return i;let o=Oe.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Oe.fromCache(o);return n[t.id]=r,r}uL.createDepthOnlyDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=et.shallowClone(t,i.depthOnlyCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=smt(n,t.shaderProgram),i.depthOnlyCommand.renderState=amt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var cmt=/\s+czm_writeLogDepth\(/,lmt=/\s+czm_vertexLogDepth\(/;function dmt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(c(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=c(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,l=r.sources;for(let u=0;u<l.length;++u)if(lmt.test(l[u])){a=!0;break}if(!a){for(let f=0;f<l.length;++f)l[f]=Be.replaceMain(l[f],"czm_log_depth_main");l.push(`

void main()
{
    czm_log_depth_main();
    czm_vertexLogDepth();
}
`)}l=s.sources,a=!1;for(let u=0;u<l.length;++u)cmt.test(l[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<l.length;u++)l[u]=Be.replaceMain(l[u],"czm_log_depth_main");d=`
void main()
{
    czm_log_depth_main();
    czm_writeLogDepth();
}
`}return l.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}uL.createLogDepthCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=et.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=dmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function umt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(c(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,l=r.some(y=>y.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () 
{ 
    czm_non_pick_main(); 
    if (${l}.a == 0.0) { 
        discard; 
    } 
    ${l} = ${n}; 
} `,u=r.length,f=new Array(u+1);for(let y=0;y<u;++y)f[y]=Be.replaceMain(r[y],"czm_non_pick_main");f[u]=d;let p=new Be({sources:f,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Vxe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(c(i))return i;let o=Oe.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Oe.fromCache(o);return n[t.id]=r,r}uL.createPickDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=et.shallowClone(t,i.pickCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=umt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Vxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function dL(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 Lxe(e){return e.isArray?e.arrayLength:lt.getComponentCount(e.type)}function mmt(e){let t=Lxe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function Zxe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function Rxe(e,t){let n=At.getMaximum(t);return`(${e}) / float(${n})`}function fmt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=Zxe(n,i,o)}return e.normalized||(n=Rxe(n,e.componentType)),n}function hmt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=Zxe(o,r,s)}return e.normalized||(o=Rxe(o,e.componentType)),o}function pmt(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(c(a))return a;let l=n.metadataProperty,d=n.classProperty,u=mmt(d),f=["0.0","0.0","0.0","0.0"],p=Lxe(d);if(p===1)f[0]=fmt(d,l);else{let x=["x","y","z","w"];for(let S=0;S<p;S++)f[S]=hmt(d,l,x[S])}let y=t.fragmentShaderSource.defines.slice();y.push(Ld.METADATA_PICKING_ENABLED),dL(y,Ld.METADATA_PICKING_VALUE_TYPE,u),dL(y,Ld.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_X,f[0]),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_Y,f[1]),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_Z,f[2]),dL(y,Ld.METADATA_PICKING_VALUE_COMPONENT_W,f[3]);let h=new Be({sources:t.fragmentShaderSource.sources,defines:y});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:h,attributeLocations:t._attributeLocations})}uL.createPickMetadataDerivedCommand=function(e,t,n,i){return c(i)||(i={}),i.pickMetadataCommand=et.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=pmt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Vxe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function bmt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(c(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=c(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}uL.createHdrCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=et.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=bmt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var rp=uL;var rki=_(T(),1);function CD(e){if(!c(e))throw new L("scene is required.");this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!c(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=w.toRadians(o),t._beta=w.toRadians(i.beta),t._gamma=w.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var ymt=new Fe,Gxe=new Fe,gmt=new te;function xmt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Fe.fromAxisAngle(o,n,Gxe),l=Fe.fromAxisAngle(r,i,ymt),d=Fe.multiply(l,a,l),u=Fe.fromAxisAngle(s,t,Gxe);Fe.multiply(u,d,d);let f=te.fromQuaternion(d,gmt);te.multiplyByVector(f,r,r),te.multiplyByVector(f,s,s),te.multiplyByVector(f,o,o)}CD.prototype.update=function(){if(!c(this._alpha))return;c(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;xmt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};CD.prototype.isDestroyed=function(){return!1};CD.prototype.destroy=function(){return this._removeListener(),he(this)};var BF=CD;var mki=_(T(),1);function F4(){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(F4.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){if(c(e)&&e<0)throw new L("value must be positive.");this._heightFalloff=e}}});var _mt=new m;F4.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!c(i)||i.height>this.maxHeight||e.mode!==se.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,w.EPSILON4),-Math.max(this._heightFalloff,0)),s=m.normalize(n.positionWC,_mt),a=Math.abs(m.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var YF=F4;var pki=_(T(),1);function Tmt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=se.SCENE3D,this.morphTime=se.getMorphTime(se.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var HF=Tmt;var Gki=_(T(),1);var Ca={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},kT=Ca.DERIVED_COMMANDS_MAXIMUM_LENGTH,Mxe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function UT(){this._frontFaceAlphaByDistance=new Nt(0,1,0,1),this._backFaceAlphaByDistance=new Nt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=de.clone(de.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(kT),this._derivedBlendCommandTypes=new Array(kT),this._derivedPickCommandTypes=new Array(kT),this._derivedCommandTypesToUpdate=new Array(kT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(UT.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}}});UT.prototype.update=function(e){let t=e.globe;if(!c(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=Exe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=Exe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Xxe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Xxe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Lmt(this,e,t),this._sunVisibleThroughGlobe=Smt(this,e),this._environmentVisible=Cmt(this,e),this._useDepthPlane=Vmt(this,e),this._numberOfTextureUniforms=Zmt(this),this._rectangle=de.clone(t.translucency.rectangle,this._rectangle),Rmt(this,e)};function Exe(e,t,n,i){return e?c(n)?(Nt.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 Xxe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function Smt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function Cmt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function Vmt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Lmt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function Zmt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Rmt(e,t){e._derivedCommandsLength=A4(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=A4(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=A4(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<kT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!c(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Omt())}function A4(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let l=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?Ca.PICK_FRONT_FACE:d?Ca.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:Ca.TRANSLUCENT_FRONT_FACE,f=i?Ca.PICK_BACK_FACE:d?Ca.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:Ca.TRANSLUCENT_BACK_FACE;return t.mode===se.SCENE2D?(o[r++]=Ca.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=Ca.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(o[r++]=u,o[r++]=f):(o[r++]=f,o[r++]=u)):l?(n||(o[r++]=Ca.DEPTH_ONLY_BACK_FACE),o[r++]=Ca.OPAQUE_FRONT_FACE,o[r++]=f):(n||(o[r++]=Ca.DEPTH_ONLY_FRONT_FACE),o[r++]=Ca.OPAQUE_BACK_FACE,o[r++]=u),r)}function pm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Ixe(e,t){return e.indexOf(t)>-1}function Gmt(e,t){pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function Emt(e,t){pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG"),pm(e.defines,"TRANSLUCENT"),pm(t.defines,"TRANSLUCENT")}function M4(e,t){if(Ixe(t.defines,"TILE_LIMIT_RECTANGLE")||Ixe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() 
{ 
    out_FragColor = vec4(1.0); 
} 
`;t.sources=[n]}function N4(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Be.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 Nxe(e,t){N4(e,t),pm(e.defines,"GROUND_ATMOSPHERE"),pm(t.defines,"GROUND_ATMOSPHERE"),pm(e.defines,"FOG"),pm(t.defines,"FOG")}function Xmt(e,t){N4(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Imt(e,t){Nxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Wxe(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 Wmt(e,t,n,i,o,r){if(!c(o))return t;if(!i&&c(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!c(s)){let a=t._attributeLocations,l=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();l.defines=c(l.defines)?l.defines.slice(0):[],d.defines=c(d.defines)?d.defines.slice(0):[],o(l,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:l,fragmentShaderSource:d,attributeLocations:a})}return s}function wmt(e){e.cull.face=_i.BACK,e.cull.enabled=!0}function Pmt(e){e.cull.face=_i.FRONT,e.cull.enabled=!0}function vmt(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Fmt(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Amt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function wxe(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Pxe(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Mmt(e){e.cull.face=_i.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Nmt(e){e.cull.face=_i.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function kmt(e,t,n,i,o){if(!c(i))return e;if(!n&&c(t))return t;let r=o[e.id];if(!c(r)){let s=Oe.getState(e);i(s),r=Oe.fromCache(s),o[e.id]=r}return r}function mL(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Umt(e,t,n,i,o){return c(o)?!i&&c(n)?n:St(t,o(e),!1):t}function Of(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Omt(){return[new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:Gmt,getRenderStateFunction:wmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:Emt,getRenderStateFunction:Pmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:M4,getRenderStateFunction:vmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:M4,getRenderStateFunction:Fmt,getUniformMapFunction:void 0}),new Of({pass:Xe.GLOBE,pickOnly:!1,getShaderProgramFunction:M4,getRenderStateFunction:Amt,getUniformMapFunction:void 0}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:N4,getRenderStateFunction:wxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Nxe,getRenderStateFunction:Pxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Xmt,getRenderStateFunction:wxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Imt,getRenderStateFunction:Pxe,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Wxe,getRenderStateFunction:Mmt,getUniformMapFunction:mL}),new Of({pass:Xe.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Wxe,getRenderStateFunction:Nmt,getUniformMapFunction:mL})]}var vxe=new Array(kT),Fxe=new Array(kT);UT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)Fxe[o]=this._derivedCommandPacks[n[o]],vxe[o]=Mxe[n[o]];Dmt(this,e,i,n,vxe,Fxe,t)}};function Dmt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!c(a)||l){t.dirty=!1,c(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=a.uniformMapDirtyFrame??0,f=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,y=a.uniformMap!==t.uniformMap,h=a.shaderProgramId!==t.shaderProgram.id,g=a.renderStateId!==t.renderState.id;y&&(a.uniformMapDirtyFrame=d),h&&(a.shaderProgramDirtyFrame=d),g&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let x=0;x<n;++x){let S=r[x],V=i[x],Z=o[x],R=a[Z],E,I,v;c(R)?(E=R.uniformMap,I=R.shaderProgram,v=R.renderState):(E=void 0,I=void 0,v=void 0),R=et.shallowClone(t,R),a[Z]=R;let P=R.derivedCommands.uniformMapDirtyFrame??0,F=R.derivedCommands.shaderProgramDirtyFrame??0,N=R.derivedCommands.renderStateDirtyFrame??0,b=y||P<u,G=h||F<f,X=g||N<p;b&&(R.derivedCommands.uniformMapDirtyFrame=d),G&&(R.derivedCommands.shaderProgramDirtyFrame=d),X&&(R.derivedCommands.renderStateDirtyFrame=d),R.derivedCommands.type=V,R.pass=S.pass,R.pickOnly=S.pickOnly,R.uniformMap=Umt(e,t.uniformMap,E,b,S.getUniformMapFunction),R.shaderProgram=Wmt(s.context,t.shaderProgram,I,G,S.getShaderProgramFunction,Z),R.renderState=kmt(t.renderState,v,X,S.getRenderStateFunction,S.renderStateCache)}}}UT.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 l=Mxe[o[a]];n.commandList.push(s[l])}};function kxe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],l=a.derivedCommands.type;(!c(r)||r.indexOf(l)>-1)&&n(a,i,o)}}function Axe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Bmt=[Ca.OPAQUE_FRONT_FACE,Ca.OPAQUE_BACK_FACE],Ymt=[Ca.DEPTH_ONLY_FRONT_FACE,Ca.DEPTH_ONLY_BACK_FACE,Ca.DEPTH_ONLY_FRONT_AND_BACK_FACE];UT.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Xe.GLOBE],a=e.indices[Xe.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),kxe(s,a,t,i,o,Bmt))};UT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Xe.GLOBE],l=e.indices[Xe.GLOBE],d=e.commands[Xe.TERRAIN_CLASSIFICATION],u=e.indices[Xe.TERRAIN_CLASSIFICATION];if(l===0||u===0)return;let f=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!f||!p)&&Axe(d,u,t,i,o),!f&&!p)return;this._globeTranslucencyFramebuffer=n;let y=s.globeDepthTexture,h=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,kxe(a,l,t,i,o,Ymt),r.depthTexture){let g=n.packDepth(r,o);s.globeDepthTexture=g}Axe(d,u,t,i,o),s.globeDepthTexture=y,o.framebuffer=h};var zF=UT;var Jki=_(T(),1);var Xki=_(T(),1),td=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function sp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new hi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new hi({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 ti({color:new Y(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new Y(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(sp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});sp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Hmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},zmt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:On.NOT_EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Kmt={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},Jmt=`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;
}
`,Qmt=`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
}
`;sp.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,l=!c(i)||i.width!==s||i.height!==a;if((l||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._previousFramebuffer)||(this._depthStencilTexture=new Pt({context:e,width:s,height:a,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new md({context:e,width:s,height:a,format:ac.DEPTH24_STENCIL8,numSamples:t})))),!c(this._fbo.framebuffer)||l||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;c(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),c(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),c(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(c(this._rsUnclassified)||(this._rsUnclassified=Oe.fromCache(Hmt),this._rsClassified=Oe.fromCache(zmt),this._rsDefault=Oe.fromCache(Kmt)),!c(this._unclassifiedCommand)||o||r){c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=c(this._previousFramebuffer)?Qmt:Jmt,u=new Be({defines:["UNCLASSIFIED"],sources:[d]}),f=new Be({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:c(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(f,{renderState:c(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),c(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),c(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(td,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};sp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};sp.prototype.clear=function(e,t){c(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};sp.prototype.executeClassified=function(e,t){if(!c(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)};sp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),he(this)};var fL=sp;var tUi=_(T(),1);function VD(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(VD.prototype,{total:{get:function(){return this._total}}});function Ig(e){if(c(e)&&e.length!==fa.NUMBER_OF_JOB_TYPES)throw new L("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");let t=new Array(fa.NUMBER_OF_JOB_TYPES);t[fa.TEXTURE]=new VD(c(e)?e[fa.TEXTURE]:10),t[fa.PROGRAM]=new VD(c(e)?e[fa.PROGRAM]:10),t[fa.BUFFER]=new VD(c(e)?e[fa.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}Ig.getTimestamp=Ti;Object.defineProperties(Ig.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Ig.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Ig.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};Ig.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 l=n.length,d;for(d=0;d<l&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===l&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Ig.getTimestamp();e.execute();let a=Ig.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var KF=Ig;var lUi=_(T(),1);function LD(e){e=e??z.EMPTY_OBJECT;let t=Wn(e.container);if(!c(t))throw new L("container is required");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=Ti(),this._lastMsSampleTime=Ti(),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(LD.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});LD.prototype.update=function(e){let t=Ti(),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}};LD.prototype.destroy=function(){return he(this)};var p0=LD;var m3i=_(T(),1);var SUi=_(T(),1);var Va={};Va.decodeRawMetadataValue=function(e,t,n){switch(e){case At.INT8:return t.getInt8(n);case At.UINT8:return t.getUint8(n);case At.INT16:return t.getInt16(n,!0);case At.UINT16:return t.getUint16(n,!0);case At.INT32:return t.getInt32(n,!0);case At.UINT32:return t.getUint32(n,!0);case At.INT64:return t.getBigInt64(n,!0);case At.UINT64:return t.getBigUint64(n,!0);case At.FLOAT32:return t.getFloat32(n,!0);case At.FLOAT64:return t.getFloat64(n,!0)}throw new le(`Invalid component type: ${e}`)};Va.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Va.decodeRawMetadataValue(i,t,n);return e.normalized?At.normalize(o,i):o};Va.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=At.getSizeInBytes(i),r=e.type,s=lt.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let f=0;f<s;f++){let p=n*a+f*o,y=Va.decodeRawMetadataValueComponent(e,t,p);u[f]=y}return u}let l=n*a;return Va.decodeRawMetadataValueComponent(e,t,l)};Va.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=Va.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Va.decodeRawMetadataValueElement(e,n,0)};Va.convertToObjectType=function(e,t){if(!c(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case lt.VEC2:return D.unpack(n,0,new D);case lt.VEC3:return m.unpack(n,0,new m);case lt.VEC4:return ce.unpack(n,0,new ce);case lt.MAT2:return Ii.unpack(n,0,new Ii);case lt.MAT3:return te.unpack(n,0,new te);case lt.MAT4:return M.unpack(n,0,new M)}throw new le(`Invalid metadata object type: ${e}`)};Va.convertFromObjectType=function(e,t){if(!c(t)||e===lt.SCALAR||e===lt.STRING||e===lt.BOOLEAN||e===lt.ENUM)return t;switch(e){case lt.VEC2:return D.pack(t,Array(2));case lt.VEC3:return m.pack(t,Array(3));case lt.VEC4:return ce.pack(t,Array(4));case lt.MAT2:return Ii.pack(t,Array(4));case lt.MAT3:return te.pack(t,Array(9));case lt.MAT4:return M.pack(t,Array(16))}throw new le(`Invalid metadata object type: ${e}`)};Va.decodeMetadataValues=function(e,t,n){let i=Va.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Va.convertFromObjectType(e.type,t.offset),s=Va.convertFromObjectType(e.type,t.scale);i=gh.valueTransformInPlace(i,r,s,At.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let l=i[a],d=Va.convertToObjectType(e.type,l);s[a]=d}return s}return Va.convertToObjectType(e.type,i)};var JF=Object.freeze(Va);var EUi=_(T(),1);function OT(){this._framebuffer=new hi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(OT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function jmt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function qmt(e,t,n){c(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:Oe.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}OT.prototype.update=function(e,t){jmt(this,e,t),qmt(this,e,t)};var $mt=new ce,eft=new ce(1,1/255,1/65025,1/16581375);OT.prototype.getDepth=function(e,t,n){if(!c(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ce.unpack(i,0,$mt);return ce.divideByScalar(o,255,o),ce.dot(o,eft)};OT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};OT.prototype.isDestroyed=function(){return!1};OT.prototype.destroy=function(){return this._framebuffer.destroy(),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=c(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),he(this)};var QF=OT;var MBi=_(T(),1);var WUi=_(T(),1);function tft(e,t){this.near=e??0,this.far=t??0;let n=Xe.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 jF=tft;var QUi=_(T(),1);var PUi=_(T(),1),Wg=`uniform highp sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function ap(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new hi,this._tempCopyDepthFramebuffer=new hi,this._updateDepthFramebuffer=new hi({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 je,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(ap.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 Uxe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!je.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),a=!0),(!c(e._rs)||!je.equals(r,e._rs.viewport)||a)&&(e._rs=Oe.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Oe.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Oe.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:On.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),c(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Wg,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,c(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,c(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Wg,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,c(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,c(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new Y(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}ap.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,l=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,l),this._copyDepthFramebuffer.update(e,s,a),Uxe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};ap.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};ap.prototype.executeCopyDepth=function(e,t){c(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};ap.prototype.executeUpdateDepth=function(e,t,n){let i=c(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){c(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!c(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!c(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),Uxe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};ap.prototype.executeCopyColor=function(e,t){c(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};ap.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;c(i)&&(Y.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};ap.prototype.isDestroyed=function(){return!1};ap.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),c(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),c(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),c(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),he(this)};var qF=ap;var aOi=_(T(),1);function DT(){this._framebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new hi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new je,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(DT.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 nft(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function ift(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function oft(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!je.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,je.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=je.clone(o.viewport,e._scissorRectangle),s=!0),(!c(e._renderState)||!je.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Wg,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),c(e._clearCommand)||(e._clearCommand=new ti({color:new Y(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}DT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;ift(this,n,o,r,e),oft(this,n,o,r,i),this._useHdr=e};DT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};DT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};DT.prototype.isDestroyed=function(){return!1};DT.prototype.destroy=function(){return nft(this),he(this)};var $F=DT;var ZOi=_(T(),1);function b0(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 hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new hi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new hi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new hi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new Y(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new Y(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new Y(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new Y(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 je,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Oxe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function k4(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Dxe(e){Oxe(e),k4(e)}function rft(e,t,n,i){Oxe(e),e._accumulationTexture=new Pt({context:t,width:n,height:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function sft(e,t){k4(e);let n=oe.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)&&(k4(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,l=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!l||!d)&&(Dxe(e),e._translucentMultipassSupport=!1,i=!1)}return i}b0.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,l=!c(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((l||d)&&(this._numSamples=o,rft(this,e,r,s)),(!c(this._translucentFBO.framebuffer)||l||d)&&!sft(this,e))return;this._useHDR=i;let u=this,f,p;c(this._compositeCommand)||(f=new Be({sources:[vv]}),this._translucentMRTSupport&&f.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(f,{uniformMap:p,owner:this})),c(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(f=new Be({defines:["MRT"],sources:[kV]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(f,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(f=new Be({sources:[kV]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(f,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(f,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let y=!je.equals(this._viewport,t.viewport),h=y!==this._useScissorTest;this._useScissorTest=y,je.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=je.clone(t.viewport,this._scissorRectangle),h=!0),(!c(this._rs)||!je.equals(this._viewport,this._rs.viewport)||h)&&(this._rs=Oe.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),c(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var aft={enabled:!0,color:new Y(0,0,0,0),equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA},cft={enabled:!0,color:new Y(0,0,0,0),equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationAlpha:Co.ONE},lft={enabled:!0,color:new Y(0,0,0,0),equationRgb:Pa.ADD,equationAlpha:Pa.ADD,functionSourceRgb:Co.ZERO,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA};function U4(e,t,n,i){let o=n[i.id];if(!c(o)){let r=Oe.getState(i);r.depthMask=!1,r.blending=t,o=Oe.fromCache(r),n[i.id]=o}return o}function dft(e,t,n){return U4(t,aft,e._translucentRenderStateCache,n)}function uft(e,t,n){return U4(t,cft,e._translucentRenderStateCache,n)}function mft(e,t,n){return U4(t,lft,e._alphaRenderStateCache,n)}var fft=`    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);
`,hft=`    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;
`,pft=`    float ai = czm_out_FragColor.a;
    out_FragColor = vec4(ai);
`;function O4(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(c(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return Be.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor;
bool czm_discard = false;
`);let l=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<l.length;u++){let f=l[u];d=`layout (location = ${f[1]}) out vec4 ${f[0]};
${d}`}return a.sources.push(d),a.sources.push(`void main()
{
    czm_translucent_main();
    if (czm_discard)
    {
        discard;
    }
${i}}
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function bft(e,t){return O4(e,t,"translucentMRT",fft)}function yft(e,t){return O4(e,t,"translucentMultipass",hft)}function gft(e,t){return O4(e,t,"alphaMultipass",pft)}b0.prototype.createDerivedCommands=function(e,t,n){if(c(n)||(n={}),this._translucentMRTSupport){let a,l;return c(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,l=n.translucentCommand.renderState),n.translucentCommand=et.shallowClone(e,n.translucentCommand),!c(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=bft(t,e.shaderProgram),n.translucentCommand.renderState=dft(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=l),n}let i,o,r,s;return c(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),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=yft(t,e.shaderProgram),n.translucentCommand.renderState=uft(this,t,e.renderState),n.alphaCommand.shaderProgram=gft(t,e.shaderProgram),n.alphaCommand.renderState=mft(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 xft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:d}=a,u=t._hdr,f=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let y=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let h=0;h<o.length;++h){let g=o[h];g=l?g.derivedCommands.logDepth.command:g,g=u?g.derivedCommands.hdr.command:g;let x=p&&g.receiveShadows?g.derivedCommands.oit.shadows.translucentCommand:g.derivedCommands.oit.translucentCommand;n(x,t,i,y)}if(c(r)){let h=r.unclassifiedCommand,g=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;n(g,t,i,y)}i.framebuffer=e._alphaFBO.framebuffer;for(let h=0;h<o.length;++h){let g=o[h];g=l?g.derivedCommands.logDepth.command:g,g=u?g.derivedCommands.hdr.command:g;let x=p&&g.receiveShadows?g.derivedCommands.oit.shadows.alphaCommand:g.derivedCommands.oit.alphaCommand;n(x,t,i,y)}if(c(r)){let h=r.unclassifiedCommand,g=p&&h.receiveShadows?h.derivedCommands.oit.shadows.alphaCommand:h.derivedCommands.oit.alphaCommand;n(g,t,i,y)}i.framebuffer=f}function _ft(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:d}=a,u=t._hdr,f=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let y=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let h=0;h<o.length;++h){let g=o[h];g=l?g.derivedCommands.logDepth.command:g,g=u?g.derivedCommands.hdr.command:g;let x=p&&g.receiveShadows?g.derivedCommands.oit.shadows.translucentCommand:g.derivedCommands.oit.translucentCommand;n(x,t,i,y)}if(c(r)){let h=r.unclassifiedCommand,g=p&&h.receiveShadows?h.derivedCommands.oit.shadows.translucentCommand:h.derivedCommands.oit.translucentCommand;n(g,t,i,y)}i.framebuffer=f}b0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){_ft(this,e,t,n,i,o);return}xft(this,e,t,n,i,o)};b0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};b0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,Y.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};b0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};b0.prototype.isDestroyed=function(){return!1};b0.prototype.destroy=function(){return Dxe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),he(this)};var eA=b0;var WOi=_(T(),1);function tA(){this._framebuffer=new hi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(tA.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Tft(e){e._framebuffer.destroy()}function Sft(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new sc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new je},o.viewport=new je,e._passState=o}tA.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&Sft(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};tA.prototype.isDestroyed=function(){return!1};tA.prototype.destroy=function(){return Tft(this),he(this)};var nA=tA;var kOi=_(T(),1);function hL(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new je},t.viewport=new je,this._context=e,this._fb=new hi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}hL.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return je.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};var iA=new Y;hL.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),l=Math.floor(n*.5),d=0,u=0,f=0,p=-1;for(let y=0;y<s;++y){if(-a<=d&&d<=a&&-l<=u&&u<=l){let h=4*((l-u)*t+d+a);iA.red=Y.byteToFloat(o[h]),iA.green=Y.byteToFloat(o[h+1]),iA.blue=Y.byteToFloat(o[h+2]),iA.alpha=Y.byteToFloat(o[h+3]);let g=i.getObjectByPickColor(iA);if(c(g))return g}if(d===u||d<0&&-d===u||d>0&&d===1-u){let h=f;f=-p,p=h}d+=f,u+=p}};hL.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)};hL.prototype.isDestroyed=function(){return!1};hL.prototype.destroy=function(){return this._fb.destroy(),he(this)};var oA=hL;var zOi=_(T(),1);function y0(){this._numSamples=1,this._colorFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new hi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new Y(0,0,0,0),this._clearCommand=new ti({color:new Y(0,0,0,0),depth:1,owner:this})}function Cft(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(y0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});y0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};y0.prototype.clear=function(e,t,n){Y.clone(n,this._clearCommand.color),Y.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};y0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};y0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};y0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};y0.prototype.isDestroyed=function(){return!1};y0.prototype.destroy=function(){return Cft(this),he(this)};var BT=y0;var YDi=_(T(),1);var jOi=_(T(),1);function YT(){}YT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};YT.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=Be.findPositionVarying(e),s=c(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=Be.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; 
void main() 
{ 
    czm_shadow_cast_main(); 
    v_positionEC = (czm_inverseProjection * gl_Position).xyz; 
}`)}return new Be({defines:i,sources:o})};YT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=Be.findPositionVarying(e),a=c(s);a||(s="v_positionEC");let l=r.length;for(let u=0;u<l;++u)r[u]=Be.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC; 
`),d+=`uniform vec4 shadowMap_lightPositionEC; 
`),i?d+=`void main() 
{ 
`:d+=`void main() 
{ 
    czm_shadow_cast_main(); 
    if (out_FragColor.a == 0.0) 
    { 
       discard; 
    } 
`,t?d+=`    float distance = length(${s}); 
    if (distance >= shadowMap_lightPositionEC.w) 
    { 
        discard; 
    } 
    distance /= shadowMap_lightPositionEC.w; // radius 
    out_FragColor = czm_packDepth(distance); 
`:n?d+=`    out_FragColor = vec4(1.0); 
`:d+=`    out_FragColor = czm_packDepth(gl_FragCoord.z); 
`,d+=`} 
`,r.push(d),new Be({defines:o,sources:r})};YT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,l=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${l}${d}${u}${t}${n}${i}`};YT.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 Be({defines:i,sources:o})};YT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Be.findNormalVarying(e),s=!i&&c(r)||i&&o,a=Be.findPositionVarying(e),l=c(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,f=t._isPointLight,p=t._isSpotLight,y=t._numberOfCascades>1,h=t.debugCascadeColors,g=t.softShadows,x=f?t._pointBias:i?t._terrainBias:t._primitiveBias,S=e.defines.slice(0),V=e.sources.slice(0),Z=V.length;for(let I=0;I<Z;++I)V[I]=Be.replaceMain(V[I],"czm_shadow_receive_main");f?S.push("USE_CUBE_MAP_SHADOW"):d&&S.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!f&&S.push("USE_SOFT_SHADOWS"),y&&n&&i&&(s?S.push("ENABLE_VERTEX_LIGHTING"):S.push("ENABLE_DAYNIGHT_SHADING")),n&&x.normalShading&&s&&(S.push("USE_NORMAL_SHADING"),x.normalShadingSmooth>0&&S.push("USE_NORMAL_SHADING_SMOOTH"));let R="";f?R+=`uniform samplerCube shadowMap_textureCube; 
`:R+=`uniform sampler2D shadowMap_texture; 
`;let E;return l?E=`    return vec4(${a}, 1.0); 
`:E=`#ifndef LOG_DEPTH 
    return czm_windowToEyeCoordinates(gl_FragCoord); 
#else 
    return vec4(v_logPositionEC, 1.0); 
#endif 
`,R+=`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() 
{ 
${E}} 
vec3 getNormalEC() 
{ 
${s?`    return normalize(${r}); 
`:`    return vec3(1.0); 
`}} 
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) 
{ 
${x.normalOffset&&s?`    float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; 
    float normalOffsetScale = 1.0 - nDotL; 
    vec3 offset = normalOffset * normalOffsetScale * normalEC; 
    positionEC.xyz += offset; 
`:""}} 
`,R+=`void main() 
{ 
    czm_shadow_receive_main(); 
    vec4 positionEC = getPositionEC(); 
    vec3 normalEC = getNormalEC(); 
    float depth = -positionEC.z; 
`,R+=`    czm_shadowParameters shadowParameters; 
    shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; 
    shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; 
    shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; 
    shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; 
`,i?R+=`    shadowParameters.depthBias *= max(depth * 0.01, 1.0); 
`:u||(R+=`    shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); 
`),f?R+=`    vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; 
    float distance = length(directionEC); 
    directionEC = normalize(directionEC); 
    float radius = shadowMap_lightPositionEC.w; 
    // Stop early if the fragment is beyond the point light radius 
    if (distance > radius) 
    { 
        return; 
    } 
    vec3 directionWC  = czm_inverseViewRotation * directionEC; 
    shadowParameters.depth = distance / radius; 
    shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); 
    shadowParameters.texCoords = directionWC; 
    float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); 
`:p?R+=`    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); 
`:y?R+=`    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); 
${h?`    // Draw cascade colors for debugging 
    out_FragColor *= czm_cascadeColor(weights); 
`:""}`:R+=`    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); 
`,R+=`    out_FragColor.rgb *= visibility; 
} 
`,V.push(R),new Be({defines:S,sources:V})};var cp=YT;function lp(e){e=e??z.EMPTY_OBJECT;let t=e.context;if(!c(t))throw new L("context is required.");if(!c(e.lightCamera))throw new L("lightCamera is required.");if(c(e.numberOfCascades)&&e.numberOfCascades!==1&&e.numberOfCascades!==4)throw new L("Only one or four cascades are supported.");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;(Ot.isInternetExplorer()||Ot.isEdge()||(Ot.isChrome()||Ot.isFirefox())&&Ot.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 m,this._lightPositionEC=new ce,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new ZD,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ue,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new D,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Oo:c(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ce,new ce],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new ce;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new Vft(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,B4(this),this._clearCommand=new ti({depth:1,color:new Y}),this._clearPassState=new sc(t),this._size=e.size??2048,this.size=this._size}lp.MAXIMUM_DISTANCE=2e4;function Vft(e){this.camera=new ZD,this.passState=new sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function D4(e,t){return Oe.fromCache({cull:{enabled:!0,face:_i.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 B4(e){let t=!e._usesDepthTexture;e._primitiveRenderState=D4(t,e._primitiveBias),e._terrainRenderState=D4(t,e._terrainBias),e._pointRenderState=D4(t,e._pointBias)}lp.prototype.debugCreateRenderStates=function(){B4(this)};Object.defineProperties(lp.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){Xft(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 Y4(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;c(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Lft(e,t){let n=new md({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ac.DEPTH_COMPONENT16}),i=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:en.NEAREST}),o=new Fr({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 Zft(e,t){let n=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:en.NEAREST}),i=new Fr({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 Rft(e,t){let n=new md({context:t,width:e._textureSize.x,height:e._textureSize.y,format:ac.DEPTH_COMPONENT16}),i=new Uo({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:en.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Fr({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 Hxe(e,t){e._isPointLight?Rft(e,t):e._usesDepthTexture?Zft(e,t):Lft(e,t)}function Gft(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==oe.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,B4(e),Y4(e),Hxe(e,t))}function Eft(e,t){(!c(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Y4(e),Hxe(e,t),Gft(e,t),zxe(e,t))}function zxe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Xft(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=mt.maximumCubeMapSize>=t?t:mt.maximumCubeMapSize,o.x=t,o.y=t;let r=new je(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=mt.maximumTextureSize>=t?t:mt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new je(0,0,t,t)):i===4&&(t=mt.maximumTextureSize>=t*2?t:mt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new je(0,0,t,t),n[1].passState.viewport=new je(t,0,t,t),n[2].passState.viewport=new je(0,t,t,t),n[3].passState.viewport=new je(t,t,t,t));e._clearPassState.viewport=new je(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,l=a.x/o.x,d=a.y/o.y,u=a.width/o.x,f=a.height/o.y;s.textureOffsets=new M(u,0,0,l,0,f,0,d,0,0,1,0,0,0,0,1)}}var Ift=new je;function Wft(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=Xe.OVERLAY,i}function wft(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Ift;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;c(a)||(a=Wft(e,n),e._debugShadowViewCommand=a),(!c(a.renderState)||!je.equals(a.renderState.viewport,s))&&(a.renderState=Oe.fromCache({viewport:je.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var dp=new Array(8);dp[0]=new ce(-1,-1,-1,1);dp[1]=new ce(1,-1,-1,1);dp[2]=new ce(1,1,-1,1);dp[3]=new ce(-1,1,-1,1);dp[4]=new ce(-1,-1,1,1);dp[5]=new ce(1,-1,1,1);dp[6]=new ce(1,1,1,1);dp[7]=new ce(-1,1,1,1);var wg=new M,H4=new Array(8);for(let e=0;e<8;++e)H4[e]=new ce;function Pft(e,t){let n=new Rt({geometry:new Fm({minimum:new m(-.5,-.5,-.5),maximum:new m(.5,.5,.5)}),attributes:{color:Yt.fromColor(t)}}),i=new Rt({geometry:new Ib({radius:.5}),attributes:{color:Yt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new an({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var vft=[Y.RED,Y.GREEN,Y.BLUE,Y.MAGENTA],Fft=new m;function Aft(e,t){wft(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 op({camera:e._sceneCamera,color:Y.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new op({camera:e._shadowMapCamera,color:Y.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 op({camera:e._passes[i].camera,color:vft[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!c(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Fe.IDENTITY,r=e._pointLightRadius*2,s=m.fromElements(r,r,r,Fft),a=M.fromTranslationQuaternionRotationScale(i,o,s,wg);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Pft(a,Y.YELLOW)}e._debugLightFrustum.update(t)}else(!c(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new op({camera:e._shadowMapCamera,color:Y.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function ZD(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new pe,this.positionWC=new m,this.directionWC=m.clone(m.UNIT_Z),this.upWC=m.clone(m.UNIT_Y),this.rightWC=m.clone(m.UNIT_X),this.viewProjectionMatrix=new M}ZD.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),pe.clone(e.positionCartographic,this.positionCartographic),m.clone(e.positionWC,this.positionWC),m.clone(e.directionWC,this.directionWC),m.clone(e.upWC,this.upWC),m.clone(e.rightWC,this.rightWC)};var Mft=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);ZD.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(Mft,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Nft=new Array(5),kft=new Ci,Uft=new Array(4),Kxe=new m,Jxe=new m;function Oft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,l=r-o,d=r/o,u=.9,f=!1;t.shadowState.closestObjectSize<200&&(f=!0,u=.9);let p=Uft,y=Nft;for(y[0]=o,y[s]=r,a=0;a<s;++a){let N=(a+1)/s,b=o*Math.pow(d,N),G=o+l*N,X=w.lerp(G,b,u);y[a+1]=X,p[a]=X-y[a]}if(f){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=y[0];for(a=0;a<s-1;++a)N+=p[a],y[a+1]=N}ce.unpack(y,0,e._cascadeSplits[0]),ce.unpack(y,1,e._cascadeSplits[1]),ce.unpack(p,0,e._cascadeDistances);let h=n.frustum,g=h.left,x=h.right,S=h.bottom,V=h.top,Z=h.near,R=h.far,E=n.positionWC,I=n.directionWC,v=n.upWC,P=i.frustum.clone(kft),F=n.getViewProjection();for(a=0;a<s;++a){P.near=y[a],P.far=y[a+1];let N=M.multiply(P.projectionMatrix,i.viewMatrix,wg),b=M.inverse(N,wg),G=M.multiply(F,b,wg),X=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Kxe),W=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Jxe);for(let H=0;H<8;++H){let U=ce.clone(dp[H],H4[H]);M.multiplyByVector(G,U,U),m.divideByScalar(U,U.w,U),m.minimumByComponent(U,X,X),m.maximumByComponent(U,W,W)}X.x=Math.max(X.x,0),X.y=Math.max(X.y,0),X.z=0,W.x=Math.min(W.x,1),W.y=Math.min(W.y,1),W.z=Math.min(W.z,1);let A=e._passes[a],k=A.camera;k.clone(n);let B=k.frustum;B.left=g+X.x*(x-g),B.right=g+W.x*(x-g),B.bottom=S+X.y*(V-S),B.top=S+W.y*(V-S),B.near=Z+X.z*(R-Z),B.far=Z+W.z*(R-Z),A.cullingVolume=k.frustum.computeCullingVolume(E,I,v);let O=e._cascadeMatrices[a];M.multiply(k.getViewProjection(),i.inverseViewMatrix,O),M.multiply(A.textureOffsets,O,O)}}var Dft=new M,Bft=new m,Yft=new m,Bxe=new m;function Hft(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,wg),r=M.inverse(o,wg),s=n.directionWC,a=i.directionWC;m.equalsEpsilon(s,a,w.EPSILON10)&&(a=i.upWC);let l=m.cross(s,a,Bft);a=m.cross(l,s,Yft),m.normalize(a,a),m.normalize(l,l);let d=m.fromElements(0,0,0,Bxe),u=M.computeView(d,s,a,l,Dft),f=M.multiply(u,r,wg),p=m.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Kxe),y=m.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Jxe);for(let R=0;R<8;++R){let E=ce.clone(dp[R],H4[R]);M.multiplyByVector(f,E,E),m.divideByScalar(E,E.w,E),m.minimumByComponent(E,p,p),m.maximumByComponent(E,y,y)}y.z+=1e3,p.z-=10;let h=Bxe;h.x=-(.5*(p.x+y.x)),h.y=-(.5*(p.y+y.y)),h.z=-y.z;let g=M.fromTranslation(h,wg);u=M.multiply(g,u,u);let x=.5*(y.x-p.x),S=.5*(y.y-p.y),V=y.z-p.z,Z=n.frustum;Z.left=-x,Z.right=x,Z.bottom=-S,Z.top=S,Z.near=.01,Z.far=V,M.clone(u,n.viewMatrix),M.inverse(u,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),m.clone(s,n.directionWC),m.clone(a,n.upWC),m.clone(l,n.rightWC)}var zft=[new m(-1,0,0),new m(0,-1,0),new m(0,0,-1),new m(1,0,0),new m(0,1,0),new m(0,0,1)],Kft=[new m(0,-1,0),new m(0,0,-1),new m(0,-1,0),new m(0,-1,0),new m(0,0,1),new m(0,-1,0)],Jft=[new m(0,0,1),new m(1,0,0),new m(-1,0,0),new m(0,0,-1),new m(1,0,0),new m(1,0,0)];function Qft(e,t){let n=new Ci;n.fov=w.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=zft[i],o.upWC=Kft[i],o.rightWC=Jft[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var jft=new m,qft=new m,Qxe=new ue,Yxe=Qxe.center;function $ft(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Qxe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,jft),s=m.negate(i.directionWC,qft),a=m.dot(r,s);if(e.fadingEnabled){let l=w.clamp(a/.1,0,1);e._darkness=w.lerp(1,e.darkness,l)}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)===zt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ue.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=m.add(i.positionWC,m.multiplyByScalar(i.directionWC,r,Yxe),Yxe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===zt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ue.clone(o,e._boundingSphere)}}function eht(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?m.clone(i.directionWC,r.directionWC):e._isPointLight?m.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),m.normalize(s,s),m.negate(s,s),M.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,l;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),l=Math.min(t.shadowState.farPlane,e.maximumDistance),l=Math.max(l,a+1)):(a=n.frustum.near,l=e.maximumDistance),e._sceneCamera=oo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=l,e._distance=l-a,$ft(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}lp.prototype.update=function(e){if(eht(this,e),this._needsUpdate)if(Eft(this,e.context),this._isPointLight&&Qft(this,e),this._cascadesEnabled&&(Hft(this,e),this._numberOfCascades>1&&Oft(this,e)),this._isPointLight)this._shadowMapCullingVolume=fs.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&&Aft(this,e)};lp.prototype.updatePass=function(e,t){zxe(this,e,t)};var tht=new D;function jxe(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=tht;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ce.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ce.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ce,combinedUniforms2:new ce};return St(t,o,!1)}function nht(e,t,n,i,o,r){let s,a,l;if(c(r)&&(s=r.shaderProgram,a=r.renderState,l=r.uniformMap),r=et.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!c(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Xe.GLOBE,f=n.pass!==Xe.TRANSLUCENT,p=e._isPointLight,y=e._usesDepthTexture,h=cp.getShadowCastShaderKeyword(p,u,y,f);if(s=i.shaderCache.getDerivedShaderProgram(d,h),!c(s)){let x=d.vertexShaderSource,S=d.fragmentShaderSource,V=cp.createShadowCastVertexShader(x,p,u),Z=cp.createShadowCastFragmentShader(S,p,y,f);s=i.shaderCache.createDerivedShaderProgram(d,h,{vertexShaderSource:V,fragmentShaderSource:Z,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=He(a,!1),a.cull=He(a.cull,!1),a.cull.enabled=!1,a=Oe.fromCache(a)),l=jxe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=l,r}lp.createReceiveDerivedCommand=function(e,t,n,i,o){c(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,l=s.fragmentShaderSource,d=t.pass===Xe.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let f,p;c(o.receiveCommand)&&(f=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=et.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let y=o.receiveShaderCastShadows!==t.castShadows,h=o.receiveShaderProgramId!==t.shaderProgram.id;if(!c(f)||h||n||y){let g=cp.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(f=i.shaderCache.getDerivedShaderProgram(s,g),!c(f)){let x=cp.createShadowReceiveVertexShader(a,d,u),S=cp.createShadowReceiveFragmentShader(l,e[0],t.castShadows,d,u);f=i.shaderCache.createDerivedShaderProgram(s,g,{vertexShaderSource:x,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}p=jxe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=f,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};lp.createCastDerivedCommand=function(e,t,n,i,o){if(c(o)||(o={}),t.castShadows){let r=o.castCommands;c(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let l=0;l<a;++l)r[l]=nht(e[l],n,t,i,s,r[l]);o.castShaderProgramId=t.shaderProgram.id}return o};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){Y4(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 he(this)};var g0=lp;var hBi=_(T(),1);var zDi=_(T(),1),HT=`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
color.rgb /= color.a;
#endif
out_FragColor = color;
#endif
}
`;var iht=!1;function Pg(e){this._drawClassificationFBO=new hi({createDepthAttachments:!1}),this._accumulationFBO=new hi({createDepthAttachments:!1}),this._packFBO=new hi,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 ti({color:new Y(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ti({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new je,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(Pg.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function qxe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function $xe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function oht(e,t,n,i){qxe(e),e._translucentDepthStencilTexture=new Pt({context:t,width:n,height:i,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:en.NEAREST})}function rht(e,t,n,i){$xe(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 sht(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)&&(oht(e,t,o,r),rht(e,t,o,r));let s,a;if(c(e._packDepthCommand)||(s=new Be({sources:[Pv]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!c(e._compositeCommand)){s=new Be({sources:[HT]}),a={colorTexture:function(){return e._textureToComposite}},iht&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,f=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(f,"pick",{vertexShaderSource:f.vertexShaderSource,fragmentShaderSource:new Be({sources:s.sources,defines:["PICK"]}),attributeLocations:f._attributeLocations}),y=et.shallowClone(u);y.shaderProgram=p,u.derivedCommands.pick=y}c(e._copyCommand)||(s=new Be({sources:[HT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),c(e._accumulateCommand)||(s=new Be({sources:[HT]}),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 l=!je.equals(e._viewport,n.viewport),d=l!==e._useScissorTest;e._useScissorTest=l,je.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=je.clone(n.viewport,e._scissorRectangle),d=!0),(!c(e._rsDepth)||!je.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!c(e._rsAccumulate)||!je.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:On.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),c(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!c(e._rsComp)||!je.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Oe.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),c(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Pg.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let l=0;l<i.length;++l){let d=i[l];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){sht(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let l=0;l<i.length;++l){let d=i[l];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Pg.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(Xe.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let l=i.commands[Xe.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Xe.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(l[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Pg.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),aht(this,e,t)};function aht(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}Pg.prototype.isSupported=function(){return this._supported};Pg.prototype.isDestroyed=function(){return!1};Pg.prototype.destroy=function(){return qxe(this),$xe(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),he(this)};var rA=Pg;function cht(){this.command=void 0,this.near=void 0,this.far=void 0}function RD(e,t,n){let i=e.context,o;i.depthTexture&&(o=new qF);let r;e._useOIT&&i.depthTexture&&(r=new eA(i));let s=new sc(i);s.viewport=je.clone(n),this.camera=t,this._cameraClone=oo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new oA(i),this.pickDepthFramebuffer=new nA,this.sceneFramebuffer=new BT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new $F,this.oit=r,this.translucentTileClassification=new rA(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var z4=new m,K4=new m;function lht(e,t,n){let i=Math.max(m.maximumComponent(m.abs(e.position,z4)),m.maximumComponent(m.abs(t.position,K4))),o=1/Math.max(1,i);return m.multiplyByScalar(e.position,o,z4),m.multiplyByScalar(t.position,o,K4),m.equalsEpsilon(z4,K4,n)&&m.equalsEpsilon(e.direction,t.direction,n)&&m.equalsEpsilon(e.up,t.up,n)&&m.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}RD.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return lht(t,n,w.EPSILON15)?(this._cameraStartFired&&Ti()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ti(),oo.clone(t,n),!0)};function dht(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===se.SCENE2D,d=t.nearToFarDistance2D;i*=1+w.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;l?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:f}=e;f.length=u;for(let p=0;p<u;++p){let y,h;l?(y=Math.min(i-d,n+p*d),h=Math.min(i,y+d)):(y=Math.max(n,Math.pow(a,p)*n),h=Math.min(i,a*y));let g=f[p];c(g)?(g.near=y,g.far=h):g=f[p]=new jF(y,h)}}function uht(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 l=s[a];if(o>l.far)continue;if(r<l.near)break;let d=i.pass,u=l.indices[d]++;if(l.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:l}=i,d=a.commandsInFrustums;d[l]=c(d[l])?d[l]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var e_e=new fs,mht=new Ia;RD.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,l=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let F=0;F<u.length;++F)for(let N=0;N<Xe.NUMBER_OF_PASSES;++N)u[F].indices[N]=0;l.length=0,d.length=0;let f=this._commandExtents,p=f.length,y=0,h=+Number.MAX_VALUE,g=-Number.MAX_VALUE,{shadowsEnabled:x}=o,S=+Number.MAX_VALUE,V=-Number.MAX_VALUE,Z=Number.MAX_VALUE,R=t.mode===se.SCENE3D?t.occluder:void 0,{cullingVolume:E}=t,I=e_e.planes;for(let F=0;F<5;++F)I[F]=E.planes[F];E=e_e;for(let F=0;F<i.length;++F){let N=i[F],{pass:b,boundingVolume:G}=N;if(b===Xe.COMPUTE)l.push(N);else if(b===Xe.OVERLAY)d.push(N);else{let X,W;if(c(G)){if(!e.isVisible(E,N,R))continue;let k=G.computePlaneDistances(r,s,mht);if(X=k.start,W=k.stop,h=Math.min(h,X),g=Math.max(g,W),x&&N.receiveShadows&&X<g0.MAXIMUM_DISTANCE&&!(b===Xe.GLOBE&&X<-100&&W>100)){let B=W-X;b!==Xe.GLOBE&&X<100&&(Z=Math.min(Z,B)),S=Math.min(S,X),V=Math.max(V,W)}}else N instanceof ti?(X=a.near,W=a.far):(X=a.near,W=a.far,h=Math.min(h,X),g=Math.max(g,W));let A=f[y];c(A)||(A=f[y]=new cht),A.command=N,A.near=X,A.far=W,y++}}x&&(S=Math.min(Math.max(S,a.near),a.far),V=Math.max(Math.min(V,a.far),S),o.nearPlane=S,o.farPlane=V,o.closestObjectSize=Z),dht(this,e,h,g);for(let F=0;F<y;F++)uht(this,e,f[F]);if(y<p)for(let F=y;F<p;F++){let N=f[F];if(!c(N.command))break;N.command=void 0}let v=u.length,{frustumSplits:P}=t;P.length=v+1;for(let F=0;F<v;++F)P[F]=u[F].near,F===v-1&&(P[F+1]=u[F].far)};RD.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.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 zT=RD;var n_e=.1,fht=new hm({pass:Fo.MOST_DETAILED_PRELOAD}),hht=new hm({pass:Fo.MOST_DETAILED_PICK}),sA=new hm({pass:Fo.PICK});function na(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new je(0,0,1,1),n=new oo(e);n.frustum=new sn({width:n_e,aspectRatio:1,near:.1}),this._pickOffscreenView=new zT(e,n,t)}na.prototype.update=function(){this._pickPositionCacheDirty=!0};na.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return c(i)||(i=new QF,n[t]=i),i};var pht=new Oo,bht=new m,GD=new m,yht=new D,ght=new M;function xht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2*(t.x-o.x)/o.width-1;l*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=M.clone(r.transform,ght);r._setTransform(M.IDENTITY);let f=m.clone(r.position,bht);m.multiplyByScalar(r.right,l,GD),m.add(GD,f,f),m.multiplyByScalar(r.up,d,GD),m.add(GD,f,f),r._setTransform(u),e.mode===se.SCENE2D&&m.fromElements(f.z,f.x,f.y,f);let p=s.getPixelDimensions(o.width,o.height,1,1,yht),y=pht;return y.right=p.x*.5,y.left=-y.right,y.top=p.y*.5,y.bottom=-y.top,y.near=s.near,y.far=s.far,y.computeCullingVolume(f,r.directionWC,r.upWC)}var _ht=new hl,Tht=new D;function Sht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,l=Math.tan(s.fovy*.5),d=s.aspectRatio*l,u=2*(t.x-o.x)/o.width-1,f=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,y=f*a*l,h=s.getPixelDimensions(o.width,o.height,1,1,Tht),g=h.x*n*.5,x=h.y*i*.5,S=_ht;return S.top=y+x,S.bottom=y-x,S.right=p+g,S.left=p-g,S.near=a,S.far=s.far,S.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function ED(e,t,n,i,o){let r=e.camera.frustum;return r instanceof sn||r instanceof Oo?xht(e,t,n,i,o):Sht(e,t,n,i,o)}var XD=new je(0,0,3,3),ID=new D,aA=new Y(0,0,0,0);function J4(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}na.prototype.pick=function(e,t,n,i){C.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=je.clone(a,d.viewport);let u=Oi.transformWindowToDrawingBuffer(e,t,ID),f=J4(o.drawingBufferHeight,u,n,i,XD);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=ED(e,u,f.width,f.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=sA,o.uniformState.update(r),e.updateEnvironment(),d=l.begin(f,a),e.updateAndExecuteCommands(d,aA),e.resolveFramebuffers(d);let p=l.end(f);return o.endFrame(),p};na.prototype.pickVoxelCoordinate=function(e,t,n,i){C.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=je.clone(a,d.viewport);let u=Oi.transformWindowToDrawingBuffer(e,t,ID),f=J4(o.drawingBufferHeight,u,n,i,XD);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=ED(e,u,f.width,f.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=sA,o.uniformState.update(r),e.updateEnvironment(),d=l.begin(f,a),e.updateAndExecuteCommands(d,aA),e.resolveFramebuffers(d);let p=l.readCenterPixel(f);return o.endFrame(),p};na.prototype.pickMetadata=function(e,t,n){C.typeOf.object("windowPosition",t),C.typeOf.object("pickedMetadataInfo",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 l=r.passState;l.viewport=je.clone(s,l.viewport);let d=Oi.transformWindowToDrawingBuffer(e,t,ID),u=J4(i.drawingBufferHeight,d,1,1,XD);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=ED(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=sA,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),l=a.begin(u,s),e.updateAndExecuteCommands(l,aA);let f=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(l),e._environmentState.useOIT=f;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,JF.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function Cht(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 l=n.passState;l.viewport=je.clone(s,l.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=ED(e,t,1,1,s),o.tilesetPassState=sA,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,l=a.update(i,t,s),e.updateAndExecuteCommands(l,aA),e.resolveFramebuffers(l),i.endFrame()}var Vht=new Ci,Lht=new hl,Zht=new sn,Rht=new Oo;na.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;if(C.defined("windowPosition",t),!e.context.depthTexture)throw new L("Picking from the depth buffer is not supported. Check pickPositionSupported.");let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return m.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:l}=o;e.view=a;let d=Oi.transformWindowToDrawingBuffer(e,t,ID);e.pickTranslucentDepth?Cht(e,d):(e.updateFrameState(),l.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;c(s.frustum.fov)?u=s.frustum.clone(Vht):c(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(Lht):c(s.frustum.width)?u=s.frustum.clone(Zht):u=s.frustum.clone(Rht);let{frustumCommandsList:f}=a,p=f.length;for(let y=0;y<p;++y){let g=this.getPickDepth(e,y).getDepth(o,d.x,d.y);if(c(g)&&g>0&&g<1){let x=f[y],S;return e.mode===se.SCENE2D?(S=s.position.z,s.position.z=S-x.near+1,u.far=Math.max(1,x.far-x.near),u.near=1,l.update(r),l.updateFrustum(u)):(u.near=x.near*(y!==0?e.opaqueFrustumNearOffset:1),u.far=x.far,l.updateFrustum(u)),n=Oi.drawingBufferToWorldCoordinates(e,d,g,n),e.mode===se.SCENE2D&&(s.position.z=S,l.update(r)),this._pickPositionCache[i]=m.clone(n),n}}this._pickPositionCache[i]=void 0};var Ght=new pe;na.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),c(n)&&e.mode!==se.SCENE3D){m.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Ght);o.cartographicToCartesian(r,n)}return n};function i_e(e,t){let n,i,o=[],r=[],s=[],a=[];c(e)||(e=Number.MAX_VALUE);let l=t();for(;c(l);){let d=l.object,u=l.position,f=l.exclude;if(c(u)&&!c(d)){o.push(l);break}if(!c(d)||!c(d.primitive)||!f&&(o.push(l),0>=--e))break;let p=d.primitive,y=!1;typeof p.getGeometryInstanceAttributes=="function"&&c(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),c(i)&&c(i.show)&&(y=!0,i.show=Tn.toValue(!1,i.show),s.push(i))),d instanceof Us&&(y=!0,d.show=!1,a.push(d)),y||(p.show=!1,r.push(p)),l=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=Tn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}na.prototype.drillPick=function(e,t,n,i,o){let r=this;return i_e(n,function(){let l=r.pick(e,t,i,o);if(c(l))return{object:l,position:void 0,exclude:!1}}).map(function(l){return l.object})};var t_e=new m,Eht=new m;function Xht(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 o_e(e,t,n,i){let o=t.direction,r=m.mostOrthogonalAxis(o,t_e),s=m.cross(o,r,t_e),a=m.cross(o,s,Eht);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??n_e,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Iht(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,l=o_e(e,o,r,a),d=fht;d.camera=a,d.cullingVolume=l;let u=!0,f=s.length;for(let p=0;p<f;++p){let y=s[p];y.show&&t.primitives.contains(y)&&(y.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}na.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Iht(this,e,t[n])&&t.splice(n--,1)};function r_e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(c(o.isCesium3DTileset)?(!c(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof al&&r_e(o,t,n))}}function WD(e,t,n,i,o,r){let s=[];if(r_e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Xht(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Wht(e,t){return!c(e)||!c(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function wht(e,t,n,i,o,r,s){let{context:a,frameState:l}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,o_e(e,n,o,u.camera);let f=je.clone(u.viewport,XD),p=u.pickFramebuffer.begin(f,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=hht:l.tilesetPassState=sA,d.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(p,aA),t.resolveFramebuffers(p);let y,h=u.pickFramebuffer.end(f);if(t.context.depthTexture){let{frustumCommandsList:g}=u,x=g.length;for(let S=0;S<x;++S){let Z=e.getPickDepth(t,S).getDepth(a,0,0);if(c(Z)&&Z>0&&Z<1){let R=g[S],E=R.near*(S!==0?t.opaqueFrustumNearOffset:1),I=R.far,v=E+Z*(I-E);y=bn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),c(h)||c(y))return{object:h,position:y,exclude:!c(y)&&r||Wht(h,i)}}function s_e(e,t,n,i,o,r,s,a){return i_e(i,function(){return wht(e,t,n,o,r,s,a)})}function pL(e,t,n,i,o,r,s){let a=s_e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function a_e(e,t,n,i,o,r,s,a){return s_e(e,t,n,i,o,r,s,a)}function wD(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)})})}na.prototype.pickFromRay=function(e,t,n,i){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");return pL(this,e,t,n,i,!1,!1)};na.prototype.drillPickFromRay=function(e,t,n,i,o){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");return a_e(this,e,t,n,i,o,!1,!1)};na.prototype.pickFromRayMostDetailed=function(e,t,n,i){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");let o=this;return t=bn.clone(t),n=c(n)?n.slice():n,wD(e,WD(o,e,t,n,i,function(){return pL(o,e,t,n,i,!1,!0)}))};na.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){if(C.defined("ray",t),e.mode!==se.SCENE3D)throw new L("Ray intersections are only supported in 3D mode.");let r=this;return t=bn.clone(t),i=c(i)?i.slice():i,wD(e,WD(r,e,t,i,o,function(){return a_e(r,e,t,n,i,o,!1,!0)}))};var Pht=new m,vht=new m,Fht=new bn,c_e=new pe;function Q4(e,t){let n=e.ellipsoid,i=ui._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,vht),r=pe.toCartesian(t,n,Pht),s=Fht;s.origin=r,s.direction=o;let a=new bn;return bn.getPoint(s,i,a.origin),m.negate(o,a.direction),a}function l_e(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,c_e);return Q4(e,i)}function d_e(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,c_e).height}function Aht(e,t,n,i,o){let r=Q4(t,n);return WD(e,t,r,i,o,function(){let s=pL(e,t,r,i,o,!0,!0);if(c(s))return d_e(t,s.position)})}function Mht(e,t,n,i,o,r){let s=l_e(t,n);return WD(e,t,s,i,o,function(){let a=pL(e,t,s,i,o,!0,!0);if(c(a))return m.clone(a.position,r)})}na.prototype.sampleHeight=function(e,t,n,i){if(C.defined("position",t),e.mode!==se.SCENE3D)throw new L("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new L("sampleHeight requires depth texture support. Check sampleHeightSupported.");let o=Q4(e,t),r=pL(this,e,o,n,i,!0,!1);if(c(r))return d_e(e,r.position)};na.prototype.clampToHeight=function(e,t,n,i,o){if(C.defined("cartesian",t),e.mode!==se.SCENE3D)throw new L("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new L("clampToHeight requires depth texture support. Check clampToHeightSupported.");let r=l_e(e,t),s=pL(this,e,r,n,i,!0,!1);if(c(s))return m.clone(s.position,o)};na.prototype.sampleHeightMostDetailed=function(e,t,n,i){if(C.defined("positions",t),e.mode!==se.SCENE3D)throw new L("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new L("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Aht(this,e,t[s],n,i);return wD(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l].height=s[l];return t}))};na.prototype.clampToHeightMostDetailed=function(e,t,n,i){if(C.defined("cartesians",t),e.mode!==se.SCENE3D)throw new L("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new L("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Mht(this,e,t[s],n,i,t[s]);return wD(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l]=s[l];return t}))};na.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var cA=na;var UHi=_(T(),1);var hHi=_(T(),1);var h3i=_(T(),1),lA=`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 b3i=_(T(),1),dA=`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;
if (depth >= 1.0) {
posEC.z = czm_currentFrustum.y;
}
return posEC;
}
vec3 getNormalXEdge(vec3 positionEC)
{
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;
vec3 dx0 = positionEC - positionLeft;
vec3 dx1 = positionRight - positionEC;
vec3 dy0 = positionEC - positionDown;
vec3 dy1 = positionUp - positionEC;
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);
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);
float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
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);
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;
#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
vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);
if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
break;
}
vec4 samplePositionEC = pixelToEye(samplePixel);
vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;
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);
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 g3i=_(T(),1),uA=`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 _3i=_(T(),1),mA=`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 S3i=_(T(),1),fA=`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 V3i=_(T(),1),hA=`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 Z3i=_(T(),1),pA=`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 G3i=_(T(),1),bA=`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 X3i=_(T(),1),yA=`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 W3i=_(T(),1),gA=`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 P3i=_(T(),1),xA=`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
float exposure = texture(autoExposure, vec2(0.5)).r;
color /= exposure;
#else
color *= vec3(exposure);
#endif
const float A = 0.22;
const float B = 0.30;
const float C = 0.10;
const float D = 0.20;
const float E = 0.01;
const float F = 0.30;
const float white = 11.2;
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 F3i=_(T(),1),_A=`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 M3i=_(T(),1),TA=`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 k3i=_(T(),1),vg=`#define SAMPLES 8
uniform float delta;
uniform float sigma;
uniform float direction;
uniform sampler2D colorTexture;
#ifdef USE_STEP_SIZE
uniform float stepSize;
#else
uniform vec2 step;
#endif
in vec2 v_textureCoordinates;
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 O3i=_(T(),1),SA=`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;
#define DISTANCE_TO_SPACE 6500000.0
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);
}
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));
}
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;
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(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
{
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);
vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
vec3 direction = normalize(vec3(ghostVec, 0.0));
vec4 result = vec4(0.0);
vec4 ghost = vec4(0.0);
for (int i = 0; i < 4; ++i)
{
vec2 offset = fract(texcoord + ghostVec * float(i));
ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
}
result += ghost;
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;
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);
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 B3i=_(T(),1),CA=`uniform sampler2D colorTexture;
uniform vec3 white;
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
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 H3i=_(T(),1),VA=`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 K3i=_(T(),1),LA=`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
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 Q3i=_(T(),1),ZA=`uniform sampler2D colorTexture;
uniform sampler2D silhouetteTexture;
in vec2 v_textureCoordinates;
void main(void)
{
vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
vec4 color = texture(colorTexture, v_textureCoordinates);
out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
}
`;var rYi=_(T(),1);function KT(){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 hi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new D,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(KT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(c(e))return e[e.length-1].getColorTexture(0)}}});function u_e(e){let t=e._framebuffers;if(!c(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 Nht(e,t){u_e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let l=0;l<r;++l)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[l]=new hi,s[l].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 m_e(e){let t=e._commands;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function kht(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 Uht(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 Oht(e,t){m_e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Uht(r,i),{framebuffer:n[r].framebuffer,uniformMap:kht(e,r)});e._commands=o}KT.prototype.clear=function(e){let t=this._framebuffers;if(!c(t))return;let n=this._clearCommand;c(n)||(n=this._clearCommand=new ti({color:new Y(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};KT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Nht(this,e),Oht(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};KT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};KT.prototype.isDestroyed=function(){return!1};KT.prototype.destroy=function(){return u_e(this),m_e(this),he(this)};var RA=KT;var XYi=_(T(),1);var aYi=_(T(),1),Dht={NEAREST:0,LINEAR:1},qd=Dht;function JT(e){e=e??z.EMPTY_OBJECT;let{name:t=Hn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=qd.NEAREST,pixelFormat:a=ke.RGBA,pixelDatatype:l=Ue.UNSIGNED_BYTE,clearColor:d=Y.BLACK,scissorRectangle:u}=e;if(C.typeOf.string("options.fragmentShader",n),C.typeOf.number.greaterThan("options.textureScale",o,0),C.typeOf.number.lessThanOrEquals("options.textureScale",o,1),!ke.isColorFormat(a))throw new L("options.pixelFormat must be a color format.");this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=l,this._clearColor=d,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let f=new sc;f.scissorTest={enabled:!0,rectangle:c(u)?je.clone(u):new je},this._passState=f,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(JT.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(c(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(c(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 Bht=/uniform\s+sampler2D\s+depthTexture/g;JT.prototype._isSupported=function(e){return!Bht.test(this._fragmentShader)||e.depthTexture};function Yht(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];c(a)&&a!==r&&a instanceof Pt&&!c(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Pt&&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 Hht(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function zht(e,t){return function(){let n=e[t]();if(c(n))return n.dimensions}}function Kht(e){if(c(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]=Hht(e,r),n[r]=Yht(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Pt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=zht(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 Jht(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 Qht(e,t){if(c(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(c(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=Jht(n,o)}let i=new Be({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function jht(e){let t=e._sampleMode,n,i;t===qd.LINEAR?(n=Jt.LINEAR,i=di.LINEAR):(n=Jt.NEAREST,i=di.NEAREST);let o=e._sampler;(!c(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function qht(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function $ht(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function ept(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let l=n[a];l=l&&l.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:l,source:d}=i[a];e._actualUniforms[l]=new Pt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!c(e._texturePromise)){e._ready=!0;return}if(o.length===0||c(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let l=o[a],d=r[l],u=e._textureCache.getStageByName(d);if(c(u))e._actualUniforms[l]=$ht(e,d);else if(typeof d=="string"){let f=new Ge({url:d});s.push(f.fetchImage().then(qht(e,l)))}else e._texturesToCreate.push({name:l,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function f_e(e){c(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(!c(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 Pt&&(c(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function tpt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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 npt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!c(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];c(a.pickIds)?i+=a.pickIds.length:c(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:en.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(c(a.pickIds)){let l=a.pickIds,d=l.length;for(let u=0;u<d;++u){let f=l[u].color;r[o]=Y.floatToByte(f.red),r[o+1]=Y.floatToByte(f.green),r[o+2]=Y.floatToByte(f.blue),r[o+3]=Y.floatToByte(f.alpha),o+=4}}else if(c(a.pickId)){let l=a.pickId.color;r[o]=Y.floatToByte(l.red),r[o+1]=Y.floatToByte(l.green),r[o+2]=Y.floatToByte(l.blue),r[o+3]=Y.floatToByte(l.alpha),o+=4}}e._selectedIdTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:en.NEAREST})}JT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&f_e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=tpt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(this._parentSelected)?this._parentSelected.length:0,npt(this,e),Kht(this),ept(this,e),Qht(this,e),jht(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!c(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!c(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Oe.fromCache({viewport:new je(0,0,i.width,i.height)}))),this._command.renderState=o};JT.prototype.execute=function(e,t,n,i){if(!c(this._command)||!c(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,en.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;c(o)&&(o.context=e),this._command.execute(e,o)};JT.prototype.isDestroyed=function(){return!1};JT.prototype.destroy=function(){return f_e(this),he(this)};var mo=JT;var AYi=_(T(),1);function QT(e){e=e??z.EMPTY_OBJECT,C.defined("options.stages",e.stages),C.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;c(t)||(t=Hn()),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(QT.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}}});QT.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};QT.prototype.get=function(e){return C.typeOf.number.greaterThanOrEquals("index",e,0),C.typeOf.number.lessThan("index",e,this.length),this._stages[e]};function ipt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(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}QT.prototype.update=function(e,t){this._selectedDirty=ipt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(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)}};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return he(this)};var nd=QT;var Ir={};function j4(e){let o=`#define USE_STEP_SIZE
${vg}`,r=new mo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:qd.LINEAR}),s=new mo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:qd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(l){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=l}},sigma:{get:function(){return r.uniforms.sigma},set:function(l){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=l}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(l){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=l}}}),new nd({name:e,stages:[r,s],uniforms:a})}Ir.createBlurStage=function(){return j4("czm_blur")};Ir.createDepthOfFieldStage=function(){let e=j4("czm_depth_of_field_blur"),t=new mo({name:"czm_depth_of_field_composite",fragmentShader:bA,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 nd({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Ir.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Ir.createEdgeDetectionStage=function(){let e=Hn();return new mo({name:`czm_edge_detection_${e}`,fragmentShader:gA,uniforms:{length:.25,color:Y.clone(Y.BLACK)}})};Ir.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function opt(e){if(!c(e))return Ir.createEdgeDetectionStage();let t=new nd({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 mo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new nd({name:"czm_edge_detection_composite",stages:[t,s]})}Ir.createSilhouetteStage=function(e){let t=opt(e),n=new mo({name:"czm_silhouette_color_edges",fragmentShader:ZA,uniforms:{silhouetteTexture:t.name}});return new nd({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Ir.isSilhouetteSupported=function(e){return e.context.depthTexture};Ir.createBloomStage=function(){let e=new mo({name:"czm_bloom_contrast_bias",fragmentShader:pA,uniforms:{contrast:128,brightness:-.3}}),t=j4("czm_bloom_blur"),n=new nd({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new mo({name:"czm_bloom_generate_composite",fragmentShader:fA,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 nd({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Ir.createAmbientOcclusionStage=function(){let e=new mo({name:"czm_ambient_occlusion_generate",fragmentShader:dA,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new mo({name:"czm_ambient_occlusion_composite",fragmentShader:uA,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 nd({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Ir.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var rpt=`#define FXAA_QUALITY_PRESET 39 
${Mv}
${TA}`;Ir.createFXAAStage=function(){return new mo({name:"czm_FXAA",fragmentShader:rpt,sampleMode:qd.LINEAR})};Ir.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=lA,new mo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=xA,new mo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=_A,new mo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=LA,new mo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Ir.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=CA,new mo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:Y.WHITE,autoExposure:void 0,exposure:1}})};Ir.createAutoExposureStage=function(){return new RA};Ir.createBlackAndWhiteStage=function(){return new mo({name:"czm_black_and_white",fragmentShader:mA,uniforms:{gradations:5}})};Ir.createBrightnessStage=function(){return new mo({name:"czm_brightness",fragmentShader:hA,uniforms:{brightness:.5}})};Ir.createNightVisionStage=function(){return new mo({name:"czm_night_vision",fragmentShader:VA})};Ir.createDepthViewStage=function(){return new mo({name:"czm_depth_view",fragmentShader:yA})};Ir.createLensFlareStage=function(){return new mo({name:"czm_lens_flare",fragmentShader:SA,uniforms:{dirtTexture:on("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:on("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:re.WGS84.maximumRadius}})};var $d=Ir;var SHi=_(T(),1);function x0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function EA(e){for(;c(e.length);)e=e.get(e.length-1);return e.name}function q4(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(c(o)){let a=e.getStageByName(o);r[EA(a)]=!0}let s=i.uniforms;if(c(s)){let a=Object.getOwnPropertyNames(s),l=a.length;for(let d=0;d<l;++d){let u=s[a[d]];if(typeof u=="string"){let f=e.getStageByName(u);c(f)&&(r[EA(f)]=!0)}}}return i.name}function GA(e,t,n,i,o){if(c(i.enabled)&&!i.enabled||c(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!c(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,l=i.length;for(let f=0;f<l;++f){let p=i.get(f);c(p.length)?a=GA(e,t,n,p,o):a=q4(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<l;++d)u=EA(i.get(d)),c(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<l;++d){u=EA(i.get(d));let f=n[u];for(let p=0;p<d;++p)f[EA(i.get(p))]=!0}return a}function spt(e,t){let n={};if(c(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=GA(e,t,n,i,void 0);a=GA(e,t,n,o,a),a=q4(e,t,n,r,a),a=GA(e,t,n,e,a),q4(e,t,n,s,a)}else GA(e,t,n,e,void 0);return n}function apt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,l=o._pixelDatatype,d=o._clearColor,u,f,p=e._framebuffers,y=p.length;for(u=0;u<y;++u){if(f=p[u],r!==f.textureScale||s!==f.forcePowerOfTwo||a!==f.pixelFormat||l!==f.pixelDatatype||!Y.equals(d,f.clearColor))continue;let h=f.stages,g=h.length,x=!1;for(let S=0;S<g;++S)if(n[h[S]]){x=!0;break}if(!x)break}return c(f)&&u<y?(f.stages.push(t),f):(f={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:l,clearColor:d,stages:[t],buffer:new hi({pixelFormat:a,pixelDatatype:l}),clear:void 0},p.push(f),f)}function cpt(e,t){let n=spt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=apt(e,i,n[i]))}function $4(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function lpt(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],l=a.textureScale,d=Math.ceil(n*l),u=Math.ceil(i*l),f=Math.min(d,u);a.forcePowerOfTwo&&(w.isPowerOfTwo(f)||(f=w.nextPowerOfTwo(f)),d=f,u=f),a.buffer.update(t,d,u),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}x0.prototype.updateDependencies=function(){this._updateDependencies=!0};x0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=c(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=c(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=c(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=c(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!c(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&($4(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&cpt(this,e);let l=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==l||this._height!==d;!n&&!u||(this._width=l,this._height=d,this._updateDependencies=!1,$4(this),lpt(this,e))};x0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};x0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};x0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};x0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(c(t))return t.buffer.framebuffer};x0.prototype.isDestroyed=function(){return!1};x0.prototype.destroy=function(){return $4(this),he(this)};var jT=x0;var VHi=_(T(),1),bL={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};function h_e(e){return e===bL.REINHARD||e===bL.MODIFIED_REINHARD||e===bL.FILMIC||e===bL.ACES||e===bL.PBR_NEUTRAL}var _0=Object.freeze(bL);var e8=[];function pl(){let e=$d.createFXAAStage(),t=$d.createAmbientOcclusionStage(),n=$d.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=$d.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=_0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new jT(this),r={},s=e8;for(s.push(e,t,n,i);s.length>0;){let l=s.pop();r[l.name]=l,l._textureCache=o;let d=l.length;if(c(d))for(let u=0;u<d;++u)s.push(l.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(pl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let l=t[a];e=e||l.ready&&l.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 t8(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(c(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(!c(t))continue;if(c(t.selected))return!0;let n=t.length;if(c(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;if(!h_e(e))throw new L("tonemapper was set to an invalid value.");c(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case _0.REINHARD:n=$d.createReinhardTonemappingStage(t);break;case _0.MODIFIED_REINHARD:n=$d.createModifiedReinhardTonemappingStage(t);break;case _0.FILMIC:n=$d.createFilmicTonemappingStage(t);break;case _0.PBR_NEUTRAL:n=$d.createPbrNeutralTonemappingStage(t);break;default:n=$d.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,c(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 t8(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}pl.prototype.add=function(e){C.typeOf.object("stage",e);let t=this._stageNames,n=e8;for(n.push(e);n.length>0;){let o=n.pop();if(c(t[o.name]))throw new L(`${o.name} has already been added to the collection or does not have a unique name.`);t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(c(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};pl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=e8;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(c(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};pl.prototype.contains=function(e){return c(e)&&c(e._index)&&e._textureCache===this._textureCache};pl.prototype.get=function(e){t8(this);let t=this._stages,n=t.length;return C.typeOf.number.greaterThanOrEquals("stages length",n,0),C.typeOf.number.greaterThanOrEquals("index",e,0),C.typeOf.number.lessThan("index",e,n),t[e]};pl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};pl.prototype.getStageByName=function(e){return this._stageNames[e]};pl.prototype.update=function(e,t,n){t8(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 S=0;S<r.length;++S){let V=r[S];V.ready&&V.enabled&&V._isSupported(e)&&(o[s++]=V)}o.length=s;let a=s!==i.length;if(!a){for(let S=0;S<s;++S)if(o[S]!==i[S]){a=!0;break}}let l=this._ao,d=this._bloom,u=this._autoExposure,f=this._tonemapping,p=this._fxaa;f.enabled=n;let y=l.enabled&&l._isSupported(e),h=d.enabled&&d._isSupported(e),g=f.enabled&&f._isSupported(e),x=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||y!==this._aoEnabled||h!==this._bloomEnabled||g!==this._tonemappingEnabled||x!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=y,this._bloomEnabled=h,this._tonemappingEnabled=g,this._fxaaEnabled=x,this._textureCacheDirty=!1),c(this._randomTexture)&&!y&&(this._randomTexture.destroy(),this._randomTexture=void 0),!c(this._randomTexture)&&y){let V=new Uint8Array(196608);for(let Z=0;Z<196608;Z+=3)V[Z]=Math.floor(Math.random()*255);this._randomTexture=new Pt({context:e,pixelFormat:ke.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:V,width:256,height:256},sampler:new en({wrapS:xn.REPEAT,wrapT:xn.REPEAT,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})})}this._textureCache.update(e),p.update(e,t),l.update(e,t),d.update(e,t),f.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let S=0;S<r.length;++S)r[S].update(e,t);s=0;for(let S=0;S<r.length;++S){let V=r[S];V.ready&&V.enabled&&V._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};pl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function qT(e){for(;c(e.length);)e=e.get(e.length-1);return e.outputTexture}pl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(c(t))return qT(t)};function up(e,t,n,i,o){if(c(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){up(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)up(e.get(r),t,qT(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)up(e.get(r),t,n,i,o)}pl.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,l=this._bloom,d=this._autoExposure,u=this._tonemapping,f=a.enabled&&a._isSupported(e),p=l.enabled&&l._isSupported(e),y=this._autoExposureEnabled,h=u.enabled&&u._isSupported(e),g=s.enabled&&s._isSupported(e);if(!g&&!f&&!p&&!h&&r===0)return;let x=t;f&&a.ready&&(up(a,e,x,n,i),x=qT(a)),p&&l.ready&&(up(l,e,x,n,i),x=qT(l)),y&&d.ready&&up(d,e,x,n,i),h&&u.ready&&(up(u,e,x,n,i),x=qT(u));let S=x;if(r>0){up(o[0],e,x,n,i);for(let V=1;V<r;++V)up(o[V],e,qT(o[V-1]),n,i);S=qT(o[r-1])}g&&s.ready&&up(s,e,S,n,i)};pl.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};pl.prototype.isDestroyed=function(){return!1};pl.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(),he(this)};var XA=pl;var Tzi=_(T(),1);var nzi=_(T(),1);var DHi=_(T(),1),dpt={SHIFT:0,CTRL:1,ALT:2},ia=Object.freeze(dpt);var YHi=_(T(),1),upt={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},Vn=Object.freeze(upt);function Fg(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 a8(e,t){let n=e;return c(t)&&(n+=`+${t}`),n}function $T(e){if(e.shiftKey)return ia.SHIFT;if(e.ctrlKey)return ia.CTRL;if(e.altKey)return ia.ALT}var vs={LEFT:0,MIDDLE:1,RIGHT:2};function eu(e,t,n,i){function o(r){i(e,r)}Ot.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function mpt(e){let t=e._element,n=c(t.disableRootEvents)?t:document;Ot.supportsPointerEvents()?(eu(e,"pointerdown",t,gpt),eu(e,"pointerup",t,V_e),eu(e,"pointermove",t,xpt),eu(e,"pointercancel",t,V_e)):(eu(e,"mousedown",t,L_e),eu(e,"mouseup",n,Z_e),eu(e,"mousemove",n,R_e),eu(e,"touchstart",t,bpt),eu(e,"touchend",n,x_e),eu(e,"touchmove",n,ypt),eu(e,"touchcancel",n,x_e)),eu(e,"dblclick",t,hpt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",eu(e,i,t,ppt)}function fpt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var p_e={position:new D};function c8(e){e._lastSeenTouchEvent=Ti()}function l8(e){return Ti()-e._lastSeenTouchEvent>Df.mouseEmulationIgnoreMilliseconds}function s8(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function L_e(e,t){if(!l8(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===vs.LEFT)i=Vn.LEFT_DOWN;else if(n===vs.MIDDLE)i=Vn.MIDDLE_DOWN;else if(n===vs.RIGHT)i=Vn.RIGHT_DOWN;else return;let o=Fg(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=$T(t),s=e.getInputAction(i,r);c(s)&&(D.clone(o,p_e.position),s(p_e),t.preventDefault())}var b_e={position:new D},y_e={position:new D};function n8(e,t,n,i){let o=$T(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(c(r)||c(s)){let a=Fg(e,i,e._primaryPosition);if(c(r)&&(D.clone(a,b_e.position),r(b_e)),c(s)){let l=e._primaryStartPosition;s8(l,a,e._clickPixelTolerance)&&(D.clone(a,y_e.position),s(y_e))}}}function Z_e(e,t){if(!l8(e))return;let n=t.button;n!==vs.LEFT&&n!==vs.MIDDLE&&n!==vs.RIGHT||(e._buttonDown[vs.LEFT]&&(n8(e,Vn.LEFT_UP,Vn.LEFT_CLICK,t),e._buttonDown[vs.LEFT]=!1),e._buttonDown[vs.MIDDLE]&&(n8(e,Vn.MIDDLE_UP,Vn.MIDDLE_CLICK,t),e._buttonDown[vs.MIDDLE]=!1),e._buttonDown[vs.RIGHT]&&(n8(e,Vn.RIGHT_UP,Vn.RIGHT_CLICK,t),e._buttonDown[vs.RIGHT]=!1))}var i8={startPosition:new D,endPosition:new D};function R_e(e,t){if(!l8(e))return;let n=$T(t),i=Fg(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Vn.MOUSE_MOVE,n);c(r)&&(D.clone(o,i8.startPosition),D.clone(i,i8.endPosition),r(i8)),D.clone(i,o),(e._buttonDown[vs.LEFT]||e._buttonDown[vs.MIDDLE]||e._buttonDown[vs.RIGHT])&&t.preventDefault()}var g_e={position:new D};function hpt(e,t){let n=t.button,i;if(n===vs.LEFT)i=Vn.LEFT_DOUBLE_CLICK;else return;let o=$T(t),r=e.getInputAction(i,o);c(r)&&(Fg(e,t,g_e.position),r(g_e))}function ppt(e,t){let n;if(c(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(!c(n))return;let i=$T(t),o=e.getInputAction(Vn.WHEEL,i);c(o)&&(o(n),t.preventDefault())}function bpt(e,t){c8(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,Fg(e,r,new D));PD(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.set(s,D.clone(a.get(s)))}function x_e(e,t){c8(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);PD(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.remove(s)}var __e={position:new D},o8={position1:new D,position2:new D},T_e={position:new D},S_e={position:new D},C_e={position:new D};function PD(e,t){let n=$T(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[vs.LEFT]){if(e._buttonDown[vs.LEFT]=!1,c(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Vn.LEFT_UP,n),c(r)&&(D.clone(e._primaryPosition,T_e.position),r(T_e)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Vn.LEFT_CLICK,n),c(s))){let l=e._primaryStartPosition,d=e._previousPositions.values[0];s8(l,d,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,S_e.position),s(S_e))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Vn.PINCH_END,n),c(r)&&r()),o===1&&!a){let l=i.values[0];D.clone(l,e._primaryPosition),D.clone(l,e._primaryStartPosition),D.clone(l,e._primaryPreviousPosition),e._buttonDown[vs.LEFT]=!0,r=e.getInputAction(Vn.LEFT_DOWN,n),c(r)&&(D.clone(l,__e.position),r(__e)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Vn.RIGHT_CLICK,n),c(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];s8(d,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,C_e.position),s(C_e))}},Df.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Vn.PINCH_START,n),c(r)&&(D.clone(i.values[0],o8.position1),D.clone(i.values[1],o8.position2),r(o8),t.preventDefault()))}function ypt(e,t){c8(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);c(d)&&Fg(e,r,d)}G_e(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),l.get(s))}var r8={startPosition:new D,endPosition:new D},IA={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function G_e(e,t){let n=$T(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[vs.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let l=e._primaryPreviousPosition;s=e.getInputAction(Vn.MOUSE_MOVE,n),c(s)&&(D.clone(l,r8.startPosition),D.clone(a,r8.endPosition),s(r8)),D.clone(a,l),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Vn.PINCH_MOVE,n),c(s))){let a=i.values[0],l=i.values[1],d=o.values[0],u=o.values[1],f=l.x-a.x,p=l.y-a.y,y=Math.sqrt(f*f+p*p)*.25,h=u.x-d.x,g=u.y-d.y,x=Math.sqrt(h*h+g*g)*.25,S=(l.y+a.y)*.125,V=(u.y+d.y)*.125,Z=Math.atan2(p,f),R=Math.atan2(g,h);D.fromElements(0,x,IA.distance.startPosition),D.fromElements(0,y,IA.distance.endPosition),D.fromElements(R,V,IA.angleAndHeight.startPosition),D.fromElements(Z,S,IA.angleAndHeight.endPosition),s(IA)}}function gpt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Fg(e,t,new D)),PD(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else L_e(e,t)}function V_e(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),PD(e,t),e._previousPositions.remove(i)}else Z_e(e,t)}function xpt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!c(o))return;Fg(e,t,o),G_e(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else R_e(e,t)}function Df(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Df.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Zt,this._previousPositions=new Zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,mpt(this)}Df.prototype.setInputAction=function(e,t,n){if(!c(e))throw new L("action is required.");if(!c(t))throw new L("type is required.");let i=a8(t,n);this._inputEvents[i]=e};Df.prototype.getInputAction=function(e,t){if(!c(e))throw new L("type is required.");let n=a8(e,t);return this._inputEvents[n]};Df.prototype.removeInputAction=function(e,t){if(!c(e))throw new L("type is required.");let n=a8(e,t);delete this._inputEvents[n]};Df.prototype.isDestroyed=function(){return!1};Df.prototype.destroy=function(){return fpt(this),he(this)};Df.mouseEmulationIgnoreMilliseconds=800;Df.touchHoldDelayMilliseconds=1500;var tu=Df;function eS(e){C.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}eS.prototype.completeMorph=function(){c(this._completeMorph)&&this._completeMorph()};eS.prototype.morphTo2D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof sn,!(this._previousMode===se.SCENE2D||this._previousMode===se.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE2D,!0),n._mode=se.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===se.COLUMBUS_VIEW?qpt(this,e):rbt(this,e,t),e===0&&c(this._completeMorph)&&this._completeMorph())};var _pt=new m,Tpt=new m,Spt=new m,Cpt=new m,Vpt=new m,Lpt=new m,Zpt=new m,Rpt=new pe,Gpt=new M,Ept=new Ci,Xpt=new sn,Ipt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};eS.prototype.morphToColumbusView=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===se.COLUMBUS_VIEW||this._previousMode===se.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,se.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=_pt,o=Tpt,r=Spt;if(e>0)i.x=0,i.y=-1,i.z=1,i=m.multiplyByScalar(m.normalize(i,i),5*t.maximumRadius,i),m.negate(m.normalize(i,o),o),m.cross(m.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===se.SCENE2D)m.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,m.negate(m.UNIT_Z,o),m.clone(m.UNIT_Y,r);else{m.clone(d.positionWC,i),m.clone(d.directionWC,o),m.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,Zpt),f=wt.eastNorthUpToFixedFrame(u,t,Gpt);M.inverseTransformation(f,f),n.mapProjection.project(t.cartesianToCartographic(i,Rpt),i),M.multiplyByPointAsVector(f,o,o),M.multiplyByPointAsVector(f,r,r)}}let s;this._morphToOrthographic?(s=Xpt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Ept,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=w.toRadians(60));let a=Ipt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let l=abt(a);WA(this,l),this._previousMode===se.SCENE2D?sbt(this,e,a,l):(a.position2D=M.multiplyByPoint(oo.TRANSFORM_2D,i,Cpt),a.direction2D=M.multiplyByPointAsVector(oo.TRANSFORM_2D,o,Vpt),a.up2D=M.multiplyByPointAsVector(oo.TRANSFORM_2D,r,Lpt),n._mode=se.MORPHING,N_e(this,e,a,l)),e===0&&c(this._completeMorph)&&this._completeMorph()};var m8={position:new m,direction:new m,up:new m,frustum:void 0},X_e=new Ci;eS.prototype.morphTo3D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===se.SCENE3D||this._previousMode===se.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE3D,!0),n._mode=se.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===se.SCENE2D)Opt(this,e,t);else{let i;e>0?(i=m8,m.fromDegrees(0,0,5*t.maximumRadius,t,i.position),m.negate(i.position,i.direction),m.normalize(i.direction,i.direction),m.clone(m.UNIT_Z,i.up)):i=I_e(this,t);let o,r=n.camera;r.frustum instanceof sn?o=r.frustum.clone():(o=X_e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=w.toRadians(60)),i.frustum=o;let s=U_e(i);WA(this,s),u8(this,e,i,s)}e===0&&c(this._completeMorph)&&this._completeMorph()}};eS.prototype.isDestroyed=function(){return!1};eS.prototype.destroy=function(){return vD(this),he(this)};function WA(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new tu(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Vn.LEFT_DOWN),e._morphHandler.setInputAction(n,Vn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Vn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Vn.WHEEL)}}function vD(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 Wpt=new pe,wpt=new m,Ppt=new M;function I_e(e,t){let n=e._scene,i=n.camera,o=m8,r=o.position,s=o.direction,a=o.up,l=n.mapProjection.unproject(i.position,Wpt);t.cartographicToCartesian(l,r);let d=t.scaleToGeodeticSurface(r,wpt),u=wt.eastNorthUpToFixedFrame(d,t,Ppt);return M.multiplyByPointAsVector(u,i.direction,s),M.multiplyByPointAsVector(u,i.up,a),o}var vpt=new m,Fpt=new m,Apt=new m,Mpt=new m,Npt=new m,kpt=new m;function u8(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(r.position,vpt),a=m.clone(r.direction,Fpt),l=m.clone(r.up,Apt),d=M.multiplyByPoint(oo.TRANSFORM_2D_INVERSE,n.position,Mpt),u=M.multiplyByPointAsVector(oo.TRANSFORM_2D_INVERSE,n.direction,Npt),f=M.multiplyByPointAsVector(oo.TRANSFORM_2D_INVERSE,n.up,kpt);function p(h){bm(s,d,h.time,r.position),bm(a,u,h.time,r.direction),bm(l,f,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let y=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){k_e(e,o,0,1,t,i)}});e._currentTweens.push(y)}var Upt=new sn,W_e=new m,w_e=new m,P_e=new m,f8=new m,v_e=new m,F_e=new m;function Opt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=m8,m.fromDegrees(0,0,5*n.maximumRadius,n,r.position),m.negate(r.position,r.direction),m.normalize(r.direction,r.direction),m.clone(m.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=I_e(e,n));let s;e._morphToOrthographic?(s=Upt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=X_e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=w.toRadians(60)),r.frustum=s;let a=U_e(r);WA(e,a);let l;e._morphToOrthographic?l=function(){u8(e,t,r,a)}:l=function(){M_e(e,t,r,function(){u8(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:m.fromDegrees(0,0,5*n.maximumRadius,n,f8),complete:function(){i._mode=se.MORPHING,l()}})):l()}function bm(e,t,n,i){return m.lerp(e,t,n,i)}function A_e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof sn)return;let a=s.frustum.fov,l=w.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(l*.5)+1e7;function u(p){s.frustum.fov=w.lerp(a,l,p.time);let y=d/Math.tan(s.frustum.fov*.5);i(s,y)}let f=r.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(f)}var Dpt=new m,Bpt=new m,Ypt=new m,d8=new m,Hpt=new m,zpt=new m,Kpt=new Oo,Jpt=new bn,Qpt=new m,jpt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function qpt(e,t){t*=.5;let n=e._scene,i=n.camera,o=m.clone(i.position,Dpt),r=m.clone(i.direction,Bpt),s=m.clone(i.up,Ypt),a=m.negate(m.UNIT_Z,Hpt),l=m.clone(m.UNIT_Y,zpt),d=d8;if(t>0)m.clone(m.ZERO,d8),d.z=5*n.ellipsoid.maximumRadius;else{m.clone(o,d8);let x=Jpt;M.multiplyByPoint(oo.TRANSFORM_2D,o,x.origin),M.multiplyByPointAsVector(oo.TRANSFORM_2D,r,x.direction);let S=n.globe;if(c(S)){let V=S.pickWorldCoordinates(x,n,!0,Qpt);c(V)&&(M.multiplyByPoint(oo.TRANSFORM_2D_INVERSE,V,d),d.z+=m.distance(o,d))}}let u=Kpt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let f=jpt;f.position=d,f.direction=a,f.up=l,f.frustum=u;let p=O_e(f);WA(e,p);function y(x){bm(o,d,x.time,i.position),bm(r,a,x.time,i.direction),bm(s,l,x.time,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function h(x,S){x.position.z=S}let g=n.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){A_e(e,t,f,h,p)}});e._currentTweens.push(g)}var E_e=new pe,$pt={position:new m,direction:new m,up:new m,position2D:new m,direction2D:new m,up2D:new m,frustum:new Oo},ebt={position:new m,direction:new m,up:new m,frustum:void 0},tbt=new m,nbt=new bn,ibt=new M,obt=new m;function rbt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=$pt;if(t>0)m.clone(m.ZERO,r.position),r.position.z=5*n.maximumRadius,m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,E_e),i.mapProjection.project(E_e,r.position),m.negate(m.UNIT_Z,r.direction),m.clone(m.UNIT_Y,r.up);let f=nbt;m.clone(r.position2D,f.origin);let p=m.clone(o.directionWC,f.direction),y=n.scaleToGeodeticSurface(o.positionWC,obt),h=wt.eastNorthUpToFixedFrame(y,n,ibt);M.inverseTransformation(h,h),M.multiplyByPointAsVector(h,p,p),M.multiplyByPointAsVector(oo.TRANSFORM_2D,p,p);let g=i.globe;if(c(g)){let x=g.pickWorldCoordinates(f,i,!0,tbt);if(c(x)){let S=m.distance(r.position2D,x);x.x+=S,m.clone(x,r.position2D)}}}function s(f,p){f.position.x=p}M.multiplyByPoint(oo.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(oo.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(oo.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 l=ebt;M.multiplyByPoint(oo.TRANSFORM_2D_INVERSE,r.position2D,l.position),m.clone(r.direction,l.direction),m.clone(r.up,l.up),l.frustum=a;let d=O_e(l);WA(e,d);function u(){A_e(e,t,r,s,d)}N_e(e,t,r,u)}function M_e(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,l=w.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(l*.5)+1e7,r.frustum.fov=l;function u(p){r.frustum.fov=w.lerp(l,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let f=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(f)}function sbt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=m.clone(n.position,f8),a=m.clone(n.direction,v_e),l=m.clone(n.up,F_e);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=m.clone(r.position,W_e),f=m.clone(r.direction,w_e),p=m.clone(r.up,P_e);u.z=s.z;function y(g){bm(u,s,g.time,r.position),bm(f,a,g.time,r.direction),bm(p,l,g.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right)}let h=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:y,complete:function(){i(e)}});e._currentTweens.push(h)}e._morphToOrthographic?d():M_e(e,0,n,d)}function N_e(e,t,n,i){let o=e._scene,r=o.camera,s=m.clone(r.position,W_e),a=m.clone(r.direction,w_e),l=m.clone(r.up,P_e),d=m.clone(n.position2D,f8),u=m.clone(n.direction2D,v_e),f=m.clone(n.up2D,F_e);function p(h){bm(s,d,h.time,r.position),bm(a,u,h.time,r.direction),bm(l,f,h.time,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let y=o.tweens.add({duration:t,easingFunction:Jr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){k_e(e,o,1,0,t,i)}});e._currentTweens.push(y)}function k_e(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Jr.QUARTIC_OUT};c(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function U_e(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),vD(t);let i=n.camera;(t._previousMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE3D,r)}}function O_e(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),vD(t);let i=n.camera;m.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE2D,o)}}function abt(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),vD(t);let i=n.camera;(t._previousModeMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,m.clone(e.position,i.position),m.clone(e.direction,i.direction),m.clone(e.up,i.up),m.cross(i.direction,i.up,i.right),m.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.COLUMBUS_VIEW,r)}}var wA=eS;var gKi=_(T(),1);var Pzi=_(T(),1);var Czi=_(T(),1),cbt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Ni=Object.freeze(cbt);function oa(e,t){let n=`${e}`;return c(t)&&(n+=`+${t}`),n}function lbt(e,t){D.clone(e.distance.startPosition,t.distance.startPosition),D.clone(e.distance.endPosition,t.distance.endPosition),D.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),D.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function D_e(e,t,n){let i=oa(Ni.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,l=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new D;let d=e._movement[i];c(d)||(d=e._movement[i]={}),d.distance={startPosition:new D,endPosition:new D},d.angleAndHeight={startPosition:new D,endPosition:new D},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,D.lerp(u.position1,u.position2,.5,s[i])},Vn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,l[i]=new Date},Vn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(lbt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(D.clone(u.distance.endPosition,d.distance.endPosition),D.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let f=d.angleAndHeight.endPosition.x,p=d.prevAngle,y=Math.PI*2;for(;f>=p+Math.PI;)f-=y;for(;f<p-Math.PI;)f+=y;d.angleAndHeight.endPosition.x=-f*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Vn.PINCH_MOVE,t)}function B_e(e,t){let n=oa(Ni.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];c(s)||(s=e._movement[n]={});let a=e._lastMovement[n];c(a)||(a=e._lastMovement[n]={startPosition:new D,endPosition:new D,valid:!1}),s.startPosition=new D,D.clone(D.ZERO,s.startPosition),s.endPosition=new D,e._eventHandler.setInputAction(function(l){let d=7.5*w.toRadians(l);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,D.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Vn.WHEEL,t)}function yL(e,t,n){let i=oa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new D;let a=e._lastMovement[i];c(a)||(a=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let l,d;n===Ni.LEFT_DRAG?(l=Vn.LEFT_DOWN,d=Vn.LEFT_UP):n===Ni.RIGHT_DRAG?(l=Vn.RIGHT_DOWN,d=Vn.RIGHT_UP):n===Ni.MIDDLE_DRAG&&(l=Vn.MIDDLE_DOWN,d=Vn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,D.clone(u.position,r[i])},l,t),e._eventHandler.setInputAction(function(){h8(oa(n,void 0),e);for(let u of Object.values(ia)){let f=oa(n,u);h8(f,e)}},d,t)}function h8(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 Y_e(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function dbt(e,t,n){let i=n._isDown,o=!1,r=oa(e,t);for(let[l,d]of Object.entries(i))l.startsWith(e)&&d&&l!==r&&(o=!0,h8(l,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];c(a)||(a=n._lastMovement[r]={startPosition:new D,endPosition:new D,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function H_e(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Ni)if(Ni.hasOwnProperty(s)){let a=Ni[s];if(c(a)){let l=oa(a,t);n[l]=!0,c(e._lastMovement[l])||(e._lastMovement[l]={startPosition:new D,endPosition:new D,valid:!1}),c(e._movement[l])||(e._movement[l]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in Ni)if(Ni.hasOwnProperty(a)){let l=Ni[a];if(c(l)){let d=oa(l,t);dbt(l,t,e),r[d]&&(n[d]?(Y_e(i[d],o[d]),o[d].valid=!0,Y_e(s,i[d]),n[d]=!1):D.clone(s.endPosition,i[d].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},Vn.MOUSE_MOVE,t)}function ym(e){if(!c(e))throw new L("canvas is required.");this._eventHandler=new tu(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,B_e(this,void 0),D_e(this,void 0,e),yL(this,void 0,Ni.LEFT_DRAG),yL(this,void 0,Ni.RIGHT_DRAG),yL(this,void 0,Ni.MIDDLE_DRAG),H_e(this,void 0);for(let t in ia)if(ia.hasOwnProperty(t)){let n=ia[t];c(n)&&(B_e(this,n),D_e(this,n,e),yL(this,n,Ni.LEFT_DRAG),yL(this,n,Ni.RIGHT_DRAG),yL(this,n,Ni.MIDDLE_DRAG),H_e(this,n))}}Object.defineProperties(ym.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[oa(Ni.WHEEL)]||!this._update[oa(Ni.WHEEL,ia.SHIFT)]||!this._update[oa(Ni.WHEEL,ia.CTRL)]||!this._update[oa(Ni.WHEEL,ia.ALT)];return this._buttonsDown>0||e}}});ym.prototype.isMoving=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return!this._update[n]};ym.prototype.getMovement=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._movement[n]};ym.prototype.getLastMovement=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t),i=this._lastMovement[n];if(i.valid)return i};ym.prototype.isButtonDown=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._isDown[n]};ym.prototype.getStartMousePosition=function(e,t){if(!c(e))throw new L("type is required.");if(e===Ni.WHEEL)return this._currentMousePosition;let n=oa(e,t);return this._eventStartPosition[n]};ym.prototype.getButtonPressTime=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._pressTime[n]};ym.prototype.getButtonReleaseTime=function(e,t){if(!c(e))throw new L("type is required.");let n=oa(e,t);return this._releaseTime[n]};ym.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),he(this)};var PA=ym;var Bzi=_(T(),1);function FD(e,t,n,i,o,r,s,a,l,d){this._tweens=e,this._tweenjs=t,this._startObject=He(n),this._stopObject=He(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=l,this.cancel=d,this.needsStart=!0}Object.defineProperties(FD.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}}});FD.prototype.cancelTween=function(){this._tweens.remove(this)};function Bf(){this._tweens=[]}Object.defineProperties(Bf.prototype,{length:{get:function(){return this._tweens.length}}});Bf.prototype.add=function(e){if(e=e??z.EMPTY_OBJECT,!c(e.startObject)||!c(e.stopObject))throw new L("options.startObject and options.stopObject are required.");if(!c(e.duration)||e.duration<0)throw new L("options.duration is required and must be positive.");if(e.duration===0)return c(e.complete)&&e.complete(),new FD(this);let t=e.duration/Kn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Kn.SECONDS_PER_MILLISECOND,o=e.easingFunction??Jr.LINEAR_NONE,r=e.startObject,s=new k0e(r);s.to(He(e.stopObject),t),s.delay(i),s.easing(o),c(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new FD(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Bf.prototype.addProperty=function(e){e=e??z.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;if(!c(t)||!c(e.property))throw new L("options.object and options.property are required.");if(!c(t[n]))throw new L("options.object must have the specified property.");if(!c(i)||!c(o))throw new L("options.startValue and options.stopValue are required.");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})};Bf.prototype.addAlpha=function(e){e=e??z.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new L("options.material is required.");let n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&c(t.uniforms[o])&&c(t.uniforms[o].alpha)&&n.push(o);if(n.length===0)throw new L("material has no properties with alpha components.");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})};Bf.prototype.addOffsetIncrement=function(e){e=e??z.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new L("material is required.");if(!c(t.uniforms.offset))throw new L("material.uniforms must have an offset property.");let n=t.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})};Bf.prototype.remove=function(e){if(!c(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),c(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Bf.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),c(n.cancel)&&n.cancel()}e.length=0};Bf.prototype.contains=function(e){return c(e)&&this._tweens.indexOf(e)!==-1};Bf.prototype.get=function(e){if(!c(e))throw new L("index is required.");return this._tweens[e]};Bf.prototype.update=function(e){let t=this._tweens,n=0;for(e=c(e)?e/Kn.SECONDS_PER_MILLISECOND:Ti();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 tS=Bf;function FA(e){if(!c(e))throw new L("scene is required.");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=Ni.LEFT_DRAG,this.zoomEventTypes=[Ni.RIGHT_DRAG,Ni.WHEEL,Ni.PINCH],this.rotateEventTypes=Ni.LEFT_DRAG,this.tiltEventTypes=[Ni.MIDDLE_DRAG,Ni.PINCH,{eventType:Ni.LEFT_DRAG,modifier:ia.CTRL},{eventType:Ni.RIGHT_DRAG,modifier:ia.CTRL}],this.lookEventTypes={eventType:Ni.LEFT_DRAG,modifier:ia.SHIFT};let t=e.ellipsoid??re.default;this.minimumPickingTerrainHeight=re.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=re.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=re.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=re.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 PA(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 tS,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new D(-1,-1),this._tiltCenter=new m,this._rotateMousePosition=new D(-1,-1),this._rotateStartPosition=new m,this._strafeStartPosition=new m,this._strafeMousePosition=new D,this._strafeEndMousePosition=new D,this._zoomMouseStart=new D(-1,-1),this._zoomWorldPosition=new m,this._useZoomWorldPosition=!1,this._panLastMousePosition=new D,this._panLastWorldPosition=new m,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new pe(Math.PI,w.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 ubt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function mbt(e){return D.equalsEpsilon(e.startPosition,e.endPosition,w.EPSILON14)}var fbt=.4;function hbt(e,t,n,i,o,r,s){let a=r[s];c(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,inertiaEnabled:!0});let l=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=l&&d&&(d.getTime()-l.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(l&&d&&u<fbt){let y=ubt(p,i),h=e.getLastMovement(t,n);if(!c(h)||mbt(h)||!a.inertiaEnabled||(a.motion.x=(h.endPosition.x-h.startPosition.x)*.5,a.motion.y=(h.endPosition.y-h.startPosition.y)*.5,a.startPosition=D.clone(h.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,y,a.endPosition),a.endPosition=D.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||D.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let g=e.getStartMousePosition(t,n);o(r,g,a)}}}function pbt(e,t){if(c(t)){let n=e[t];c(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(c(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],c(n)&&(n.inertiaEnabled=!1)}}}var z_e=[];function bl(e,t,n,i,o,r){if(!c(n))return;let s=e._aggregator;Array.isArray(n)||(z_e[0]=n,n=z_e);let a=n.length;for(let l=0;l<a;++l){let d=n[l],u=c(d.eventType)?d.eventType:d,f=d.modifier,p=s.isMoving(u,f)&&s.getMovement(u,f),y=s.getStartMousePosition(u,f);e.enableInputs&&t&&(p?(i(e,y,p),pbt(e,r)):o<1&&hbt(s,u,f,o,i,e,r))}}var AD=new bn,bbt=new m,ybt=new D,gbt=new m,xbt=new D,_bt=new m,Tbt=new m,Sbt=new m,Cbt=new m,rTe=new m,Vbt=new m,Lbt=new m,Zbt=new m,Rbt=new m,Gbt=new m,Ebt=new m,Xbt=new m,Ibt=new m,Wbt=new m,wbt=new m,nS=new m,K_e=new m,J_e=new m,p8={orientation:new Ea};function C8(e,t,n,i,o,r){let s=1;c(r)&&(s=w.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,f=o-d,p=i*f;p=w.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let y=a/e._scene.canvas.clientHeight;y=Math.min(y,e.maximumMovementRatio);let h=p*y;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!c(e._globe)){if(h>0&&Math.abs(o-d)<1||h<0&&Math.abs(o-u)<1)return;o-h<d?h=o-d-1:o-h>u&&(h=o-u)}let g=e._scene,x=g.camera,S=g.mode,V=p8.orientation;V.heading=x.heading,V.pitch=x.pitch,V.roll=x.roll;let Z=n.inertiaEnabled??D.equals(t,e._zoomMouseStart),R=e._zoomingOnVector,E=e._rotatingZoom,I;if(Z||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),c(e._globe)&&S===se.SCENE2D?(I=x.getPickRay(t,AD).origin,I=m.fromElements(I.y,I.z,I.x)):c(e._globe)&&(I=T0(e,t,bbt)),c(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,R=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){x.zoomIn(h);return}let v=S===se.COLUMBUS_VIEW;if(x.positionCartographic.height<2e6&&(E=!0),!Z||E){if(S===se.SCENE2D){let P=e._zoomWorldPosition,F=x.position;if(!m.equals(P,F)&&x.positionCartographic.height<e._maxCoord.x*2){let N=x.position.x,b=m.subtract(P,F,gbt);m.normalize(b,b);let G=m.distance(P,F)*h/(x.getMagnitude()*.5);x.move(b,G*.5),(x.position.x<0&&N>0||x.position.x>0&&N<0)&&(I=x.getPickRay(t,AD).origin,I=m.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=m.clone(I,e._zoomWorldPosition))}}else if(S===se.SCENE3D){let P=m.normalize(x.position,rTe);if(e._cameraUnderground||e._zoomingUnderground||x.positionCartographic.height<3e3&&Math.abs(m.dot(x.direction,P))<.6)v=!0;else{let F=g.canvas,N=xbt;N.x=F.clientWidth/2,N.y=F.clientHeight/2;let b=T0(e,N,_bt);if(!c(b))v=!0;else if(x.positionCartographic.height<1e6)if(m.dot(x.direction,P)>=-.5)v=!0;else{let G=Lbt;m.clone(x.position,G);let X=e._zoomWorldPosition,W=Vbt;if(W=m.normalize(X,W),m.dot(W,P)<0)return;let A=wbt,k=Gbt;m.clone(x.direction,k),m.add(G,m.multiplyByScalar(k,1e3,nS),A);let B=Ebt,O=Xbt;m.subtract(X,G,B),m.normalize(B,O);let H=m.dot(P,O);if(H>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-H),K=m.magnitude(G),Q=m.magnitude(X),ie=K-h,j=m.magnitude(B),$=Math.asin(w.clamp(j/Q*Math.sin(U),-1,1)),ne=Math.asin(w.clamp(ie/Q*Math.sin(U),-1,1)),be=$-ne+U,Ce=Zbt;m.normalize(G,Ce);let me=Rbt;me=m.cross(O,Ce,me),me=m.normalize(me,me),m.normalize(m.cross(Ce,me,nS),k),m.multiplyByScalar(m.normalize(A,nS),m.magnitude(A)-h,A),m.normalize(G,G),m.multiplyByScalar(G,ie,G);let _e=Ibt;m.multiplyByScalar(m.add(m.multiplyByScalar(Ce,Math.cos(be)-1,K_e),m.multiplyByScalar(k,Math.sin(be),J_e),nS),ie,_e),m.add(G,_e,G),m.normalize(A,Ce),m.normalize(m.cross(Ce,me,nS),k);let Ve=Wbt;m.multiplyByScalar(m.add(m.multiplyByScalar(Ce,Math.cos(be)-1,K_e),m.multiplyByScalar(k,Math.sin(be),J_e),nS),m.magnitude(A),Ve),m.add(A,Ve,A),m.clone(G,x.position),m.normalize(m.subtract(A,G,nS),x.direction),m.clone(x.direction,x.direction),m.cross(x.direction,x.up,x.right),m.cross(x.right,x.direction,x.up),x.setView(p8);return}else{let G=m.normalize(b,Tbt),X=m.normalize(e._zoomWorldPosition,Sbt),W=m.dot(X,G);if(W>0&&W<1){let A=w.acosClamped(W),k=m.cross(X,G,Cbt),B=Math.abs(A)>w.toRadians(20)?x.positionCartographic.height*.75:x.positionCartographic.height-h,O=h/B;x.rotate(k,A*O)}}}}e._rotatingZoom=!v}if(!Z&&v||R){let P,F=Oi.worldToWindowCoordinates(g,e._zoomWorldPosition,ybt);S!==se.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&c(F)?P=x.getPickRay(F,AD):P=x.getPickRay(t,AD);let N=P.direction;(S===se.COLUMBUS_VIEW||S===se.SCENE2D)&&m.fromElements(N.y,N.z,N.x,N),x.move(N,h),e._zoomingOnVector=!0}else x.zoomIn(h);e._cameraUnderground||x.setView(p8)}var Pbt=new bn,vbt=new bn,Fbt=new m;function Abt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Pbt).origin,s=o.getPickRay(n.endPosition,vbt).origin;r=m.fromElements(r.y,r.z,r.x,r),s=m.fromElements(s.y,s.z,s.x,s);let a=m.subtract(r,s,Fbt),l=m.magnitude(a);l>0&&(m.normalize(a,a),o.move(a,l))}function Q_e(e,t,n){c(n.distance)&&(n=n.distance);let o=e._scene.camera;C8(e,t,n,e.zoomFactor,o.getMagnitude())}var Mbt=new D,Nbt=new D;function j_e(e,t,n){if(c(n.angleAndHeight)){kbt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,l=Mbt;l.x=2/s*n.startPosition.x-1,l.y=2/a*(a-n.startPosition.y)-1,l=D.normalize(l,l);let d=Nbt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=D.normalize(d,d);let u=w.acosClamped(l.x);l.y<0&&(u=w.TWO_PI-u);let f=w.acosClamped(d.x);d.y<0&&(f=w.TWO_PI-f);let p=f-u;o.twistRight(p)}function kbt(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 l=i*a*Math.PI*4;r.twistRight(l)}function Ubt(e){let t=e._scene.mapMode2D===ed.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(bl(e,e.enableTranslate,e.translateEventTypes,Abt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bl(e,e.enableZoom,e.zoomEventTypes,Q_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bl(e,e.enableRotate,e.tiltEventTypes,j_e,e.inertiaSpin,"_lastInertiaTiltMovement")):(bl(e,e.enableZoom,e.zoomEventTypes,Q_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&bl(e,e.enableRotate,e.translateEventTypes,j_e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var sTe=new bn,Obt=new m,Dbt=new m;function T0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Obt)),!c(o))return m.clone(s,n);let a=!e._cameraUnderground,l=r.getPickRay(t,sTe),d=o.pickWorldCoordinates(l,i,a,Dbt),u=c(s)?m.distance(s,r.positionWC):Number.POSITIVE_INFINITY,f=c(d)?m.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<f?m.clone(s,n):m.clone(d,n)}var Bbt=new pe;function BD(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===se.SCENE3D){let l=t.cartesianToCartographic(i.position,Bbt);c(l)&&(r=l.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var Ybt=new m;function aTe(e,t){let n=t.origin,i=t.direction,o=BD(e),r=m.normalize(n,Ybt),s=Math.abs(m.dot(r,i));return s=Math.max(s,.5)*2,o*s}function cTe(e,t,n,i){let o=m.distance(t.origin,n),r=BD(e),s=w.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),bn.getPoint(t,o,i)}function lTe(e,t,n,i){let o;return c(n)?(o=m.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=BD(e))):o=BD(e),bn.getPoint(t,o,i)}var Hbt=new D;function dTe(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,Hbt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,V8(e,t,e._strafeStartPosition),t.endPosition=n}var q_e=new bn,zbt=new bn,b8=new m,Kbt=new m,Jbt=new m,Qbt=new m,jbt=new cn(m.UNIT_X,0),qbt=new D,$bt=new D;function e0t(e,t,n){if(m.equals(t,e._translateMousePosition)||(e._looking=!1),m.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){iu(e,t,n);return}if(e._strafing){dTe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,qbt),a=D.clone(n.endPosition,$bt),l=o.getPickRay(s,q_e),d=m.clone(m.ZERO,Qbt),u=m.UNIT_X,f;if(o.position.z<e._minimumPickingTerrainHeight&&(f=T0(e,s,b8),c(f)&&(d.x=f.x)),r||d.x>o.position.z&&c(f)){let Z=f;r&&(Z=lTe(e,l,f,b8)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),m.clone(Z,e._strafeStartPosition),e._strafing=!0,V8(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,jbt);l=o.getPickRay(s,q_e);let y=qn.rayPlane(l,p,b8),h=o.getPickRay(a,zbt),g=qn.rayPlane(h,p,Kbt);if(!c(y)||!c(g)){e._looking=!0,iu(e,t,n),D.clone(t,e._translateMousePosition);return}let x=m.subtract(y,g,Jbt),S=x.x;x.x=x.y,x.y=x.z,x.z=S;let V=m.magnitude(x);V>w.EPSILON6&&(m.normalize(x,x),o.move(x,V))}var uTe=new D,kD=new bn,UD=new m,t0t=new m,mTe=new M,n0t=new M,i0t=new m,o0t=new cn(m.UNIT_X,0),y8=new m,_8=new pe,fTe=new M,r0t=new Fe,s0t=new te,OD=new m;function a0t(e,t,n){if(c(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){iu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,c0t(e,t,n)):l0t(e,t,n)}function c0t(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=uTe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,kD),l=m.UNIT_X,d=a.origin,u=a.direction,f,p=m.dot(l,u);if(Math.abs(p)>w.EPSILON6&&(f=-m.dot(l,d)/p),!c(f)||f<=0){e._looking=!0,iu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let y=m.multiplyByScalar(u,f,UD);m.add(d,y,y);let h=i.mapProjection,g=h.ellipsoid;m.fromElements(y.y,y.z,y.x,y);let x=h.unproject(y,_8);g.cartographicToCartesian(x,y);let S=wt.eastNorthUpToFixedFrame(y,g,mTe),V=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let R=M.clone(o.transform,fTe);o._setTransform(S),nu(e,t,n,m.UNIT_Z),o._setTransform(R),e._globe=V,e._ellipsoid=Z;let E=Z.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function l0t(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,l=m.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=m.clone(e._tiltCenter,UD);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=T0(e,t,UD)),!c(s)){a=o.getPickRay(t,kD);let b=a.origin,G=a.direction,X,W=m.dot(l,G);if(Math.abs(W)>w.EPSILON6&&(X=-m.dot(l,b)/W),!c(X)||X<=0){e._looking=!0,iu(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=m.multiplyByScalar(G,X,UD),m.add(b,s,s)}r&&(c(a)||(a=o.getPickRay(t,kD)),cTe(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),m.clone(s,e._tiltCenter)}let d=i.canvas,u=uTe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,kD);let f=m.clone(m.ZERO,i0t);f.x=s.x;let p=cn.fromPointNormal(f,l,o0t),y=qn.rayPlane(a,p,t0t),h=o._projection,g=h.ellipsoid;m.fromElements(s.y,s.z,s.x,s);let x=h.unproject(s,_8);g.cartographicToCartesian(x,s);let S=wt.eastNorthUpToFixedFrame(s,g,mTe),V;c(y)?(m.fromElements(y.y,y.z,y.x,y),x=h.unproject(y,_8),g.cartographicToCartesian(x,y),V=wt.eastNorthUpToFixedFrame(y,g,n0t)):V=S;let Z=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=m.UNIT_Z,I=M.clone(o.transform,fTe);o._setTransform(S);let v=m.cross(m.UNIT_Z,m.normalize(o.position,y8),y8),P=m.dot(o.right,v);if(nu(e,t,n,E,!1,!0),o._setTransform(V),P<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(E=void 0);let G=o.constrainedAxis;o.constrainedAxis=void 0,nu(e,t,n,E,!0,!1),o.constrainedAxis=G}else nu(e,t,n,E,!0,!1);if(c(o.constrainedAxis)){let b=m.cross(o.direction,o.constrainedAxis,OD);m.equalsEpsilon(b,m.ZERO,w.EPSILON6)||(m.dot(b,o.right)<0&&m.negate(b,b),m.cross(b,o.direction,o.up),m.cross(o.direction,o.up,o.right),m.normalize(o.up,o.up),m.normalize(o.right,o.right))}o._setTransform(I),e._globe=Z,e._ellipsoid=R;let F=R.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let N=m.clone(o.positionWC,y8);if(e.enableCollisionDetection&&R8(e,!0),!m.equals(o.positionWC,N)){o._setTransform(V),o.worldToCameraCoordinatesPoint(N,N);let b=m.magnitudeSquared(N);m.magnitudeSquared(o.position)>b&&(m.normalize(o.position,o.position),m.multiplyByScalar(o.position,Math.sqrt(b),o.position));let G=m.angleBetween(N,o.position),X=m.cross(N,o.position,N);m.normalize(X,X);let W=Fe.fromAxisAngle(X,G,r0t),A=te.fromQuaternion(W,s0t);te.multiplyByVector(A,o.direction,o.direction),te.multiplyByVector(A,o.up,o.up),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up),o._setTransform(I)}}var hTe=new D,pTe=new bn,bTe=new m;function d0t(e,t,n){c(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=hTe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let l=o.getPickRay(a,pTe),d=l.origin,u=l.direction,f=o.position.z,p;f<e._minimumPickingTerrainHeight&&(p=T0(e,a,bTe));let y;if(c(p)&&(y=m.distance(d,p)),s){let h=aTe(e,l,f);c(y)?y=Math.min(y,h):y=h}if(!c(y)){let h=m.UNIT_X;y=-m.dot(h,d)/m.dot(h,u)}C8(e,t,n,e.zoomFactor,y)}function u0t(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))bl(e,e.enableRotate,e.rotateEventTypes,nu,e.inertiaSpin,"_lastInertiaSpinMovement"),bl(e,e.enableZoom,e.zoomEventTypes,gTe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),bl(e,e.enableTilt,e.tiltEventTypes,a0t,e.inertiaSpin,"_lastInertiaTiltMovement"),bl(e,e.enableTranslate,e.translateEventTypes,e0t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),bl(e,e.enableZoom,e.zoomEventTypes,d0t,e.inertiaZoom,"_lastInertiaZoomMovement"),bl(e,e.enableLook,e.lookEventTypes,iu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);c(o)&&(e._tween=i.add(o))}i.update()}}var m0t=new bn,f0t=new cn(m.UNIT_X,0),h0t=new m,p0t=new m;function V8(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,m0t),s=m.clone(o.direction,p0t);i.mode===se.COLUMBUS_VIEW&&m.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,f0t),l=qn.rayPlane(r,a,h0t);c(l)&&(s=m.subtract(n,l,s),i.mode===se.COLUMBUS_VIEW&&m.fromElements(s.y,s.z,s.x,s),m.add(o.position,s,o.position))}var $_e=new m,yTe=new pe,T8=new m,S8=new re,b0t=new m,y0t=new m,g0t=new m;function x0t(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){nu(e,t,n);return}let a,l,d=s.geodeticSurfaceNormal(o.position,b0t);if(D.equals(t,e._rotateMousePosition)){if(e._looking)iu(e,t,n,d);else if(e._rotating)nu(e,t,n);else if(e._strafing)dTe(e,n);else{if(m.magnitude(o.position)<m.magnitude(e._rotateStartPosition))return;a=m.magnitude(e._rotateStartPosition),l=T8,l.x=l.y=l.z=a,s=re.fromCartesian3(l,S8),x8(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,yTe).height,f=e._globe;if(c(f)&&u<e._minimumPickingTerrainHeight){let p=T0(e,n.startPosition,g0t);if(c(p)){let y=!1,h=o.getPickRay(n.startPosition,sTe);if(r)y=!0,lTe(e,h,p,p);else{let g=s.geodeticSurfaceNormal(p,y0t);Math.abs(m.dot(h.direction,g))<.05?y=!0:y=m.magnitude(o.position)<m.magnitude(p)}y?(D.clone(t,e._strafeEndMousePosition),m.clone(p,e._strafeStartPosition),e._strafing=!0,V8(e,n,e._strafeStartPosition)):(a=m.magnitude(p),l=T8,l.x=l.y=l.z=a,s=re.fromCartesian3(l,S8),x8(e,t,n,s),m.clone(p,e._rotateStartPosition))}else e._looking=!0,iu(e,t,n,d)}else c(o.pickEllipsoid(n.startPosition,e._ellipsoid,$_e))?(x8(e,t,n,e._ellipsoid),m.clone($_e,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,nu(e,t,n)):(e._looking=!0,iu(e,t,n,d));D.clone(t,e._rotateMousePosition)}function nu(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,l=s.canvas,d=a.constrainedAxis;c(i)&&(a.constrainedAxis=i);let u=m.magnitude(a.position),f=e._rotateFactor*(u-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/l.clientWidth,y=(n.startPosition.y-n.endPosition.y)/l.clientHeight;p=Math.min(p,e.maximumMovementRatio),y=Math.min(y,e.maximumMovementRatio);let h=f*p*Math.PI*2,g=f*y*Math.PI;if(c(i)&&c(e.maximumTiltAngle)){let x=e.maximumTiltAngle,S=m.dot(a.direction,i),V=Math.PI-Math.acos(S)+g;V>x&&(g-=V-x)}o||a.rotateRight(h),r||a.rotateUp(g),a.constrainedAxis=d}var g8=ce.clone(ce.UNIT_W),eTe=ce.clone(ce.UNIT_W),MD=new m,gL=new m,ND=new m,tTe=new m,_0t=new D,T0t=new D,S0t=new D,C0t=new D,V0t=new bn;function x8(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,_0t),a=D.clone(n.endPosition,T0t),l=i.cartesianToCartographic(r.positionWC,yTe).height,d,u;if(!n.inertiaEnabled&&l<e._minimumPickingTerrainHeight&&(d=m.clone(e._panLastWorldPosition,g8),!c(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(d=T0(e,s,g8)),!c(e._globe)&&c(d))){let f=m.subtract(d,r.positionWC,gL),p=m.multiplyByScalar(r.directionWC,m.dot(r.directionWC,f),gL),y=m.magnitude(p),h=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,y,o.pixelRatio,C0t),g=D.subtract(a,s,S0t),x=m.multiplyByScalar(r.rightWC,g.x*h.x,gL),S=m.normalize(r.positionWC,rTe),V=r.getPickRay(a,V0t).direction,Z=m.subtract(V,m.projectVector(V,r.rightWC,ND),ND),R=m.angleBetween(Z,r.directionWC),E=1;c(r.frustum.fov)&&(E=Math.max(Math.tan(R),.1));let I=Math.abs(m.dot(r.directionWC,S)),v=-g.y*h.y*2/Math.sqrt(E)*(1-I),P=m.multiplyByScalar(V,v,ND);I=Math.abs(m.dot(r.upWC,S));let F=m.multiplyByScalar(r.upWC,-g.y*(1-I)*h.y,tTe);u=m.add(d,x,eTe),u=m.add(u,P,u),u=m.add(u,F,u),m.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!c(d)||!c(u))&&(d=r.pickEllipsoid(s,i,g8),u=r.pickEllipsoid(a,i,eTe)),!c(d)||!c(u)){e._rotating=!0,nu(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),c(r.constrainedAxis)){let f=r.constrainedAxis,p=m.mostOrthogonalAxis(f,MD);m.cross(p,f,p),m.normalize(p,p);let y=m.cross(f,p,gL),h=m.magnitude(d),g=m.dot(f,d),x=Math.acos(g/h),S=m.multiplyByScalar(f,g,ND);m.subtract(d,S,S),m.normalize(S,S);let V=m.magnitude(u),Z=m.dot(f,u),R=Math.acos(Z/V),E=m.multiplyByScalar(f,Z,tTe);m.subtract(u,E,E),m.normalize(E,E);let I=Math.acos(m.dot(S,p));m.dot(S,y)<0&&(I=w.TWO_PI-I);let v=Math.acos(m.dot(E,p));m.dot(E,y)<0&&(v=w.TWO_PI-v);let P=I-v,F;m.equalsEpsilon(f,r.position,w.EPSILON2)?F=r.right:F=m.cross(f,r.position,MD);let N=m.cross(f,F,MD),b=m.dot(N,m.subtract(d,f,gL)),G=m.dot(N,m.subtract(u,f,gL)),X;b>0&&G>0?X=R-x:b>0&&G<=0?m.dot(r.position,f)>0?X=-x-R:X=x+R:X=x-R,r.rotateRight(P),r.rotateUp(X)}else{m.normalize(d,d),m.normalize(u,u);let f=m.dot(d,u),p=m.cross(d,u,MD);if(f<1&&!m.equalsEpsilon(p,m.ZERO,w.EPSILON14)){let y=Math.acos(f);r.rotate(p,y)}}}var L0t=new m,Z0t=new pe,nTe=0;function gTe(e,t,n){c(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,l=e._cameraUnderground,d;l?d=t:(d=hTe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,pTe),f,p=o.cartesianToCartographic(s.position,Z0t).height,y=Math.abs(nTe)<e.minimumPickingTerrainDistanceWithInertia;(i?y:p<e._minimumPickingTerrainHeight)&&(f=T0(e,d,bTe));let g;if(c(f)&&(g=m.distance(u.origin,f),nTe=g),l){let S=aTe(e,u,p);c(g)?g=Math.min(g,S):g=S}c(g)||(g=p);let x=m.normalize(s.position,L0t);C8(e,t,n,e.zoomFactor,g,m.dot(x,s.direction))}var xTe=new D,DD=new bn,vA=new m,R0t=new m,_Te=new M,G0t=new M,TTe=new M,E0t=new Fe,X0t=new te,L8=new pe,Z8=new m;function I0t(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(c(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,Z8);iu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,L8);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,w0t(e,t,n)):P0t(e,t,n)}var W0t=new pe;function w0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,W0t).height;if(a-s-1<w.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let l=o.canvas,d=xTe;d.x=l.clientWidth/2,d.y=l.clientHeight/2;let u=r.getPickRay(d,DD),f,p=qn.rayEllipsoid(u,i);if(c(p))f=bn.getPoint(u,p.start,vA);else if(a>e._minimumTrackBallHeight){let V=qn.grazingAltitudeLocation(u,i);if(!c(V))return;let Z=i.cartesianToCartographic(V,L8);Z.height=0,f=i.cartographicToCartesian(Z,vA)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,Z8);iu(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let y=wt.eastNorthUpToFixedFrame(f,i,_Te),h=e._globe,g=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=M.clone(r.transform,TTe);r._setTransform(y),nu(e,t,n,m.UNIT_Z),r._setTransform(x),e._globe=h,e._ellipsoid=g;let S=g.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function P0t(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,l,d;if(D.equals(t,e._tiltCenterMousePosition))a=m.clone(e._tiltCenter,vA);else{if(a=T0(e,t,vA),!c(a)){if(l=r.getPickRay(t,DD),d=qn.rayEllipsoid(l,i),!c(d)){if(i.cartesianToCartographic(r.position,L8).height<=e._minimumTrackBallHeight){e._looking=!0;let G=e._ellipsoid.geodeticSurfaceNormal(r.position,Z8);iu(e,t,n,G),D.clone(t,e._tiltCenterMousePosition)}return}a=bn.getPoint(l,d.start,vA)}s&&(c(l)||(l=r.getPickRay(t,DD)),cTe(e,l,a,a)),D.clone(t,e._tiltCenterMousePosition),m.clone(a,e._tiltCenter)}let u=o.canvas,f=xTe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,l=r.getPickRay(f,DD);let p=m.magnitude(a),y=m.fromElements(p,p,p,T8),h=re.fromCartesian3(y,S8);if(d=qn.rayEllipsoid(l,h),!c(d))return;let g=m.magnitude(l.origin)>p?d.start:d.stop,x=bn.getPoint(l,g,R0t),S=wt.eastNorthUpToFixedFrame(a,i,_Te),V=wt.eastNorthUpToFixedFrame(x,h,G0t),Z=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=re.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=m.UNIT_Z,I=M.clone(r.transform,TTe);r._setTransform(V);let v=m.cross(x,r.positionWC,OD);if(m.dot(r.rightWC,v)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(E=void 0);let G=r.constrainedAxis;r.constrainedAxis=void 0,nu(e,t,n,E,!0,!1),r.constrainedAxis=G}else nu(e,t,n,E,!0,!1);if(r._setTransform(S),nu(e,t,n,E,!1,!0),c(r.constrainedAxis)){let b=m.cross(r.direction,r.constrainedAxis,OD);m.equalsEpsilon(b,m.ZERO,w.EPSILON6)||(m.dot(b,r.right)<0&&m.negate(b,b),m.cross(b,r.direction,r.up),m.cross(r.direction,r.up,r.right),m.normalize(r.up,r.up),m.normalize(r.right,r.right))}r._setTransform(I),e._globe=Z,e._ellipsoid=R;let F=R.maximumRadius;e._rotateFactor=1/F,e._rotateRateRangeAdjustment=F;let N=m.clone(r.positionWC,OD);if(e.enableCollisionDetection&&R8(e,!0),!m.equals(r.positionWC,N)){r._setTransform(V),r.worldToCameraCoordinatesPoint(N,N);let b=m.magnitudeSquared(N);m.magnitudeSquared(r.position)>b&&(m.normalize(r.position,r.position),m.multiplyByScalar(r.position,Math.sqrt(b),r.position));let G=m.angleBetween(N,r.position),X=m.cross(N,r.position,N);m.normalize(X,X);let W=Fe.fromAxisAngle(X,G,E0t),A=te.fromQuaternion(W,X0t);te.multiplyByVector(A,r.direction,r.direction),te.multiplyByVector(A,r.up,r.up),m.cross(r.direction,r.up,r.right),m.cross(r.right,r.direction,r.up),r._setTransform(I)}}var v0t=new D,F0t=new D,iTe=new bn,oTe=new bn,A0t=new m,M0t=new m;function iu(e,t,n,i){let r=e._scene.camera,s=v0t;s.x=n.startPosition.x,s.y=0;let a=F0t;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,iTe),d=r.getPickRay(a,oTe),u=0,f,p;r.frustum instanceof sn?(f=l.origin,p=d.origin,m.add(r.direction,f,f),m.add(r.direction,p,p),m.subtract(f,r.position,f),m.subtract(p,r.position,p),m.normalize(f,f),m.normalize(p,p)):(f=l.direction,p=d.direction);let y=m.dot(f,p);y<1&&(u=Math.acos(y)),u=n.startPosition.x>n.endPosition.x?-u:u;let h=e._horizontalRotationAxis;if(c(i)?r.look(i,-u):c(h)?r.look(h,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,iTe),d=r.getPickRay(a,oTe),u=0,r.frustum instanceof sn?(f=l.origin,p=d.origin,m.add(r.direction,f,f),m.add(r.direction,p,p),m.subtract(f,r.position,f),m.subtract(p,r.position,p),m.normalize(f,f),m.normalize(p,p)):(f=l.direction,p=d.direction),y=m.dot(f,p),y<1&&(u=Math.acos(y)),u=n.startPosition.y>n.endPosition.y?-u:u,i=i??h,c(i)){let g=r.direction,x=m.negate(i,A0t),S=m.equalsEpsilon(g,i,w.EPSILON2),V=m.equalsEpsilon(g,x,w.EPSILON2);if(!S&&!V){y=m.dot(g,i);let Z=w.acosClamped(y);u>0&&u>Z&&(u=Z-w.EPSILON4),y=m.dot(g,x),Z=w.acosClamped(y),u<0&&-u>Z&&(u=-Z+w.EPSILON4);let R=m.cross(i,g,M0t);r.look(R,u)}else(S&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function N0t(e){bl(e,e.enableRotate,e.rotateEventTypes,x0t,e.inertiaSpin,"_lastInertiaSpinMovement"),bl(e,e.enableZoom,e.zoomEventTypes,gTe,e.inertiaZoom,"_lastInertiaZoomMovement"),bl(e,e.enableTilt,e.tiltEventTypes,I0t,e.inertiaSpin,"_lastInertiaTiltMovement"),bl(e,e.enableLook,e.lookEventTypes,iu)}var k0t=new M,U0t=new pe;function R8(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===se.SCENE2D||i===se.MORPHING)return;let o=n.camera,r=n.ellipsoid??re.WGS84,s=n.mapProjection,a,l;M.equals(o.transform,M.IDENTITY)||(a=M.clone(o.transform,k0t),l=m.magnitude(o.position),o._setTransform(M.IDENTITY));let d=U0t;i===se.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let f=e._scene.globeHeight;if(c(f)){let p=f+e.minimumZoomDistance,y=f-e._lastGlobeHeight,h=y/e._lastGlobeHeight;d.height<p&&(t||Math.abs(h)<=.1)&&(d.height=p,i===se.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(h)<=.1?e._lastGlobeHeight=f:e._lastGlobeHeight+=y*.1}}c(a)&&(o._setTransform(a),u&&(m.normalize(o.position,o.position),m.negate(o.position,o.direction),m.multiplyByScalar(o.position,Math.max(l,e.minimumZoomDistance),o.position),m.normalize(o.direction,o.direction),m.cross(o.direction,o.up,o.right),m.cross(o.right,o.direction,o.up)))}FA.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===se.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var O0t=new m,D0t=new m;FA.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??re.default):(this._globe=void 0,this._ellipsoid=re.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Lr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Lr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Lr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&c(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=m.clone(t.positionWC,O0t),l=m.clone(t.directionWC,D0t);if(i===se.SCENE2D?Ubt(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=m.UNIT_Z,u0t(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,N0t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!m.equals(a,t.positionWC)||!m.equals(l,t.directionWC);R8(this,d)}this._aggregator.reset()};FA.prototype.isDestroyed=function(){return!1};FA.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),he(this)};var AA=FA;var UKi=_(T(),1);var _Ki=_(T(),1),MA=`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 SKi=_(T(),1),NA=`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;
}
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 S0(){this._sceneFramebuffer=new BT;let e=.125,t=new Array(6);t[0]=new mo({fragmentShader:td,textureScale:e,forcePowerOfTwo:!0,sampleMode:qd.LINEAR});let n=t[1]=new mo({fragmentShader:NA,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new D,t[2]=new mo({fragmentShader:vg,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 mo({fragmentShader:vg,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 mo({fragmentShader:td,sampleMode:qd.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new mo({fragmentShader:MA,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new nd({stages:t});let o=new jT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}S0.prototype.get=function(e){return this._stages.get(e)};S0.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 B0t=new ce,STe=new D,Y0t=new D,CTe=new M;function H0t(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,l=M.computeViewportTransformation(n,0,1,CTe),d=M.multiplyByPoint(r,o,B0t),u=wt.pointToGLWindowCoordinates(s,l,o,STe);d.x+=w.SOLAR_RADIUS;let f=wt.pointToGLWindowCoordinates(a,l,d,d),p=D.magnitude(D.subtract(f,u,f))*30*2,y=Y0t;y.x=p,y.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(y.x,y.y)*.15;let h=t.drawingBufferWidth,g=t.drawingBufferHeight,x=e._stages,S=x.get(0),V=S.outputTexture.width,Z=S.outputTexture.height,R=new je;R.width=V,R.height=Z,l=M.computeViewportTransformation(R,0,1,CTe),u=wt.pointToGLWindowCoordinates(s,l,o,STe),y.x*=V/h,y.y*=Z/g;let E=S.scissorRectangle;E.x=Math.max(u.x-y.x*.5,0),E.y=Math.max(u.y-y.y*.5,0),E.width=Math.min(y.x,h),E.height=Math.min(y.y,g);for(let I=1;I<4;++I)je.clone(E,x.get(I).scissorRectangle)}S0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};S0.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),H0t(this,t,n),o};S0.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)};S0.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(td,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};S0.prototype.isDestroyed=function(){return!1};S0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),he(this)};var kA=S0;var KKi=_(T(),1);function VTe(){this._cachedShowFrustumsShaders={}}function z0t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function K0t(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=Be.replaceMain(u,"czm_Debug_main");let f=/out_FragData_(\d+)/g,p;for(;(p=f.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
`,a+=`uniform vec3 debugShowFrustumsColor;
`,a+=`void main() 
{ 
    czm_Debug_main(); 
`;let l;if(s>0)for(l=0;l<s;++l)a+=`    out_FragData_${r[l]}.rgb *= debugShowCommandsColor;
`,a+=`    out_FragData_${r[l]}.rgb *= debugShowFrustumsColor;
`;else a+=`    out_FragColor.rgb *= debugShowCommandsColor;
`,a+=`    out_FragColor.rgb *= debugShowFrustumsColor;
`;a+="}",o.sources.push(a);let d=z0t(i);return tn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var UA=new Y;function J0t(e,t){let n;return c(t.uniformMap)?n=t.uniformMap:n={},c(n.debugShowCommandsColor)||c(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(c(t._debugColor)||(t._debugColor=Y.fromRandom()),t._debugColor):Y.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(UA.red=t.debugOverlappingFrustums&1?1:0,UA.green=t.debugOverlappingFrustums&2?1:0,UA.blue=t.debugOverlappingFrustums&4?1:0,UA.alpha=1,UA):Y.WHITE}),n}var Q0t=new et;VTe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];c(o)||(o=K0t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=et.shallowClone(t,Q0t);r.shaderProgram=o,r.uniformMap=J0t(e,t),r.execute(e.context,n)};var OA=VTe;var tJi=_(T(),1);function iS(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Xn}iS.fromKeyframeNode=function(e,t,n,i){C.typeOf.object("primitive",e),C.typeOf.number("tileIndex",t),C.typeOf.number("sampleIndex",n),C.typeOf.object("keyframeNode",i);let o=new iS(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=j0t(e,s,n),o._orientedBoundingBox=$0t(e,r,n,o._orientedBoundingBox),o};function j0t(e,t,n){if(!c(t)||!c(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let l=i[a],d=lt.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[l]=u}return s}var LTe=new m,q0t=new m;function $0t(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,l=Math.floor(a/o.x),d=a-l*o.x,u=m.fromElements(d,l,s,LTe),f=m.divideComponents(m.subtract(u,e._paddingBefore,LTe),e.dimensions,q0t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,f,i)}Object.defineProperties(iS.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()}}});iS.prototype.hasProperty=function(e){return c(this._metadata[e])};iS.prototype.getNames=function(){return Object.keys(this._metadata)};iS.prototype.getProperty=function(e){return this._metadata[e]};var DA=iS;var V8i=_(T(),1);var CQi=_(T(),1);var rQi=_(T(),1);var iJi=_(T(),1),BA=`struct Ray {
vec3 pos;
vec3 dir;
vec3 rawDir;
};
#if defined(JITTER)
float hash(vec2 p)
{
vec3 p3 = fract(vec3(p.xyx) * 50.0);
p3 += dot(p3, p3.yzx + 19.19);
return fract((p3.x + p3.y) * p3.z);
}
#endif
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);
}
struct PointJacobianT {
vec3 point;
mat3 jacobianT;
};
`;var rJi=_(T(),1),YA=`#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 mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionUv;
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)
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 = 2.0 * viewRay.rawDir * jacobianT;
vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz);
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) {
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) {
vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
ivec3 sampleIndex = ivec3(floor(inputCoordinate));
return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
}
void main()
{
vec4 fragCoord = gl_FragCoord;
vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);
vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection);
vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection);
vec3 viewPosUv = u_cameraPositionUv;
#if defined(SHAPE_ELLIPSOID)
vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv;
Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir);
#else
Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv);
#endif
Intersections ix;
RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);
if (shapeIntersection.entry.w == NO_HIT) {
discard;
}
float currentT = shapeIntersection.entry.w;
float endT = shapeIntersection.exit.w;
vec3 positionUv = viewPosUv + currentT * viewDirUv;
PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
TraversalData traversalData;
SampleData sampleDatas[SAMPLE_COUNT];
traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas);
vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
#if defined(JITTER)
float noise = hash(screenCoord);
currentT += noise * step.w;
positionUv += noise * step.w * viewDirUv;
#endif
FragmentInput fragmentInput;
#if defined(STATISTICS)
setStatistics(fragmentInput.metadata.statistics);
#endif
vec4 colorAccum = vec4(0.0);
for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
copyPropertiesToMetadata(properties, fragmentInput.metadata);
fragmentInput.voxel.positionUv = positionUv;
fragmentInput.voxel.positionShapeUv = pointJacobian.point;
fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
fragmentInput.voxel.viewDirUv = viewDirUv;
fragmentInput.voxel.viewDirWorld = viewDirWorld;
fragmentInput.voxel.surfaceNormal = step.xyz;
fragmentInput.voxel.travelDistance = step.w;
fragmentInput.voxel.stepCount = stepCount;
fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
czm_modelMaterial materialOutput;
fragmentMain(fragmentInput, materialOutput);
vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
color.rgb = max(color.rgb, vec3(0.0));
color.a = clamp(color.a, 0.0, 1.0);
colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
if (colorAccum.a > ALPHA_ACCUM_MAX) {
colorAccum.a = ALPHA_ACCUM_MAX;
break;
}
if (step.w == 0.0) {
step.w == 0.00001;
}
currentT += step.w;
positionUv = viewPosUv + currentT * viewDirUv;
if (currentT > endT) {
#if (INTERSECTION_COUNT == 1)
break;
#else
shapeIntersection = nextIntersection(ix);
if (shapeIntersection.entry.w == NO_HIT) {
break;
} else {
currentT = shapeIntersection.entry.w;
endT = shapeIntersection.exit.w;
positionUv = viewPosUv + currentT * viewDirUv;
}
#endif
}
pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas);
step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
}
colorAccum.a /= ALPHA_ACCUM_MAX;
#if defined(PICKING)
if (colorAccum.a == 0.0) {
discard;
}
out_FragColor = u_pickColor;
#elif defined(PICKING_VOXEL)
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 aJi=_(T(),1),HA=`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 lJi=_(T(),1),zA=`#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 {
vec4 intersections[INTERSECTION_COUNT * 2];
#if (INTERSECTION_COUNT > 1)
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);
}
#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) {
const int sortPasses = INTERSECTION_COUNT * 2 - 1;
for (int n = sortPasses; n > 0; --n) {
for (int i = 0; i < sortPasses; ++i) {
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;
}
}
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) {
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;
if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
shapeIntersection.entry = surfaceIntersection;
}
bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
if (exitPositive || enterNegativeFromPositive) {
shapeIntersection.exit = surfaceIntersection;
if (exitPositive) {
ix.index = passCount;
}
break;
}
}
return shapeIntersection;
}
#endif
`;var uJi=_(T(),1),KA=`uniform mat4 u_transformPositionViewToUv;
void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
if (logDepthOrDepth != 0.0) {
vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
eyeCoordinateDepth /= eyeCoordinateDepth.w;
vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
float t = dot(depthPositionUv - ray.pos, ray.dir);
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));
} else {
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));
}
}
`;var fJi=_(T(),1),JA=`uniform sampler2D u_clippingPlanesTexture;
uniform mat4 u_clippingPlanesMatrix;
vec4 intersectPlane(in Ray ray, in vec4 plane) {
vec3 n = plane.xyz;
float w = plane.w;
float a = dot(ray.pos, n);
float b = dot(ray.dir, n);
float t = -(w + a) / b;
return vec4(n, t);
}
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)
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);
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, u_clippingPlanesMatrix);
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, u_clippingPlanesMatrix);
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
}
`;var pJi=_(T(),1),xL=`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] = intersectHalfSpace(ray, minMaxAngle.x, false);
intersections[1] = 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);
if (hitPositiveHalfPlane(ray, intersection, true)) {
intersections[0].entry = -1.0 * farSide;
intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);
intersections[1].entry = intersection;
intersections[1].exit = farSide;
} else {
vec4 miss = vec4(normalize(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)
{
vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);
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) {
return RayShapeIntersection(first, last);
} else if (!exitFromInside && enterFromOutside) {
return RayShapeIntersection(-1.0 * farSide, first);
} else if (exitFromInside && !enterFromOutside) {
return RayShapeIntersection(last, farSide);
} else {
return RayShapeIntersection(miss, miss);
}
}
`;var yJi=_(T(),1),QA=`uniform vec3 u_renderMinBounds;
uniform vec3 u_renderMaxBounds;
RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)
{
vec3 t0 = (minBound - ray.pos) / ray.dir;
vec3 t1 = (maxBound - ray.pos) / ray.dir;
vec3 entries = min(t0, t1);
vec3 exits = max(t0, t1);
vec3 directions = sign(ray.dir);
float lastEntry = maxComponent(entries);
bvec3 isLastEntry = equal(entries, vec3(lastEntry));
vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
vec4 entry = vec4(entryNormal, lastEntry);
float firstExit = minComponent(exits);
bvec3 isFirstExit = equal(exits, vec3(firstExit));
vec3 exitNormal = vec3(isLastEntry) * directions;
vec4 exit = vec4(exitNormal, firstExit);
if (entry.w > exit.w) {
entry.w = NO_HIT;
exit.w = NO_HIT;
}
return RayShapeIntersection(entry, exit);
}
void intersectShape(in Ray ray, inout Intersections ix)
{
RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);
setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var xJi=_(T(),1),jA=`uniform vec2 u_cylinderRenderRadiusMinMax;
uniform vec2 u_cylinderRenderHeightMinMax;
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
uniform vec2 u_cylinderRenderAngleMinMax;
#endif
RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)
{
float zPosition = ray.pos.z;
float zDirection = ray.dir.z;
float tmin = (minMaxHeight.x - zPosition) / zDirection;
float tmax = (minMaxHeight.y - zPosition) / zDirection;
float signFlip = convex ? 1.0 : -1.0;
vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);
vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);
bool topEntry = zDirection < 0.0;
vec4 entry = topEntry ? intersectMax : intersectMin;
vec4 exit = topEntry ? intersectMin : intersectMax;
return RayShapeIntersection(entry, exit);
}
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;
vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);
vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);
return RayShapeIntersection(intersect1, intersect2);
}
RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)
{
RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);
return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
}
void intersectShape(Ray ray, inout Intersections ix)
{
ray.pos = ray.pos * 2.0 - 1.0;
ray.dir *= 2.0;
RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
if (outerIntersect.entry.w == NO_HIT) {
return;
}
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true);
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false);
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);
#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 TJi=_(T(),1),qA=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
uniform vec2 u_ellipsoidRenderLongitudeMinMax;
#endif
uniform float u_eccentricitySquared;
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
uniform vec2 u_clipMinMaxHeight;
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 relativeHeight, in bool convex)
{
vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);
vec3 position = ray.pos * radiiCorrection;
vec3 direction = ray.dir * radiiCorrection;
float a = dot(direction, direction);
float b = dot(direction, position);
float c = dot(position, position) - 1.0;
float determinant = b * b - a * c;
if (determinant < 0.0) {
vec4 miss = vec4(normalize(direction), NO_HIT);
return RayShapeIntersection(miss, miss);
}
determinant = sqrt(determinant);
float signB = b < 0.0 ? -1.0 : 1.0;
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 * normalize(position + tmin * direction);
vec3 d2 = directionScale * normalize(position + tmax * direction);
return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));
}
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;
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) {
return (b == 0.0)
? vec2(NO_HIT)
: vec2(-0.5 * c / b, NO_HIT);
}
determinant = sqrt(determinant);
float signB = b < 0.0 ? -1.0 : 1.0;
float t1 = (-b - signB * determinant) / a;
float t2 = c / (a * t1);
float tmin = min(t1, t2);
float tmax = max(t1, t2);
return vec2(tmin, tmax);
}
vec3 getConeNormal(in vec3 p, in bool convex) {
vec2 radial = -abs(p.z) * normalize(p.xy);
float zSign = (p.z < 0.0) ? -1.0 : 1.0;
float z = length(p.xy) * zSign;
float flip = (convex) ? -1.0 : 1.0;
return normalize(vec3(radial, z) * flip);
}
float getLatitudeConeShift(in float sinLatitude) {
float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
float primeVerticalRadius = inversesqrt(1.0 - x2);
return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
}
void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
ray.pos = ray.pos * u_ellipsoidRadiiUv;
ray.dir = ray.dir * u_ellipsoidRadiiUv;
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);
intersections[0].entry = -1.0 * farSide;
intersections[0].exit = farSide;
intersections[1].entry = miss;
intersections[1].exit = miss;
if (intersect.x == NO_HIT) {
return;
}
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) {
} 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) {
ray.pos = ray.pos * u_ellipsoidRadiiUv;
ray.dir = ray.dir * u_ellipsoidRadiiUv;
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);
}
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, inout Intersections ix) {
ray.pos = ray.pos * 2.0 - 1.0;
ray.dir *= 2.0;
RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
if (outerIntersect.entry.w == NO_HIT) {
return;
}
RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);
if (innerIntersect.entry.w == NO_HIT) {
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
} else {
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);
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true);
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false);
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);
}
#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
#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
#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 CJi=_(T(),1),oS=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {
intersectShape(ray, ix);
RayShapeIntersection intersection = getFirstIntersection(ix);
if (intersection.entry.w == NO_HIT) {
return intersection;
}
#if defined(CLIPPING_PLANES)
intersectClippingPlanes(ray, ix);
#endif
#if defined(DEPTH_TEST)
intersectDepth(screenCoord, ray, ix);
#endif
#if (INTERSECTION_COUNT > 1)
initializeIntersections(ix);
for (int i = 0; i < INTERSECTION_COUNT; ++i) {
intersection = nextIntersection(ix);
if (intersection.exit.w > 0.0) {
intersection.entry.w = max(intersection.entry.w, 0.0);
break;
}
}
#else
intersection.entry.w = max(intersection.entry.w, 0.0);
#endif
return intersection;
}
`;var LJi=_(T(),1),$A=`#if defined(BOX_HAS_SHAPE_BOUNDS)
uniform vec3 u_boxUvToShapeUvScale;
uniform vec3 u_boxUvToShapeUvTranslate;
#endif
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
return PointJacobianT(positionUv, mat3(0.5));
}
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
#else
return positionShape;
#endif
}
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
return pointJacobian;
}
vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
#else
return shapeUv;
#endif
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return shapeUv / u_boxUvToShapeUvScale;
#else
return shapeUv;
#endif
}
`;var RJi=_(T(),1),e9=`#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
uniform vec2 u_cylinderUvToShapeUvRadius;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
uniform vec2 u_cylinderUvToShapeUvHeight;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
uniform vec2 u_cylinderUvToShapeUvAngle;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
uniform vec2 u_cylinderShapeUvAngleMinMax;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
uniform float u_cylinderShapeUvAngleRangeZeroMid;
#endif
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
vec3 position = positionUv * 2.0 - 1.0;
float radius = length(position.xy);
vec3 radial = normalize(vec3(position.xy, 0.0));
float height = positionUv.z;
vec3 z = vec3(0.0, 0.0, 1.0);
float angle = atan(position.y, position.x);
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
vec3 point = vec3(radius, angle, height);
mat3 jacobianT = mat3(radial, z, east / length(position.xy));
return PointJacobianT(point, jacobianT);
}
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
float radius = positionShape.x;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y;
#endif
float angle = (positionShape.y + czm_pi) / czm_twoPi;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)
angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;
#elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;
#endif
angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y;
#endif
float height = positionShape.z;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y;
#endif
return vec3(radius, angle, height);
}
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
return pointJacobian;
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
float radius = shapeUv.x;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
radius /= u_cylinderUvToShapeUvRadius.x;
#endif
float angle = shapeUv.y * czm_twoPi;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
angle /= u_cylinderUvToShapeUvAngle.x;
#endif
float height = shapeUv.z;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
height /= u_cylinderUvToShapeUvHeight.x;
#endif
return vec3(radius, angle, height);
}
`;var EJi=_(T(),1),t9=`uniform vec3 u_ellipsoidRadiiUv;
uniform vec2 u_evoluteScale;
uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
#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_ellipsoidUvToShapeUvLongitude;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
uniform vec2 u_ellipsoidUvToShapeUvLatitude;
#endif
uniform float u_ellipsoidInverseHeightDifferenceUv;
vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
vec2 p = abs(pos);
vec2 inverseRadii = 1.0 / radii;
vec2 tTrigs = vec2(0.7071067811865476);
vec2 v = radii * tTrigs;
vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
const int iterations = 3;
for (int i = 0; i < iterations; ++i) {
vec2 q = normalize(p - evolute) * length(v - evolute);
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));
}
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
vec3 position = positionUv * 2.0 - 1.0;
position = position * u_ellipsoidRadiiUv;
float longitude = atan(position.y, position.x);
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
float distanceFromZAxis = length(position.xy);
vec2 posEllipse = vec2(distanceFromZAxis, position.z);
vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz);
vec2 surfacePoint = surfacePointAndRadius.xy;
vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz);
float latitude = atan(normal2d.y, normal2d.x);
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));
vec3 point = vec3(longitude, latitude, height);
mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
return PointJacobianT(point, jacobianT);
}
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
float longitude = (positionShape.x + czm_pi) / czm_twoPi;
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
#endif
float latitude = (positionShape.y + czm_piOverTwo) / czm_pi;
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
#endif
float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv;
return vec3(longitude, latitude, height);
}
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
return pointJacobian;
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
float longitude = shapeUv.x * czm_twoPi;
#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
longitude /= u_ellipsoidUvToShapeUvLongitude.x;
#endif
float latitude = shapeUv.y * czm_pi;
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
latitude /= u_ellipsoidUvToShapeUvLatitude.x;
#endif
float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv;
return vec3(longitude, latitude, height);
}
`;var IJi=_(T(),1),n9=`#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;
uniform ivec3 u_inputDimensions;
#if defined(PADDING)
uniform ivec3 u_paddingBefore;
#endif
struct OctreeNodeData {
int data;
int flag;
};
struct TraversalData {
ivec4 octreeCoords;
int parentOctreeIndex;
};
struct SampleData {
int megatextureIndex;
ivec4 tileCoords;
vec3 tileUv;
vec3 inputCoordinate;
#if (SAMPLE_COUNT > 1)
float weight;
#endif
};
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 vec3 shapePosition, in ivec4 octreeCoords) {
float dimAtLevel = exp2(float(octreeCoords.w));
return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
}
vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
vec3 tileUv = getTileUv(shapePosition, octreeCoords);
return clamp(tileUv, vec3(0.0), vec3(1.0));
}
void addSampleCoordinates(in vec3 shapePosition, inout SampleData sampleData) {
vec3 tileUv = getClampedTileUv(shapePosition, 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))
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;
float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
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;
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;
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 vec3 shapePosition, inout TraversalData traversalData) {
float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w));
vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;
vec3 end = start + vec3(sizeAtLevel);
OctreeNodeData childData;
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
vec3 center = 0.5 * (start + end);
vec3 childCoord = step(center, shapePosition);
ivec4 octreeCoords = traversalData.octreeCoords;
traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);
childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));
if (childData.flag != OCTREE_FLAG_INTERNAL) {
break;
}
start = mix(start, center, childCoord);
end = mix(center, end, childCoord);
traversalData.parentOctreeIndex = childData.data;
}
return childData;
}
void traverseOctreeFromBeginning(in vec3 shapePosition, 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(shapePosition, traversalData);
}
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[0]);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
addSampleCoordinates(shapePosition, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[1]);
#endif
}
bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {
return clamp(v, minVal, maxVal) == v;
}
bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {
vec3 tileUv = getTileUv(shapePosition, octreeCoords);
bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));
return inside || octreeCoords.w == 0;
}
void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
if (insideTile(shapePosition, traversalData.octreeCoords)) {
for (int i = 0; i < SAMPLE_COUNT; i++) {
addSampleCoordinates(shapePosition, sampleDatas[i]);
}
return;
}
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
traversalData.octreeCoords.xyz /= 2;
traversalData.octreeCoords.w -= 1;
if (insideTile(shapePosition, traversalData.octreeCoords)) {
break;
}
traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
}
OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[0]);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
addSampleCoordinates(shapePosition, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[1]);
#endif
}
`;var wJi=_(T(),1),i9=`uniform ivec2 u_megatextureSliceDimensions;
uniform ivec2 u_megatextureTileDimensions;
uniform vec2 u_megatextureVoxelSizeUv;
uniform vec2 u_megatextureSliceSizeUv;
uniform vec2 u_megatextureTileSizeUv;
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;
}
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
int tileIndex = sampleData.megatextureIndex;
vec3 voxelCoord = sampleData.inputCoordinate;
#if defined(NEAREST_SAMPLING)
voxelCoord = floor(voxelCoord) + vec3(0.5);
#endif
vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);
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);
vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;
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
}
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
#if (SAMPLE_COUNT == 1)
return getPropertiesFromMegatexture(sampleDatas[0]);
#else
Properties properties = clearProperties();
for (int i = 0; i < SAMPLE_COUNT; ++i) {
float weight = sampleDatas[i].weight;
if (weight > 0.0) {
Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
tempProperties = scaleProperties(tempProperties, weight);
properties = sumProperties(properties, tempProperties);
}
}
return properties;
#endif
}
`;var vJi=_(T(),1),eyt={Z_UP:0,Y_UP:1},gm=Object.freeze(eyt);function tyt(e){let t=new Lx;this.shaderBuilder=t;let n=e._customShader,i=St(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let y=o[p];t.addUniform(y.type,p,xe.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",xe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=c(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([HA]),e.provider.metadataOrder===gm.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,xe.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,xe.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,xe.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,xe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",n9,BA,zA,i9]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,xe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,xe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,xe.FRAGMENT),t.addFragmentLines([JA])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,xe.FRAGMENT),t.addFragmentLines([KA])),a==="BOX"?t.addFragmentLines([$A,QA,oS]):a==="CYLINDER"?t.addFragmentLines([e9,xL,jA,oS]):a==="ELLIPSOID"&&t.addFragmentLines([t9,xL,qA,oS]),t.addFragmentLines([YA]);let l=e._shape,d=l.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let y=d[p];c(y)&&(y=y===!0?void 0:y,t.addDefine(p,y,xe.FRAGMENT))}let u=l.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,xe.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,xe.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,xe.FRAGMENT),(!m.equals(e.paddingBefore,m.ZERO)||!m.equals(e.paddingAfter,m.ZERO))&&t.addDefine("PADDING",void 0,xe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,xe.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,xe.FRAGMENT);let f=e._traversal;t.addDefine("SAMPLE_COUNT",`${f._sampleCount}`,xe.FRAGMENT)}var o9=tyt;var dQi=_(T(),1);function nyt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,l=o.length,d=c(s)&&c(a);n.addDefine("METADATA_COUNT",l,xe.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=o[P],b=`PropertyStatistics_${F}`,G=`PropertyStatistics_${F}`;n.addStruct(b,G,xe.FRAGMENT);let X=YD(N);n.addStructField(b,X,"min"),n.addStructField(b,X,"max")}let u="Statistics",f="Statistics",p="statistics";n.addStruct(u,f,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=`PropertyStatistics_${F}`,b=F;n.addStructField(u,N,b)}let y="Metadata",h="Metadata",g="metadata";n.addStruct(y,h,xe.FRAGMENT),n.addStructField(y,f,p);for(let P=0;P<l;P++){let F=i[P],N=o[P],b=YD(N);n.addStructField(y,b,F)}for(let P=0;P<l;P++){let F=i[P],N=o[P],b=oyt(N),G=`VoxelProperty_${F}`,X=`VoxelProperty_${F}`;n.addStruct(G,X,xe.FRAGMENT),n.addStructField(G,b,"partialDerivativeLocal"),n.addStructField(G,b,"partialDerivativeWorld"),n.addStructField(G,b,"partialDerivativeView"),n.addStructField(G,b,"partialDerivativeValid")}let x="Voxel",S="Voxel",V="voxel";n.addStruct(x,S,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=`VoxelProperty_${F}`;n.addStructField(x,N,F)}n.addStructField(x,"vec3","positionEC"),n.addStructField(x,"vec3","positionUv"),n.addStructField(x,"vec3","positionShapeUv"),n.addStructField(x,"vec3","positionUvLocal"),n.addStructField(x,"vec3","viewDirUv"),n.addStructField(x,"vec3","viewDirWorld"),n.addStructField(x,"vec3","surfaceNormal"),n.addStructField(x,"float","travelDistance"),n.addStructField(x,"int","stepCount"),n.addStructField(x,"int","tileIndex"),n.addStructField(x,"int","sampleIndex");let Z="FragmentInput";n.addStruct(Z,"FragmentInput",xe.FRAGMENT),n.addStructField(Z,h,g),n.addStructField(Z,S,V);let E="Properties",I="Properties",v="properties";n.addStruct(E,I,xe.FRAGMENT);for(let P=0;P<l;P++){let F=i[P],N=o[P],b=YD(N);n.addStructField(E,b,F)}{let P="clearProperties";n.addFunction(P,`${I} clearProperties()`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F],b=o[F],G=r[F],X=YD(b,G);n.addFunctionLines(P,[`${v}.${N} = ${X}(0.0);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="sumProperties";n.addFunction(P,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`${v}.${N} = propertiesA.${N} + propertiesB.${N};`])}n.addFunctionLines(P,[`return ${v};`])}{let P="scaleProperties";n.addFunction(P,`${I} scaleProperties(${I} ${v}, float scale)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} scaledProperties = ${v};`]);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`scaledProperties.${N} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`${v}.${N} = mix(propertiesA.${N}, propertiesB.${N}, mixFactor);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${I} ${v}, inout ${h} ${g})`,xe.FRAGMENT);for(let F=0;F<l;F++){let N=i[F];n.addFunctionLines(P,[`${g}.${N} = ${v}.${N};`])}}if(d){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${f} ${p})`,xe.FRAGMENT);for(let F=0;F<l;F++){let N=i[F],b=o[F],G=lt.getComponentCount(b);for(let X=0;X<G;X++){let W=ryt(b,X),A=s[F][X],k=a[F][X];!c(A)||!c(k)||n.addFunctionLines(P,[`${p}.${N}.min${W} = ${ZTe(A)};`,`${p}.${N}.max${W} = ${ZTe(k)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,xe.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let F=0;F<l;F++){let N=i[F],b=o[F],G=r[F],X=iyt(b,G);n.addFunctionLines(P,[`properties.${N} = texture(u_megatextureTextures[${F}], texcoord)${X};`])}n.addFunctionLines(P,[`return ${v};`])}}function YD(e){if(e===lt.SCALAR)return"float";if(e===lt.VEC2)return"vec2";if(e===lt.VEC3)return"vec3";if(e===lt.VEC4)return"vec4"}function iyt(e){if(e===lt.SCALAR)return".r";if(e===lt.VEC2)return".ra";if(e===lt.VEC3)return".rgb";if(e===lt.VEC4)return""}function oyt(e){if(e===lt.SCALAR)return"vec3";if(e===lt.VEC2)return"mat2";if(e===lt.VEC3)return"mat3";if(e===lt.VEC4)return"mat4"}function ZTe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function ryt(e,t){return e===lt.SCALAR?"":`[${t}]`}var r9=nyt;function syt(e,t){let n=new o9(e);r9(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let S="getClippingPlane",V=c0(o,t),Z=0,R=V.indexOf(")")+1,E=V.indexOf("{",R)+1,I=V.indexOf("}",E),v=V.slice(Z,R),P=V.slice(E,I);i.addFunction(S,v,xe.FRAGMENT),i.addFunctionLines(S,[P])}let s=i.clone();s.addDefine("PICKING",void 0,xe.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,xe.FRAGMENT);let l=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),f=Oe.fromCache({cull:{enabled:!0,face:_i.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),y=e._depthTest,h=new et({vertexArray:p,primitiveType:ve.TRIANGLES,renderState:f,shaderProgram:l,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Xe.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),g=et.shallowClone(h,new et);g.shaderProgram=d,g.pickOnly=!0;let x=et.shallowClone(h,new et);if(x.shaderProgram=u,x.pickOnly=!0,c(e._drawCommand)){let S=e._drawCommand;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(c(e._drawCommandPick)){let S=e._drawCommandPick;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}if(c(e._drawCommandPickVoxel)){let S=e._drawCommandPickVoxel;S.shaderProgram=S.shaderProgram&&S.shaderProgram.destroy()}e._drawCommand=h,e._drawCommandPick=g,e._drawCommandPickVoxel=x}var s9=syt;var JQi=_(T(),1);var LQi=_(T(),1),ayt={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"},rS=Object.freeze(ayt);var MQi=_(T(),1);var RQi=_(T(),1);function cyt(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 a9=cyt;function _L(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}_L.prototype.getTexture=function(e){return this._textures[e]};function lyt(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];c(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}_L.prototype.loadTexture2D=function(e,t){c(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):lyt(this,e,t)};function dyt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?HD(o,r,n):uyt(o,r,n),a=e._textures[i];c(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function HD(e,t,n){let{typedArray:i,sampler:o}=e,r=c(i)?GTe(e,n):new Pt({context:n,source:t,sampler:o});return RTe(o)&&r.generateMipmap(),r}function uyt(e,t,n){let{typedArray:i,sampler:o}=e,r=RTe(o),s=o.wrapS===xn.REPEAT||o.wrapS===xn.MIRRORED_REPEAT||o.wrapT===xn.REPEAT||o.wrapT===xn.MIRRORED_REPEAT,{width:a,height:l}=c(i)?e:t,d=[a,l].every(w.isPowerOfTwo);if((r||s)&&!d)if(c(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let f=a9(i,a,l),p=py(f);return HD({sampler:o},p,n)}}else{let f=py(t);return HD(e,f,n)}else return HD(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."),GTe(e,n)}function RTe(e){return[Jt.NEAREST_MIPMAP_NEAREST,Jt.NEAREST_MIPMAP_LINEAR,Jt.LINEAR_MIPMAP_NEAREST,Jt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function GTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Pt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}_L.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];dyt(this,o,t)}n.length=0};_L.prototype.isDestroyed=function(){return!1};_L.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 he(this)};var c9=_L;function l9(e){e=e??z.EMPTY_OBJECT,this.mode=e.mode??bb.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??z.EMPTY_OBJECT,this.varyings=e.varyings??z.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Iy.INHERIT,this._textureManager=new c9,this._defaultTexture=void 0,this.uniformMap=myt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},pyt(this),byt(this)}function myt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i],r=o.type;if(r===rS.SAMPLER_CUBE)throw new L("CustomShader does not support samplerCube uniforms");r===rS.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=fyt(e,i)):n[i]=hyt(e,i)}return n}function fyt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function hyt(e,t){return function(){return e.uniforms[t].value}}function sS(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function pyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;c(r)&&(o=e.usedVariablesVertex.attributeSet,sS(r,t,o),o=e.usedVariablesVertex.featureIdSet,sS(r,n,o),o=e.usedVariablesVertex.metadataSet,sS(r,i,o));let s=e.fragmentShaderText;if(c(s)){o=e.usedVariablesFragment.attributeSet,sS(s,t,o),o=e.usedVariablesFragment.featureIdSet,sS(s,n,o),o=e.usedVariablesFragment.metadataSet,sS(s,i,o);let a=/material\.(\w+)/g,l=e.usedVariablesFragment.materialSet;sS(s,a,l)}}function ETe(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 Ic(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${ETe(t)} is not available in the ${i} shader. Did you mean ${ETe(n)} instead?`;throw new L(o)}}function byt(e){let t=e.usedVariablesVertex.attributeSet;Ic(t,"position","positionMC","vertex"),Ic(t,"normal","normalMC","vertex"),Ic(t,"tangent","tangentMC","vertex"),Ic(t,"bitangent","bitangentMC","vertex"),Ic(t,"positionWC","positionMC","vertex"),Ic(t,"positionEC","positionMC","vertex"),Ic(t,"normalEC","normalMC","vertex"),Ic(t,"tangentEC","tangentMC","vertex"),Ic(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Ic(n,"position","positionEC","fragment"),Ic(n,"normal","normalEC","fragment"),Ic(n,"tangent","tangentEC","fragment"),Ic(n,"bitangent","bitangentEC","fragment"),Ic(n,"normalMC","normalEC","fragment"),Ic(n,"tangentMC","tangentEC","fragment"),Ic(n,"bitangentMC","bitangentEC","fragment")}l9.prototype.setUniform=function(e,t){if(C.typeOf.string("uniformName",e),C.defined("value",t),!c(this.uniforms[e]))throw new L(`Uniform ${e} must be declared in the CustomShader constructor.`);let n=this.uniforms[e];n.type===rS.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):c(t.clone)?n.value=t.clone(n.value):n.value=t};l9.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};l9.prototype.isDestroyed=function(){return!1};l9.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),he(this)};var aS=l9;var rji=_(T(),1);function C0(e){if(C.typeOf.object("options",e),!c(e.loader)){if(!c(e.metadata))throw new L("One of loader and metadata must be defined.");if(!Array.isArray(e.metadata))throw new L("metadata must be an array of TypedArrays.")}let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(C0.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});C0.fromMetadataArray=function(e){if(C.typeOf.object("metadata",e),!Array.isArray(e))throw new L("metadata must be an array of TypedArrays.");return new C0({metadata:e})};C0.fromGltf=async function(e){C.typeOf.object("resource",e);let t=new nf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new C0({loader:t})};C0.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!c(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=yyt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function yyt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(u=>u.class.id===i),{properties:l}=a,d=new Array(o.length);for(let u=0;u<e.length;u++){let f=l[o[u]].attribute,p=e.find(x=>x.name===f);if(!c(p))continue;let y=At.toComponentDatatype(s[u]),h=lt.getComponentCount(r[u]),g=p.count*h;d[u]=q.createArrayBufferView(y,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,g)}return d}C0.prototype.isDestroyed=function(){return!1};C0.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),he(this)};var cS=C0;var Dji=_(T(),1);var hji=_(T(),1);function mp(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ue,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=mp.DefaultMinBounds.clone(),this._maxBounds=mp.DefaultMaxBounds.clone(),this.shaderUniforms={renderMinBounds:new m,renderMaxBounds:new m,boxUvToShapeUvScale:new m,boxUvToShapeUvTranslate:new m},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var gyt=new m,G8=new m,xyt=new te,_yt=new m,Tyt=new m,Syt=new m,Cyt=new m,XTe=M.fromRotationTranslation(te.fromUniformScale(.5,new te),new m(.5,.5,.5),new M);mp.prototype.update=function(e,t,n,i,o){C.typeOf.object("modelMatrix",e),C.typeOf.object("minBounds",t),C.typeOf.object("maxBounds",n),i=i??t.clone(_yt),o=o??n.clone(Tyt),t=m.clone(t,this._minBounds),n=m.clone(n,this._maxBounds);let r=m.clamp(t,i,o,Syt),s=m.clamp(n,i,o,Cyt),a=M.getScale(e,G8);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;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=X8(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ue.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:l,shaderDefines:d}=this;for(let y in d)d.hasOwnProperty(y)&&(d[y]=void 0);let u=0;d.BOX_INTERSECTION_INDEX=u,u+=1,l.renderMinBounds=M.multiplyByPoint(XTe,r,l.renderMinBounds),l.renderMaxBounds=M.multiplyByPoint(XTe,s,l.renderMaxBounds),d.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,p=n;return l.boxUvToShapeUvScale=m.fromElements(2/(f.x===p.x?1:p.x-f.x),2/(f.y===p.y?1:p.y-f.y),2/(f.z===p.z?1:p.z-f.z),l.boxUvToShapeUvScale),l.boxUvToShapeUvTranslate=m.fromElements(-l.boxUvToShapeUvScale.x*(f.x*.5+.5),-l.boxUvToShapeUvScale.y*(f.y*.5+.5),-l.boxUvToShapeUvScale.z*(f.z*.5+.5),l.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=u,!0};var zD=new m,E8=new m;mp.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){C.typeOf.number("tileLevel",e),C.typeOf.number("tileX",t),C.typeOf.number("tileY",n),C.typeOf.number("tileZ",i),C.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=m.fromElements(w.lerp(r.x,s.x,a*t),w.lerp(r.y,s.y,a*n),w.lerp(r.z,s.z,a*i),zD),d=m.fromElements(w.lerp(r.x,s.x,a*(t+1)),w.lerp(r.y,s.y,a*(n+1)),w.lerp(r.z,s.z,a*(i+1)),E8);return X8(l,d,this.shapeTransform,o)};var ITe=new m;mp.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){C.typeOf.object("spatialNode",e),C.typeOf.object("tileDimensions",t),C.typeOf.object("tileUv",n),C.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,ITe),s=m.multiplyByScalar(r,o,ITe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,zD),o,zD),l=m.add(a,s,E8),d=this._minBounds,u=this._maxBounds,f=m.fromElements(w.lerp(d.x,u.x,a.x),w.lerp(d.y,u.y,a.y),w.lerp(d.z,u.z,a.z),zD),p=m.fromElements(w.lerp(d.x,u.x,l.x),w.lerp(d.y,u.y,l.y),w.lerp(d.z,u.z,l.z),E8);return X8(f,p,this.shapeTransform,i)};mp.DefaultMinBounds=Object.freeze(new m(-1,-1,-1));mp.DefaultMaxBounds=Object.freeze(new m(1,1,1));function X8(e,t,n,i){let o=mp.DefaultMinBounds,r=mp.DefaultMaxBounds;if(m.equals(e,o)&&m.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,G8),l=m.midpoint(e,t,gyt);i.center=M.multiplyByPoint(n,l,i.center),a=m.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),G8);let d=M.getRotation(n,xyt);i.halfAxes=te.setScale(d,a,i.halfAxes)}return i}var lS=mp;var Lji=_(T(),1);function V0(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ue,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=V0.DefaultMinBounds.clone(),this._maxBounds=V0.DefaultMaxBounds.clone(),this.shaderUniforms={cylinderRenderRadiusMinMax:new D,cylinderRenderAngleMinMax:new D,cylinderRenderHeightMinMax:new D,cylinderUvToShapeUvRadius:new D,cylinderUvToShapeUvAngle:new D,cylinderUvToShapeUvHeight:new D,cylinderShapeUvAngleMinMax:new D,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={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_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED: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}var PTe=new m,Vyt=new m,Lyt=new m,Zyt=new m,Ryt=new m;V0.prototype.update=function(e,t,n,i,o){C.typeOf.object("modelMatrix",e),C.typeOf.object("minBounds",t),C.typeOf.object("maxBounds",n),i=i??t.clone(Vyt),o=o??n.clone(Lyt),t=m.clone(t,this._minBounds),n=m.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=V0,a=s.y-r.y,l=.5*a,d=w.EPSILON10,u=w.EPSILON3,f=w.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=w.negativePiToPi(t.y),n.y=w.negativePiToPi(n.y),i.y=w.negativePiToPi(i.y),o.y=w.negativePiToPi(o.y);let p=m.maximumByComponent(t,i,Zyt),y=m.minimumByComponent(n,o,Ryt),h=M.getScale(e,PTe);if(y.x===0||p.x>y.x||p.z>y.z||w.equalsEpsilon(h.x,0,void 0,d)||w.equalsEpsilon(h.y,0,void 0,d)||w.equalsEpsilon(h.z,0,void 0,d))return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=w8(p,y,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ue.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let g=t.x===r.x&&n.x===s.x,x=n.y<t.y,S=n.y-t.y+x*a,V=S>l+f&&S<a-f,Z=S<l-f,R=S>=l-f&&S<=l+f,E=V||Z||R,I=w.equalsEpsilon(t.y,r.y,void 0,u),v=w.equalsEpsilon(n.y,s.y,void 0,u),P=t.z===r.z&&n.z===s.z,F=p.x===r.x,N=y.y<p.y,b=y.y-p.y+N*a,G=b>=l-f&&b<a-f,X=b>f&&b<l-f,W=b<=f,A=G||X||W,{shaderUniforms:k,shaderDefines:B}=this;for(let H in B)B.hasOwnProperty(H)&&(B[H]=void 0);let O=0;if(B.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,F||(B.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,B.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),k.cylinderRenderRadiusMinMax=D.fromElements(p.x,y.x,k.cylinderRenderRadiusMinMax),p.x===y.x&&(B.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!g){B.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let H=n.x-t.x,U=0,K=1;H!==0&&(U=1/H,K=-t.x/H),k.cylinderUvToShapeUvRadius=D.fromElements(U,K,k.cylinderUvToShapeUvRadius)}if(!P){B.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let H=n.z-t.z,U=0,K=1;H!==0&&(U=2/H,K=-(t.z+1)/H),k.cylinderUvToShapeUvHeight=D.fromElements(U,K,k.cylinderUvToShapeUvHeight)}if(k.cylinderRenderHeightMinMax=D.fromElements(p.z,y.z,k.cylinderRenderHeightMinMax),x&&(B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),A&&(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,B.CYLINDER_INTERSECTION_INDEX_ANGLE=O,G?(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):X?(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):W&&(B.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),k.cylinderRenderAngleMinMax=D.fromElements(p.y,y.y,k.cylinderRenderAngleMinMax)),E){B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,I&&(B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),v&&(B.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let H=(t.y-r.y)/a,U=(n.y-r.y)/a,K=1-S/a;if(k.cylinderShapeUvAngleMinMax=D.fromElements(H,U,k.cylinderShapeUvAngleMinMax),k.cylinderShapeUvAngleRangeZeroMid=(U+.5*K)%1,S<=f)k.cylinderUvToShapeUvAngle=D.fromElements(0,1,k.cylinderUvToShapeUvAngle);else{let Q=a/S,ie=-(t.y-r.y)/S;k.cylinderUvToShapeUvAngle=D.fromElements(Q,ie,k.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=O,!0};var KD=new m,W8=new m;V0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){C.typeOf.number("tileLevel",e),C.typeOf.number("tileX",t),C.typeOf.number("tileY",n),C.typeOf.number("tileZ",i),C.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=m.fromElements(w.lerp(r.x,s.x,t*a),w.lerp(r.y,s.y,n*a),w.lerp(r.z,s.z,i*a),KD),d=m.fromElements(w.lerp(r.x,s.x,(t+1)*a),w.lerp(r.y,s.y,(n+1)*a),w.lerp(r.z,s.z,(i+1)*a),W8);return w8(l,d,this.shapeTransform,o)};var WTe=new m;V0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){C.typeOf.object("spatialNode",e),C.typeOf.object("tileDimensions",t),C.typeOf.object("tileUv",n),C.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,WTe),s=m.multiplyByScalar(r,o,WTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,KD),o,KD),l=m.add(a,s,W8),d=this._minBounds,u=this._maxBounds,f=m.fromElements(w.lerp(d.x,u.x,a.x),w.lerp(d.y,u.y,a.y),w.lerp(d.z,u.z,a.z),KD),p=m.fromElements(w.lerp(d.x,u.x,l.x),w.lerp(d.y,u.y,l.y),w.lerp(d.z,u.z,l.z),W8);return w8(f,p,this.shapeTransform,i)};V0.DefaultMinBounds=Object.freeze(new m(0,-w.PI,-1));V0.DefaultMaxBounds=Object.freeze(new m(1,+w.PI,1));var Gyt=5,Eyt=new Array(Gyt),Xyt=new m,Iyt=new te,Wyt=new M,wyt=new M,Pyt=new M,I8=new M,vyt=new m,Fyt=new m,Ayt=new m,vTe=new Array(8);for(let e=0;e<8;e++)vTe[e]=new m;function wTe(e,t,n){return Math.abs(ce.dot(e,t))<n}function Myt(e){let t=M.getColumn(e,0,vyt),n=M.getColumn(e,1,Fyt),i=M.getColumn(e,2,Ayt),o=w.EPSILON4;return wTe(t,n,o)&&wTe(n,i,o)}function Nyt(e,t){let n=vTe;m.fromElements(-.5,-.5,-.5,n[0]),m.fromElements(-.5,-.5,.5,n[1]),m.fromElements(-.5,.5,-.5,n[2]),m.fromElements(-.5,.5,.5,n[3]),m.fromElements(.5,-.5,-.5,n[4]),m.fromElements(.5,-.5,.5,n[5]),m.fromElements(.5,.5,-.5,n[6]),m.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return Xn.fromPoints(n,t)}function w8(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+w.TWO_PI:t.y,l=e.z,d=t.z,u=a-s,f=s+u*.5,p=Eyt,y=0;p[y++]=s,p[y++]=a,p[y++]=f,u>w.PI&&(p[y++]=f-w.PI_OVER_TWO,p[y++]=f+w.PI_OVER_TWO);let h=Number.POSITIVE_INFINITY,g=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let k=0;k<y;++k){let B=p[k]-f,O=Math.cos(B),H=Math.sin(B),U=O*o,K=H*o,Q=O*r,ie=H*r;h=Math.min(h,U,Q),g=Math.min(g,K,ie),x=Math.max(x,U,Q),S=Math.max(S,K,ie)}let V=x-h,Z=S-g,R=d-l,E=(h+x)*.5,I=(g+S)*.5,v=(l+d)*.5,P=m.fromElements(E,I,v,Xyt),F=te.fromRotationZ(f,Iyt),N=m.fromElements(V,Z,R,PTe),b=M.fromScale(N,Pyt),G=M.fromRotation(F,wyt),X=M.fromTranslation(P,Wyt),W=M.multiplyTransformation(G,M.multiplyTransformation(X,b,I8),I8),A=M.multiplyTransformation(n,W,I8);return Myt(A)?Xn.fromTransformation(A,i):Nyt(A,i)}var dS=V0;var Aji=_(T(),1);function L0(){this.orientedBoundingBox=new Xn,this.boundingSphere=new ue,this.boundTransform=new M,this.shapeTransform=new M,this._rectangle=new de,this._minimumHeight=L0.DefaultMinBounds.z,this._maximumHeight=L0.DefaultMaxBounds.z,this._ellipsoid=new re,this._translation=new m,this._rotation=new te,this.shaderUniforms={ellipsoidRadiiUv:new m,eccentricitySquared:0,evoluteScale:new D,ellipsoidInverseRadiiSquaredUv:new m,ellipsoidRenderLongitudeMinMax:new D,ellipsoidShapeUvLongitudeMinMaxMid:new m,ellipsoidUvToShapeUvLongitude:new D,ellipsoidUvToShapeUvLatitude:new D,ellipsoidRenderLatitudeSinMinMax:new D,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new D},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}var kyt=new m,Uyt=new m,Oyt=new m,Dyt=new m,Byt=new m,Yyt=new m,Hyt=new m,zyt=new m,Kyt=new te,FTe=new m,ATe=new m,Jyt=new de;L0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=L0;i=i??r,o=o??s,C.typeOf.object("modelMatrix",e),C.typeOf.object("minBounds",t),C.typeOf.object("maxBounds",n);let a=w.EPSILON10,l=w.EPSILON3,d=w.EPSILON10,u=w.EPSILON10,f=w.EPSILON3,p=M.getScale(e,zyt),y=m.clone(r,kyt);y.z=-m.minimumComponent(p);let h=m.clamp(t,y,s,Uyt),g=m.clamp(n,y,s,Oyt),x=m.clamp(i,y,s,Dyt),S=m.clamp(o,y,s,Byt),V=m.maximumByComponent(h,x,Yyt),Z=m.minimumByComponent(g,S,Hyt),R=m.add(p,m.fromElements(g.z,g.z,g.z,FTe),FTe),E=m.maximumComponent(R),I=m.add(p,m.fromElements(Z.z,Z.z,Z.z,ATe),ATe);if(V.y>Z.y||V.y===s.y||Z.y===r.y||V.z>Z.z||w.equalsEpsilon(I,m.ZERO,void 0,a))return!1;this._rectangle=de.fromRadians(h.x,h.y,g.x,g.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=re.fromCartesian3(p,this._ellipsoid),this._minimumHeight=h.z,this._maximumHeight=g.z;let v=de.fromRadians(V.x,V.y,Z.x,Z.y,Jyt);this.orientedBoundingBox=P8(v,V.z,Z.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=M.fromRotationTranslation(te.setScale(this._rotation,R,Kyt),this._translation,this.shapeTransform),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ue.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,F=.5*P,N=Z.x<V.x,b=Z.x-V.x+N*P,G=b<=d,X=b>=F-d&&b<P-d,W=b>d&&b<F-d,A=G||X||W,k=g.x<h.x,B=g.x-h.x+k*P,O=B>F+d&&B<P-d,H=B>=F-d&&B<=F+d,U=B<F-d,K=O||H||U,Q=Z.y<-f,ie=Z.y>=-f&&Z.y<=+f,j=Z.y>+f&&Z.y<s.y-u,$=Q||ie||j,ne=V.y>r.y+u&&V.y<-f,be=V.y>=-f&&V.y<=+f,Ce=V.y>+f,me=ne||be||Ce,_e=$||me,Ve=g.y-h.y,Ie=g.y<-f,Ze=g.y>=-f&&g.y<=+f,De=g.y>+f&&g.y<s.y-u,Ke=Ie||Ze||De,rt=h.y>r.y+u&&h.y<-f,Xt=h.y>=-f&&h.y<=+f,Ht=h.y>+f,mn=Ke||(rt||Xt||Ht),{shaderUniforms:Dt,shaderDefines:Lt}=this;for(let bt in Lt)Lt.hasOwnProperty(bt)&&(Lt[bt]=void 0);Dt.ellipsoidRadiiUv=m.divideByScalar(R,E,Dt.ellipsoidRadiiUv);let{x:Vi,z:ln}=Dt.ellipsoidRadiiUv,ge=ln/Vi;Dt.eccentricitySquared=1-ge*ge,Dt.evoluteScale=D.fromElements((Vi*Vi-ln*ln)/Vi,(ln*ln-Vi*Vi)/ln,Dt.evoluteScale),Dt.ellipsoidInverseRadiiSquaredUv=m.divideComponents(m.ONE,m.multiplyComponents(Dt.ellipsoidRadiiUv,Dt.ellipsoidRadiiUv,Dt.ellipsoidInverseRadiiSquaredUv),Dt.ellipsoidInverseRadiiSquaredUv);let Le=0;Lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Le,Le+=1,Lt.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Le,Le+=1,Dt.clipMinMaxHeight=D.fromElements((V.z-g.z)/E,(Z.z-g.z)/E,Dt.clipMinMaxHeight);let yn=(g.z-h.z)/E;if(Dt.ellipsoidInverseHeightDifferenceUv=1/yn,h.z===g.z&&(Dt.ellipsoidInverseHeightDifferenceUv=0),A&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Lt.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Le,X?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Le+=1):W?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Le+=2):G&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Le+=2),Dt.ellipsoidRenderLongitudeMinMax=D.fromElements(V.x,Z.x,Dt.ellipsoidRenderLongitudeMinMax)),K)if(Lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,g.x<h.x&&(Lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),B<=d)Dt.ellipsoidUvToShapeUvLongitude=D.fromElements(0,1,Dt.ellipsoidUvToShapeUvLongitude);else{let ro=P/B,Xo=-(h.x-r.x)/B;Dt.ellipsoidUvToShapeUvLongitude=D.fromElements(ro,Xo,Dt.ellipsoidUvToShapeUvLongitude)}if(A){let bt=w.equalsEpsilon(V.x,r.x,void 0,l),ro=w.equalsEpsilon(Z.x,s.x,void 0,l);bt&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),ro&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Xo=(h.x-r.x)/P,ra=(g.x-r.x)/P,Wr=(Z.x-r.x)/P,_s=1-b/P,Ae=(Wr+.5*_s)%1;Dt.ellipsoidShapeUvLongitudeMinMaxMid=m.fromElements(Xo,ra,Ae,Dt.ellipsoidShapeUvLongitudeMinMaxMid)}if(_e&&(me&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Le,ne?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Le+=1):be?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Le+=1):Ce&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Le+=2)),$&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Lt.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Le,Q?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Le+=2):ie?(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Le+=1):j&&(Lt.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Le+=1)),Dt.ellipsoidRenderLatitudeSinMinMax=D.fromElements(Math.sin(V.y),Math.sin(Z.y),Dt.ellipsoidRenderLatitudeSinMinMax)),mn)if(Lt.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ve<u)Dt.ellipsoidUvToShapeUvLatitude=D.fromElements(0,1,Dt.ellipsoidUvToShapeUvLatitude);else{let ro=(s.y-r.y)/Ve,Xo=(r.y-h.y)/Ve;Dt.ellipsoidUvToShapeUvLatitude=D.fromElements(ro,Xo,Dt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Le,!0};var kTe=new de;L0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){C.typeOf.number("tileLevel",e),C.typeOf.number("tileX",t),C.typeOf.number("tileY",n),C.typeOf.number("tileZ",i),C.typeOf.object("result",o);let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,l=n*r,d=(n+1)*r,u=i*r,f=(i+1)*r,p=de.subsection(this._rectangle,s,l,a,d,kTe),y=w.lerp(this._minimumHeight,this._maximumHeight,u),h=w.lerp(this._minimumHeight,this._maximumHeight,f);return P8(p,y,h,this._ellipsoid,this._translation,this._rotation,o)};var MTe=new m,NTe=new m,Qyt=new m;L0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){C.typeOf.object("spatialNode",e),C.typeOf.object("tileDimensions",t),C.typeOf.object("tileUv",n),C.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=m.divideComponents(m.ONE,t,MTe),s=m.multiplyByScalar(r,o,MTe),a=m.multiplyByScalar(m.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,NTe),o,NTe),l=m.add(a,s,Qyt),d=de.subsection(this._rectangle,a.x,a.y,l.x,l.y,kTe),u=w.lerp(this._minimumHeight,this._maximumHeight,a.z),f=w.lerp(this._minimumHeight,this._maximumHeight,l.z);return P8(d,u,f,this._ellipsoid,this._translation,this._rotation,i)};function P8(e,t,n,i,o,r,s){return s=Xn.fromRectangle(e,t,n,i,s),s.center=m.add(s.center,o,s.center),s.halfAxes=te.multiply(s.halfAxes,r,s.halfAxes),s}L0.DefaultMinBounds=Object.freeze(new m(-w.PI,-w.PI_OVER_TWO,-re.WGS84.minimumRadius));L0.DefaultMaxBounds=Object.freeze(new m(w.PI,w.PI_OVER_TWO,10*re.WGS84.maximumRadius));var uS=L0;var ou={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};ou.getMinBounds=function(e){switch(e){case ou.BOX:return lS.DefaultMinBounds;case ou.ELLIPSOID:return uS.DefaultMinBounds;case ou.CYLINDER:return dS.DefaultMinBounds;default:throw new L(`Invalid shape type ${e}`)}};ou.getMaxBounds=function(e){switch(e){case ou.BOX:return lS.DefaultMaxBounds;case ou.ELLIPSOID:return uS.DefaultMaxBounds;case ou.CYLINDER:return dS.DefaultMaxBounds;default:throw new L(`Invalid shape type ${e}`)}};ou.getShapeConstructor=function(e){switch(e){case ou.BOX:return lS;case ou.ELLIPSOID:return uS;case ou.CYLINDER:return dS;default:throw new L(`Invalid shape type ${e}`)}};var La=Object.freeze(ou);var H4i=_(T(),1);var Kji=_(T(),1);function Yf(e){C.typeOf.object("options",e),C.defined("options.comparator",e.comparator),c(e.maximumLength)&&C.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=c(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Yf.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(c(e)){for(C.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Yf.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Yf({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Yf.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(c(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Yf.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)UTe(this,t)};Yf.prototype.insert=function(e){let t,n=this._maximumLength;if(c(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++,UTe(this,i),t};Yf.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],OTe(this,0)),this._array[e-1]=void 0,t};Yf.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=v8(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&OTe(this,n)}return this._array[e-1]=void 0,t};Yf.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Yf.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[v8(this,1,2)?1:2]};function JD(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function d9(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function v8(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function UTe(e,t){if(t===0)return;let n=Math.floor(w.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=d9(e,t,i);for(o!==n&&(JD(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(d9(e,t,r)!==o)break;JD(e,t,r),t=r}}function OTe(e,t){let n=e._length,i=Math.floor(w.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){d9(e,s,r)===i&&(r=s);let a=2*o+1,l=Math.max(Math.min(n-a,4),0);for(let d=0;d<l;d++){let u=a+d;d9(e,u,r)===i&&(r=u)}}if(d9(e,r,t)===i&&(JD(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);v8(e,r,a)===i&&JD(e,r,a)}t=r}}var mS=Yf;var Qji=_(T(),1),F8=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function u9(e,t){this.spatialNode=e,this.keyframe=t,this.state=F8.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}u9.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=F8.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};u9.priorityComparator=function(e,t){return e.priority-t.priority};u9.searchComparator=function(e,t){return e.keyframe-t.keyframe};u9.LoadState=F8;var bo=u9;var p4i=_(T(),1);function Ag(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===At.UNSIGNED_SHORT&&(i=At.FLOAT32),i===At.FLOAT32&&!e.floatingPointTexture)throw new le("Floating point texture not supported");let s=jyt(i),a=qyt(n,e.webgl2),l=At.getSizeInBytes(i),d=$yt(o,n,l),u=Math.ceil(Math.sqrt(t.x)),f=Math.ceil(t.z/u),p=u*t.x,y=f*t.y,h=Math.floor(d/p),g=Math.floor(d/y);if(h===0||g===0)throw new le("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=l*n*d**2,this.voxelCountPerTile=m.clone(t,new m),this.maximumTileCount=h*g,this.regionCountPerMegatexture=new D(h,g),this.voxelCountPerRegion=new D(p,y),this.sliceCountPerRegion=new D(u,f),this.voxelSizeUv=new D(1/d,1/d),this.sliceSizeUv=new D(t.x/d,t.y/d),this.regionSizeUv=new D(p/d,y/d),this.texture=new Pt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d,height:d,sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR})});let x=At.toComponentDatatype(i);this.tileVoxelDataTemp=q.createTypedArray(x,p*y*n),this.nodes=new Array(this.maximumTileCount);for(let S=0;S<this.maximumTileCount;S++)this.nodes[S]=new egt(S);for(let S=0;S<this.maximumTileCount;S++){let V=this.nodes[S];V.previousNode=S>0?this.nodes[S-1]:void 0,V.nextNode=S<this.maximumTileCount-1?this.nodes[S+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function jyt(e){if(e===At.FLOAT32||e===At.FLOAT64)return Ue.FLOAT;if(e===At.UINT8)return Ue.UNSIGNED_BYTE}function qyt(e,t){if(e===1)return t?ke.RED:ke.LUMINANCE;if(e===2)return t?ke.RG:ke.LUMINANCE_ALPHA;if(e===3)return ke.RGB;if(e===4)return ke.RGBA}function $yt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(mt.maximumTextureSize,w.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function egt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Ag.prototype.add=function(e){if(this.isFull())throw new L("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,c(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,c(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Ag.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new L("Megatexture index out of bounds");let t=this.nodes[e];c(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),c(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,c(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Ag.prototype.isFull=function(){return this.emptyList===void 0};Ag.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===At.UNSIGNED_SHORT&&(i=At.FLOAT32);let o=At.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),l=s*t.x,d=a*t.y,u=w.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/l),y=Math.floor(u/d);if(p*y>=e)break;u*=2}return u*u*n*o};Ag.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:l}=this;for(let y=0;y<o.z;y++){let h=y%r.x*o.x,g=Math.floor(y/r.x)*o.y;for(let x=0;x<o.y;x++){let S=tgt(o,x,y),V=(g+x)*s.x+h;for(let Z=0;Z<o.x;Z++){let R=S+Z,E=V+Z;for(let I=0;I<a;I++)i[E*a+I]=n[R*a+I]}}}let d=e%l.x*s.x,u=Math.floor(e/l.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:d,yOffset:u};this.texture.copyFrom(p)};function tgt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}Ag.prototype.isDestroyed=function(){return!1};Ag.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),he(this)};var TL=Ag;var L4i=_(T(),1);function xm(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=m.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Xn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var ngt=new m;xm.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=te.getScale(this.orientedBoundingBox.halfAxes,ngt),n=2*m.maximumComponent(t);this.approximateVoxelSize=n/m.minimumComponent(this.dimensions)};xm.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,l=s+1,d=r+1,u=a+1,f=t+1,p=[[f,r,s,a],[f,d,s,a],[f,r,l,a],[f,d,l,a],[f,r,s,u],[f,d,s,u],[f,r,l,u],[f,d,l,u]];this.children=p.map(([y,h,g,x])=>new xm(y,h,g,x,this,e,this.dimensions))};xm.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};xm.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,w.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var DTe={keyframe:0};function m9(e,t){return DTe.keyframe=e,Wo(t,DTe,bo.searchComparator)}xm.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,l=+Number.MAX_VALUE;for(;c(t);){let{renderableKeyframeNodes:f}=t;if(f.length>=1){let p=igt(i,f),y=f[p],h=o===i||i<y.keyframe?p:Math.min(p+1,f.length-1),g=f[h],x=i-y.keyframe,S=BTe(n-t.level,x);S<a&&(a=S,r=y);let V=g.keyframe-o,Z=BTe(n-t.level,V);if(Z<l&&(l=Z,s=g),x===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!c(r)||!c(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:w.clamp((e-d)/(u-d),0,1)};function igt(e,t){let n=m9(e,t);return n<0?w.clamp(~n-1,0,t.length-1):n}function BTe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}xm.prototype.isVisited=function(e){return this.visitedFrameNumber===e};xm.prototype.createKeyframeNode=function(e){let t=m9(e,this.keyframeNodes);if(t<0){t=~t;let n=new bo(this,e);this.keyframeNodes.splice(t,0,n)}};xm.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=m9(n,this.keyframeNodes);if(i<0)throw new L("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=m9(n,this.renderableKeyframeNodes);if(o<0)throw new L("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};xm.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new L("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=m9(e.keyframe,i);if(o>=0)throw new L("Keyframe already renderable");o=~o,i.splice(o,0,e)};xm.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return c(t)&&c(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var f9=xm;function Mg(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:l,componentTypes:d,metadataOrder:u}=o,f=m.add(r,s,new m);if(m.add(f,a,f),u===gm.Y_UP){let Z=f.y;f.y=f.z,f.z=Z}!c(i)&&c(o.maximumTileCount)&&(i=bgt(o.maximumTileCount,f,l,d)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(l.length);for(let Z=0;Z<l.length;Z++){let R=l[Z],E=lt.getComponentCount(R),I=d[Z];this.megatextures[Z]=new TL(t,f,E,I,i),this.textureMemoryByteLength+=this.megatextures[Z].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let y=e._shape;this.rootNode=new f9(0,0,0,0,void 0,y,r),this._priorityQueue=new mS({maximumLength:p,comparator:bo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(p),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(p),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let h=this._binaryTreeKeyframeWeighting;h[0]=0,h[n-1]=0,A8(h,1,n-2,0);let g=9,x=2048,S=Math.floor(x/g),V=Math.ceil(p/S);this.internalNodeTexture=new Pt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:x,height:V,sampler:new en({minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})}),this.internalNodeTilesPerRow=S,this.internalNodeTexelSizeUv=new D(1/x,1/V),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}Mg.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function A8(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,A8(e,t,o-1,i+1),A8(e,o+1,n,i+1)}Mg.simultaneousRequestCountMaximum=50;Mg.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,l=o._levelBlendFactor,d=l>0,u=a>1,f=(d?2:1)*(u?2:1);this._sampleCount=f;let p=f>=2;if(p&&!c(this.leafNodeTexture)){let Z=Math.floor(512),R=Math.ceil(s/Z);this.leafNodeTexture=new Pt({context:r,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:R,sampler:new en({minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})}),this.leafNodeTexelSizeUv=D.fromElements(1/1024,1/R,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=Z}else!p&&c(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=w.clamp(t,0,a-1),n&&YTe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let y=Ti();sgt(this,e),agt(this,e);let h=Ti();mgt(this,f,l);let g=Ti(),x=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||x){let S=h-y,V=g-h,Z=g-y;ugt(this,e,S,V,Z)}};Mg.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Mg.prototype.isDestroyed=function(){return!1};Mg.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(),he(this)};function YTe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),c(t.children))for(let n=0;n<8;n++){let i=t.children[n];YTe(e,i)}}function ogt(e,t){if(e._simultaneousRequestCount>=Mg.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(c(i.availableLevels)&&r.level>=i.availableLevels)return;function s(u){e._simultaneousRequestCount--,t.content=u,t.state=c(u)?bo.LoadState.PROCESSING:bo.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=bo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let l={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},d=i.requestData(l);c(d)&&(e._simultaneousRequestCount++,t.state=bo.LoadState.RECEIVING,d.then(s).catch(a))}function rgt(e){return e/(1+e)}function sgt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),HTe(e.rootNode,fs.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 agt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(cgt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,l=0;for(let d=0;d<s;d++){let u=r[d];if(!(u.state===bo.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===bo.LoadState.UNLOADED&&ogt(e,u),u.state===bo.LoadState.PROCESSING)){let{content:f}=u;if(f.update(e._primitive,t),!f.ready)continue;if(!lgt(f.metadata,e)){u.content=void 0,u.state=bo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let y=o[p];e._primitive.tileUnload.raiseEvent(),y.spatialNode.destroyKeyframeNode(y,e.megatextures)}else p=i+l,l++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=bo.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function cgt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function lgt(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:l,z:d}=r,u=a*l*d,f=e[o],p=u*s;if(f.length!==p)return!1}return!0}function HTe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:l,frustum:d}=o,f=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(l,f),t=e.visibility(i,t),t===fs.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,y=p._shape,h=p.screenSpaceError,g=n._priorityQueue,x=n._keyframeCount,S=w.clamp(Math.floor(n._keyframeLocation),0,x-2),V=S+1;if(x===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==x)for(let v=0;v<x;v++)e.createKeyframeNode(v);let{screenSpaceError:Z,keyframeNodes:R}=e,E=rgt(Z),I=!1;for(let v=0;v<R.length;v++){let P=R[v];P.priority=10*E+dgt(S,P.keyframe,V,n),P.state!==bo.LoadState.UNAVAILABLE&&P.state!==bo.LoadState.FAILED&&P.priority!==-Number.MAX_VALUE&&g.insert(P),P.state===bo.LoadState.LOADED&&(I=!0)}if(Z<h||!I){e.children=void 0;return}c(e.children)||e.constructChildNodes(y);for(let v=0;v<8;v++){let P=e.children[v];HTe(P,t,n,i)}}function dgt(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 w.lerp(a,s,.15+.85*s)}function ugt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(bo.LoadState).length,l=new Array(a),d=new Array(a),u=0;for(let I=0;I<a;I++){let v=new Array(r).fill(0);l[I]=v,d[I]=0}function f(I){let v=I.keyframeNodes;for(let P=0;P<v.length;P++){let F=v[P],N=F.keyframe,b=F.state;l[b][N]+=1,d[b]+=1,u++}if(c(I.children))for(let P=0;P<8;P++){let F=I.children[P];f(F)}}f(s),e._primitive.statistics.numberOfTilesWithContentReady=d[bo.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[bo.LoadState.RECEIVING],y=d[bo.LoadState.PROCESSING],h=p!==e._primitive.statistics.numberOfPendingRequests||y!==e._primitive.statistics.numberOfTilesProcessing;if(h&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,y),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=y,h&&(p===0&&y===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 x=`KEYFRAMES: ${l[bo.LoadState.LOADED]}`,S=`UNLOADED: ${d[bo.LoadState.UNLOADED]} | RECEIVING: ${d[bo.LoadState.RECEIVING]} | PROCESSING: ${d[bo.LoadState.PROCESSING]} | LOADED: ${d[bo.LoadState.LOADED]} | FAILED: ${d[bo.LoadState.FAILED]} | UNAVAILABLE: ${d[bo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,V=Math.round(n*100)/100,Z=Math.round(i*100)/100,R=Math.round(o*100)/100,E=`LOAD: ${V} | OCT: ${Z} | ALL: ${R}`;console.log(`${x} || ${S} || ${E}`)}var QD={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function mgt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,l=0,d=[],u=[];function f(y,h,g,x,S){let V=!1;if(c(y.children))for(let Z=0;Z<8;Z++){let R=y.children[Z];R.computeSurroundingRenderableKeyframeNodes(o),R.isRenderable(r)&&(V=!0)}if(V){d[S]=QD.INTERNAL<<16|h,d[g]=x,a++,x=h,S=x*9+1;for(let Z=0;Z<8;Z++){let R=y.children[Z];h=a,g=h*9+0,f(R,h,g,x,S+Z)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let Z=l*5,R=y.renderableKeyframeNodePrevious,E=y.level-R.spatialNode.level,I=R.spatialNode.parent,v=c(I)?I.renderableKeyframeNodePrevious:R,P=fgt(y,i,n),F=E,N=1,b=R.megatextureIndex,G=v.megatextureIndex;u[Z+0]=P,u[Z+1]=F,u[Z+2]=N,u[Z+3]=b,u[Z+4]=G,d[S]=QD.LEAF<<16|l}else{let Z=y.renderableKeyframeNodePrevious,E=y.level-Z.spatialNode.level===0?QD.LEAF:QD.PACKED_LEAF_FROM_PARENT;d[S]=E<<16|Z.megatextureIndex}l++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&f(p,0,0,0,0),hgt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&pgt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function fgt(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 w.clamp(s,0,1)}function hgt(e,t,n,i){let o=ke.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)),l=new Uint8Array(s*a*o);for(let f=0;f<e.length;f++){let p=e[f],y=f*o;for(let h=0;h<o;h++)l[y+h]=p>>>h*8&255}let u={source:{arrayBufferView:l,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function pgt(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),l=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*l*o);for(let p=0;p<s;p++){let y=e[p*r+0],h=e[p*r+1],g=e[p*r+2],x=e[p*r+3],S=e[p*r+4],V=w.clamp(Math.floor(65536*y),0,65535);d[p*8+0]=V>>>0&255,d[p*8+1]=V>>>8&255,d[p*8+2]=h&255,d[p*8+3]=g&255,d[p*8+4]=x>>>0&255,d[p*8+5]=x>>>8&255,d[p*8+6]=S>>>0&255,d[p*8+7]=S>>>8&255}let f={source:{arrayBufferView:d,width:a,height:l},xOffset:0,yOffset:0};i.copyFrom(f)}function bgt(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=i[s],d=lt.getComponentCount(a);o+=TL.getApproximateTextureMemoryByteLength(e,t,d,l)}return o}var h9=Mg;function fp(e){e=e??z.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??fp.DefaultProvider,this._traversal=void 0,this._statistics=new pf,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new m,this._inputDimensions=new m,this._paddingBefore=new m,this._paddingAfter=new m,this._minBounds=new m,this._minBoundsOld=new m,this._maxBounds=new m,this._maxBoundsOld=new m,this._exaggeratedMinBounds=new m,this._exaggeratedMinBoundsOld=new m,this._exaggeratedMaxBounds=new m,this._exaggeratedMaxBoundsOld=new m,this._minClippingBounds=new m,this._minClippingBoundsOld=new m,this._maxClippingBounds=new m,this._maxClippingBoundsOld=new m,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._exaggeratedModelMatrix=M.clone(this._modelMatrix),this._compoundModelMatrix=new M,this._compoundModelMatrixOld=new M,this._customShader=e.customShader??fp.DefaultCustomShader,this._customShaderCompilationEvent=new ye,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new M,this._transformPositionUvToWorld=new M,this._transformDirectionWorldToLocal=new te,this._transformNormalLocalToWorld=new te,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new df,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new D,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new D,megatextureTextures:[],megatextureSliceDimensions:new D,megatextureTileDimensions:new D,megatextureVoxelSizeUv:new D,megatextureSliceSizeUv:new D,megatextureTileSizeUv:new D,dimensions:new m,inputDimensions:new m,paddingBefore:new m,paddingAfter:new m,transformPositionViewToUv:new M,transformPositionUvToView:new M,transformDirectionViewToLocal:new te,transformNormalLocalToWorld:new te,cameraPositionUv:new m,ndcSpaceAxisAlignedBoundingBox:new ce,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,stepSize:0,pickColor:new Y},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 ye,this.tileVisible=new ye,this.tileFailed=new ye,this.tileUnload=new ye,this.loadProgress=new ye,this.allTilesLoaded=new ye,this.initialTilesLoaded=new ye;let i=this._provider;ygt(this,i)}function ygt(e,t){let{shape:n,minBounds:i=La.getMinBounds(n),maxBounds:o=La.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=M.clone(e._modelMatrix,e._exaggeratedModelMatrix),KTe(e,t);let r=La.getShapeConstructor(n);e._shape=new r,e._shapeVisible=JTe(e,e._shape,t)}Object.defineProperties(fp.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){C.typeOf.object("modelMatrix",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){C.typeOf.bool("show",e),this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){C.typeOf.bool("disableUpdate",e),this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){C.typeOf.bool("debugDraw",e),this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){C.typeOf.bool("depthTest",e),this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){C.typeOf.bool("nearestSampling",e),this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){C.typeOf.number("levelBlendFactor",e),this._levelBlendFactor=w.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){C.typeOf.number("screenSpaceError",e),this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){C.typeOf.number("stepSize",e),this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){C.defined("minBounds",e),this._minBounds=m.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){C.defined("maxBounds",e),this._maxBounds=m.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){C.defined("minClippingBounds",e),this._minClippingBounds=m.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){C.defined("maxClippingBounds",e),this._maxClippingBounds=m.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.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];c(e)?this._customShader=e:this._customShader=fp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var ggt=new ce,xgt=new ce,_gt=new m,Tgt=new m,Sgt=new te,Cgt=new te,Vgt=new M,Lgt=new M,Zgt=new M,Rgt=M.fromRotationTranslation(te.fromUniformScale(.5,new te),new m(.5,.5,.5),new M),Ggt=M.fromRotationTranslation(te.fromUniformScale(2,new te),new m(-1,-1,-1),new M);fp.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){Pgt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}Wgt(this,e);let i=KTe(this,t),o=this._shape;if(i&&(this._shapeVisible=JTe(this,o,t),Fgt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Agt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Ygt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Mgt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;c(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(s9(this,n),this._shaderDirty=!1);let f=n.uniformState.viewProjection,p=o.orientedBoundingBox,y=Ugt(p,f,xgt);if(y.x===1||y.y===1||y.z===-1||y.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=ce.clone(y,u.ndcSpaceAxisAlignedBoundingBox);let g=n.uniformState.inverseView;u.transformPositionViewToUv=M.multiplyTransformation(this._transformPositionWorldToUv,g,u.transformPositionViewToUv);let x=n.uniformState.view;u.transformPositionUvToView=M.multiplyTransformation(x,this._transformPositionUvToWorld,u.transformPositionUvToView);let S=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=te.multiply(this._transformDirectionWorldToLocal,S,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=te.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=M.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let Z=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;Z.boundingVolume=o.boundingSphere,e.commandList.push(Z)};var Egt=new m,M8=new m,Xgt=new pe,Igt=new m;function Wgt(e,t){if(e._exaggeratedMinBounds=m.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=m.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===La.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else{let n=m.fromElements(1,1,t.verticalExaggeration,Egt);e._exaggeratedModelMatrix=M.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=M.multiplyByTranslation(e._exaggeratedModelMatrix,wgt(e,t),e._exaggeratedModelMatrix)}}function wgt(e,t){let{shapeTransform:n=M.IDENTITY,globalTransform:i=M.IDENTITY}=e._provider,o=M.getTranslation(n,M8),r=M.multiplyByPoint(e._modelMatrix,o,M8),s=M.multiplyByPoint(i,r,M8),l=re.WGS84.cartesianToCartographic(s,Xgt),d=0;c(l)&&(d=l.height);let u=Lr.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return m.fromElements(0,0,(u-d)/t.verticalExaggeration,Igt)}function Pgt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=Y.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=He(o,!0);let s=e._uniformMap;for(let l in r)if(r.hasOwnProperty(l)){let d=`u_${l}`;c(s[d])&&ht(`VoxelPrimitive: Uniform name "${d}" is already defined`),s[d]=function(){return r[l]}}if(e._dimensions=m.clone(t.dimensions,e._dimensions),i.dimensions=m.clone(e._dimensions,i.dimensions),e._paddingBefore=m.clone(t.paddingBefore??m.ZERO,e._paddingBefore),i.paddingBefore=m.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=m.clone(t.paddingAfter??m.ZERO,e._paddingAfter),i.paddingAfter=m.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=m.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=m.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===gm.Y_UP){let l=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=l}i.inputDimensions=m.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new h9(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,vgt(e._traversal,i)}function KTe(e,t){let n=t.shapeTransform??M.IDENTITY,i=t.globalTransform??M.IDENTITY;return M.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),M.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),fS(e,"_compoundModelMatrix","_compoundModelMatrixOld")+fS(e,"_minBounds","_minBoundsOld")+fS(e,"_maxBounds","_maxBoundsOld")+fS(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+fS(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+fS(e,"_minClippingBounds","_minClippingBoundsOld")+fS(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function fS(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function JTe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=M.inverse(o,Vgt),s=M.getRotation(o,Sgt),a=M.getScale(o,_gt),l=m.maximumComponent(a),d=m.divideByScalar(a,l,Tgt),u=te.multiplyByScale(s,d,Cgt);return e._transformPositionWorldToUv=M.multiplyTransformation(Rgt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=M.multiplyTransformation(o,Ggt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=M.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=te.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function vgt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=D.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=D.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=D.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=D.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=D.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=D.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Fgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=He(n,!0)),i}function Agt(e,t){if(!c(e)||!c(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=ee.secondsDifference(i.stop,i.start),a=ee.secondsDifference(n,i.start)/r;return o+a}function Mgt(e,t){let n=e.clippingPlanes;if(!c(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._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}fp.prototype.isDestroyed=function(){return!1};fp.prototype.destroy=function(){let e=this._drawCommand;c(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return c(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(),he(this)};var zTe=new Array(new ce(-1,-1,-1,1),new ce(1,-1,-1,1),new ce(-1,1,-1,1),new ce(1,1,-1,1),new ce(-1,-1,1,1),new ce(1,-1,1,1),new ce(-1,1,1,1),new ce(1,1,1,1)),Ngt=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),kgt=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function Ugt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,Lgt),o=M.multiply(t,i,Zgt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,l=-Number.MAX_VALUE,d,u=kgt,f=zTe.length;for(d=0;d<f;d++)M.multiplyByVector(o,zTe[d],u[d]);for(d=0;d<f;d++){let p=u[d];if(p.z>=-p.w){let y=p.x/p.w,h=p.y/p.w;r=Math.min(r,y),s=Math.max(s,y),a=Math.min(a,h),l=Math.max(l,h)}else for(let y=0;y<3;y++){let h=Ngt[d*3+y],g=u[h];if(g.z>=-g.w){let x=p.z+p.w,S=g.z+g.w,V=x/(x-S),Z=ce.lerp(p,g,V,ggt),R=Z.x/Z.w,E=Z.y/Z.w;r=Math.min(r,R),s=Math.max(s,R),a=Math.min(a,E),l=Math.max(l,E)}}}return r=w.clamp(r,-1,1),a=w.clamp(a,-1,1),s=w.clamp(s,-1,1),l=w.clamp(l,-1,1),n=ce.fromElements(r,a,s,l,n),n}var N8=3e7,Ogt=new m(N8,0,0),Dgt=new m(0,N8,0),Bgt=new m(0,0,N8);function Ygt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(l,d,u,f){i.add({positions:[l,d],width:f,material:zi.fromType("Color",{color:u})})}function r(l,d,u){let f=l.computeCorners();o(f[0],f[1],d,u),o(f[2],f[3],d,u),o(f[4],f[5],d,u),o(f[6],f[7],d,u),o(f[0],f[2],d,u),o(f[4],f[6],d,u),o(f[1],f[3],d,u),o(f[5],f[7],d,u),o(f[0],f[4],d,u),o(f[2],f[6],d,u),o(f[1],f[5],d,u),o(f[3],f[7],d,u)}function s(l){if(!n.isRenderable(l))return;let d=l.level,f=Math.max(1,5/Math.pow(2,d)),y=[Y.RED,Y.LIME,Y.BLUE][d%3];if(r(l.orientedBoundingBox,y,f),c(l.children))for(let h=0;h<8;h++)s(l.children[h])}r(e._shape.orientedBoundingBox,Y.WHITE,5),s(n.rootNode);let a=10;o(m.ZERO,Ogt,Y.RED,a),o(m.ZERO,Dgt,Y.LIME,a),o(m.ZERO,Bgt,Y.BLUE,a),i.update(t)}fp.DefaultCustomShader=new aS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
    material.diffuse = vec3(1.0);
    material.alpha = 1.0;
}`});function QTe(){this.ready=!0,this.shape=La.BOX,this.dimensions=new m(1,1,1),this.names=["data"],this.types=[lt.SCALAR],this.componentTypes=[At.FLOAT32],this.maximumTileCount=1}QTe.prototype.requestData=function(e){if((c(e)?e.tileLevel??0:0)>=1)return;let n=new cS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};fp.DefaultProvider=new QTe;var Ng=fp;var R8i=_(T(),1);function Hgt(e,t,n,i){if(!c(e)||c(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!c(r))return;let a=(r.properties||{})[i];if(c(a))return a}var p9=Hgt;var E8i=_(T(),1);function zgt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var b9=zgt;var W8i=_(T(),1);function Kgt(e,t,n){if(!c(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(c(a))return a}}var y9=Kgt;var qD=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function li(e){e=e??z.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=He(e.contextOptions);if(!c(t))throw new L("options and options.canvas are required.");let r=c(n),s=new lE(t,o);r||(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)),c(i)||(i=t.parentNode),this._id=Hn(),this._jobScheduler=new KF,this._frameState=new HF(s,new AF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new bZ(s),this._ellipsoid=e.ellipsoid??re.default,this._globe=void 0,this._globeTranslucencyState=new zF,this._primitives=new al,this._groundPrimitives=new al,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=li.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new tS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new DF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new Y,stencil:0,owner:this}),this._depthClearCommand=new ti({depth:1,owner:this}),this._stencilClearCommand=new ti({stencil:0}),this._classificationStencilClearCommand=new ti({stencil:0,renderState:Oe.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new wA(this),this._preUpdate=new ye,this._postUpdate=new ye,this._renderError=new ye,this._preRender=new ye,this._postRender=new ye,this._minimumDisableDepthTestDistance=0,this._debugInspector=new OA,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new ye,this.morphComplete=new ye,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=Y.clone(Y.BLACK),this._mode=se.SCENE3D,this._mapProjection=c(e.mapProjection)?e.mapProjection:new Xi(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 C_,this.fog=new YF,this.fog.enabled=re.WGS84.equals(this._ellipsoid),re.WGS84.equals(this._ellipsoid)||(oo.DEFAULT_VIEW_RECTANGLE=de.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new oo(this),this.shadowMap=new g0({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=Y.clone(Y.WHITE),this._actualInvertClassificationColor=Y.clone(this._invertClassificationColor),this._invertClassification=new fL,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new XA,this._brdfLutGenerator=new IF,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new AA(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??ed.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=ic.requestCompletedEvent.addEventListener(qD(this)),this._removeTaskProcessorListenerCallback=gi.taskCompletedEvent.addEventListener(qD(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new je(0,0,s.drawingBufferWidth,s.drawingBufferHeight),l=new oo(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new oo(this),this.preloadFlightCullingVolume=void 0,this._picking=new cA(this),this._defaultView=new zT(this,l,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 Xp,tSe(this,0,ee.now()),this.updateFrameState(),this.initializeFrame()}li.defaultLogDepthBuffer=!0;function Jgt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];c(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(qD(e))),n.push(t.terrainProviderChanged.addEventListener(qD(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(li.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 mt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return mt.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 Bm.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,Jgt(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(c(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(c(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),c(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(c(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){if(this.scene3DOnly&&e!==se.SCENE3D)throw new L("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===se.SCENE2D)this.morphTo2D(0);else if(e===se.SCENE3D)this.morphTo3D(0);else if(e===se.COLUMBUS_VIEW)this.morphToColumbusView(0);else throw new L("value must be a valid SceneMode enumeration.");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){if(this.camera.frustum instanceof sn)throw new L("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new oo(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new BF(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){if(!c(e)||e<0)throw new L("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},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,mt.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}}});li.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 Qgt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function jTe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,l=t.derivedCommands;c(t.pickId)&&(l.picking=rp.createPickDerivedCommand(e,t,o,l.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,c(t.pickedMetadataInfo)&&(l.pickingMetadata=rp.createPickMetadataDerivedCommand(e,t,o,l.pickingMetadata))),t.pickOnly||(l.depth=rp.createDepthOnlyDerivedCommand(e,t,o,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=rp.createHdrCommand(t,o,l.hdr),t=l.hdr.command,l=t.derivedCommands),a&&t.receiveShadows&&(l.shadows=g0.createReceiveDerivedCommand(s,t,n,o,l.shadows)),t.pass===Xe.TRANSLUCENT&&c(r)&&r.isSupported()&&(a&&t.receiveShadows?(l.oit=c(l.oit)?l.oit:{},l.oit.shadows=r.createDerivedCommands(l.shadows.receiveCommand,o,l.oit.shadows)):l.oit=r.createDerivedCommands(t,o,l.oit))}li.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!c(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 l=this._hdr,d=c(t.logDepth),u=c(t.hdr),f=c(t.originalCommand),p=o&&!d,y=l&&!u,h=(!o||!l)&&!f,g=n.pickingMetadata&&Qgt(e,n);if(e.dirty=e.dirty||p||y||h||g,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:x,shadowMaps:S}=i;x&&e.castShadows&&(t.shadows=g0.createCastDerivedCommand(S,e,s,r,t.shadows)),(d||p)&&(t.logDepth=rp.createLogDepthCommand(e,r,t.logDepth),jTe(this,t.logDepth.command,s)),(f||h)&&jTe(this,e,s)};var jgt=new hm({pass:Fo.RENDER}),k8=new hm({pass:Fo.PRELOAD}),U8=new hm({pass:Fo.PRELOAD_FLIGHT}),qgt=new hm({pass:Fo.REQUEST_RENDER_MODE_DEFER_CHECK}),qTe=new ue,O8;function $gt(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return qTe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,O8=EF.fromBoundingSphere(qTe,e.camera.positionWC,O8),O8}li.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function tSe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=ee.clone(n,i.time)}li.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=$gt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof sn||this.camera.frustum instanceof Oo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;c(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,c(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=Y.clone(this.invertClassificationColor,this._actualInvertClassificationColor),fL.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,c(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};li.prototype.isVisible=function(e,t,n){if(!c(t))return!1;let{boundingVolume:i}=t;return!c(i)||!t.cull?!0:e.computeVisibility(i)===zt.OUTSIDE?!1:!c(n)||!t.occlude||!i.isOccluded(n)};var jD=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);jD=M.inverseTransformation(jD,jD);function ext(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();let a=m.clone(s.center);if(o.mode!==se.SCENE3D){a=M.multiplyByPoint(jD,a,a);let h=o.mapProjection,g=h.unproject(a);a=h.ellipsoid.cartographicToCartesian(g)}let l,d,{radius:u}=s;c(u)?(l=Js.createGeometry(new Js({radii:new m(u,u,u),vertexFormat:an.FLAT_VERTEX_FORMAT})),d=M.fromTranslation(a)):(l=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:an.FLAT_VERTEX_FORMAT})),d=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new In({geometryInstances:new Rt({geometry:An.toWireframe(l),modelMatrix:d,attributes:{color:new Yt(1,0,0,1)}}),appearance:new an({flat:!0,translucent:!1}),asynchronous:!1});let f=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=rp.createLogDepthCommand(e,r).command);let y;c(i)&&(y=n.framebuffer,n.framebuffer=i),e.execute(r,n),c(y)&&(n.framebuffer=y),o.commandList=f}function hp(e,t,n,i){let o=t._frameState,r=t._context;if(c(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(r,n);return}e.debugShowBoundingVolume&&c(e.boundingVolume)&&ext(e,t,n,i),o.useLogDepth&&c(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&c(e.derivedCommands)&&c(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&c(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&c(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(c(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&&c(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function $Te(e,t,n){let{derivedCommands:i}=e;if(!c(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&c(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:l}=e.derivedCommands;c(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),c(s)?(e=s.pickCommand,e.execute(r,n)):c(l)&&(e=l.depthOnlyCommand,e.execute(r,n))}function nSe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function txt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+w.EPSILON12}function nxt(e,t,n,i,o){h0(i,nSe,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ixt(e,t,n,i,o){h0(i,txt,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function oxt(e,t,n){e.context.uniformState.updatePass(Xe.VOXELS);let i=n.commands[Xe.VOXELS];i.length=n.indices[Xe.VOXELS],h0(i,nSe,e.camera.positionWC);for(let o=0;o<i.length;++o)hp(i[o],e,t)}var rxt=new Ci,sxt=new hl,axt=new sn,cxt=new Oo;function lxt(e){let{frustum:t}=e;return c(t.fov)?t.clone(rxt):c(t.infiniteProjectionMatrix)?t.clone(sxt):c(t.width)?t.clone(axt):t.clone(cxt)}function dxt(e){if(e._environmentState.useOIT){if(!c(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?nxt:ixt}function uxt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,l;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(l=e._invertClassification);let d=dxt(e);o.uniformState.updatePass(Xe.TRANSLUCENT);let u=n.commands[Xe.TRANSLUCENT];u.length=n.indices[Xe.TRANSLUCENT],d(e,hp,t,u,l)}function mxt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Xe.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Xe.TRANSLUCENT];i.executeTranslucentCommands(e,hp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,hp,t,n)}function B8(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=lxt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,l=a.pick||a.pickVoxel;l||fxt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:f,useGlobeDepthFramebuffer:p,useInvertClassification:y,usePostProcessSelected:h}=e._environmentState,{globeDepth:g,globeTranslucencyFramebuffer:x,sceneFramebuffer:S,frustumCommandsList:V}=e._view,Z=V.length,R=e._globeTranslucencyState,E=e._depthClearCommand,I=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,F=n.position.z;function N(G,X){r.updatePass(X);let W=G.commands[X],A=G.indices[X];for(let k=0;k<A;++k)hp(W[k],e,t);return A}function b(G,X){r.updatePass(X);let W=G.commands[X],A=G.indices[X];for(let k=0;k<A;++k)$Te(W[k],e,t)}for(let G=0;G<Z;++G){let X=Z-G-1,W=V[X];e.mode===se.SCENE2D?(n.position.z=F-W.near+1,s.far=Math.max(1,W.far-W.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=X!==0?W.near*e.opaqueFrustumNearOffset:W.near,s.far=W.far,r.updateFrustum(s)),E.execute(i,t),i.stencilBuffer&&I.execute(i,t),R.translucent?(r.updatePass(Xe.GLOBE),R.executeGlobeCommands(W,hp,x,e,t)):N(W,Xe.GLOBE),p&&g.executeCopyDepth(i,t),u||(R.translucent?(r.updatePass(Xe.TERRAIN_CLASSIFICATION),R.executeGlobeClassificationCommands(W,hp,x,e,t)):N(W,Xe.TERRAIN_CLASSIFICATION)),d&&(E.execute(i,t),f&&P.execute(i,t));let A;if(!y||l||u)A=N(W,Xe.CESIUM_3D_TILE),A>0&&(p&&(g.prepareColorTextures(i,d),g.executeUpdateDepth(i,t,g.depthStencilTexture)),u||(A=N(W,Xe.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let B=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,A=N(W,Xe.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),g.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),A=N(W,Xe.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=B,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),A>0&&i.stencilBuffer&&v.execute(i,t),A=N(W,Xe.CESIUM_3D_TILE_CLASSIFICATION)}if(A>0&&i.stencilBuffer&&I.execute(i,t),oxt(e,t,W),N(W,Xe.OPAQUE),X!==0&&e.mode!==se.SCENE2D&&(s.near=W.near,r.updateFrustum(s)),uxt(e,t,W),mxt(e,t,W),i.depthTexture&&e.useDepthPicking&&(p||u)){let B=e._picking.getPickDepth(e,X);B.update(i,g.depthStencilTexture),B.executeCopyDepth(i,t)}if(l||!h)continue;let k=t.framebuffer;t.framebuffer=S.getIdFramebuffer(),s.near=X!==0?W.near*e.opaqueFrustumNearOffset:W.near,s.far=W.far,r.updateFrustum(s),R.translucent?(r.updatePass(Xe.GLOBE),R.executeGlobeCommands(W,$Te,x,e,t)):b(W,Xe.GLOBE),d&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),d&&f&&P.execute(i,t),b(W,Xe.CESIUM_3D_TILE),b(W,Xe.OPAQUE),b(W,Xe.TRANSLUCENT),t.framebuffer=k}}function fxt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Xe.ENVIRONMENT),c(i.skyBoxCommand)&&hp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&hp(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 iSe(e){e.context.uniformState.updatePass(Xe.COMPUTE);let t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function hxt(e,t){e.context.uniformState.updatePass(Xe.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function pxt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Xe.GLOBE,Xe.CESIUM_3D_TILE,Xe.OPAQUE,Xe.TRANSLUCENT];for(let l=0;l<t.length;++l){let d=t[l];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let f=s-1;f>=0;--f){let p=r[f].cullingVolume;if(e.isVisible(p,d))r[f].commandList.push(d),u=!0;else if(u)break}}}}function oSe(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 l=o[a];if(l.outOfView)continue;let{passes:d}=l;for(let u=0;u<d.length;++u)d[u].commandList.length=0;pxt(e,n,l);for(let u=0;u<d.length;++u){let f=l.passes[u],{camera:p,commandList:y}=f;s.updateCamera(p),l.updatePass(r,u);for(let h=0;h<y.length;++h){let g=y[h];s.updatePass(g.pass);let x=g.derivedCommands.shadows.castCommands[a];hp(x,e,f.passState)}}}}var bxt=new m;li.prototype.updateAndExecuteCommands=function(e,t){Ext(this,e,t),this._environmentState.useWebVR?yxt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===ed.ROTATE?kg(!0,this,e):Zxt(this,e)};function yxt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;rSe(e),n.createPotentiallyVisibleSet(e),iSe(e),r||oSe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=oo.clone(i,e._cameraVR);a.frustum=i.frustum;let l=i.frustum.near,d=l*(e.focalLength??5),u=e.eyeSeparation??d/30,f=m.multiplyByScalar(a.right,u*.5,bxt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*l/d;m.add(a.position,f,i.position),i.frustum.xOffset=p,B8(e,t),s.x=s.width,m.subtract(a.position,f,i.position),i.frustum.xOffset=-p,B8(e,t),oo.clone(a,i)}var gxt=new pe(Math.PI,w.PI_OVER_TWO),xxt=new m,_xt=new m,Txt=new M,Sxt=new M,Cxt=new m,Vxt=new m,Lxt=new je;function Zxt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=je.clone(r,Lxt);t.viewport=s;let a=gxt,l=xxt;e.mapProjection.project(a,l);let u=m.clone(i.position,_xt),f=M.clone(i.transform,Sxt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let y=M.computeViewportTransformation(s,0,1,Txt),h=i.frustum.projectionMatrix,g=i.positionWC.y,x=m.fromElements(w.sign(g)*l.x-g,0,-i.positionWC.x,Cxt),S=wt.pointToGLWindowCoordinates(h,y,x,Vxt);S.x=Math.floor(S.x);let V=s.x,Z=s.width;if(g===0||S.x<=V||S.x>=V+Z)kg(!0,e,t);else if(Math.abs(V+Z*.5-S.x)<1)s.width=S.x-s.x,i.position.x*=w.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),kg(!0,e,t),s.x=S.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),kg(!1,e,t);else if(S.x>V+Z*.5){s.width=S.x-V;let R=i.frustum.right;i.frustum.right=l.x-g,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),kg(!0,e,t),s.x=S.x,s.width=V+Z-S.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=R-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),kg(!1,e,t)}else{s.x=S.x,s.width=V+Z-S.x;let R=i.frustum.left;i.frustum.left=-l.x-g,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),kg(!0,e,t),s.x=V,s.width=S.x-V,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=R-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),kg(!1,e,t)}i._setTransform(f),m.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function kg(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),rSe(t),i.createPotentiallyVisibleSet(t),e&&(iSe(t),o||oSe(t)),B8(t,n)}var eSe=new fs;li.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,l=this._globeTranslucencyState;if(!i||this._mode!==se.SCENE2D&&t.camera.frustum instanceof sn||!l.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(c(s)){if(c(a))s.setDynamicLighting(rb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let S=r.dynamicLighting;s.setDynamicLighting(S),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),c(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=c(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let x=c(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=c(x)?x.drawCommand:void 0,n.sunComputeCommand=c(x)?x.computeCommand:void 0,n.moonCommand=c(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=c(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===se.SCENE2D);(n.useDepthPlane=d&&this.mode===se.SCENE3D&&l.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==se.SCENE2D&&!o;let f=e.mode===se.SCENE3D&&!l.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,y=eSe.planes;for(let x=0;x<5;++x)y[x]=p.planes[x];p=eSe,n.isSkyAtmosphereVisible=c(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,f),n.isMoonVisible=this.isVisible(p,n.moonCommand,f);let h=this.specularEnvironmentMaps,g=this._specularEnvironmentCubeMap;c(h)&&g?.url!==h?(g=g&&g.destroy(),this._specularEnvironmentCubeMap=new Bm(h)):!c(h)&&c(g)&&(g.destroy(),this._specularEnvironmentCubeMap=void 0),c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Rxt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new op({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),c(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Gxt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===se.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let l=o[a];l.update(t),i.shadowMaps.push(l),l.fromLightSource&&(i.lightShadowMaps.push(l),i.lightShadowsEnabled=!0),l.dirty&&(++i.lastDirtyTime,l.dirty=!1)}}}function rSe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Rxt(e),Gxt(e),e._globe&&e._globe.render(t)}function Ext(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,l=a.pick||a.pickVoxel;c(s.globeDepth)&&(s.globeDepth.picking=l);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new kA:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;Y.clone(n,u.color),u.execute(i,t);let f=r.useGlobeDepthFramebuffer=c(s.globeDepth);f&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,y=r.useOIT=!l&&c(p)&&p.isSupported();y&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let h=e.postProcessStages,g=r.usePostProcess=!l&&(e._hdr||h.length>0||h.ambientOcclusion.enabled||h.fxaa.enabled||h.bloom.enabled);if(r.usePostProcessSelected=!1,g&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),h.update(i,o.useLogDepth,e._hdr),h.clear(i),g=r.usePostProcess=h.ready,r.usePostProcessSelected=g&&h.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):f?t.framebuffer=s.globeDepth.framebuffer:g&&(t.framebuffer=s.sceneFramebuffer.framebuffer),c(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!l&&c(t.framebuffer)&&e.invertClassification){let S;if(o.invertClassificationColor.alpha===1&&f&&(S=s.globeDepth.framebuffer),c(S)||i.depthTexture){if(e._invertClassification.previousFramebuffer=S,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&y){let V=e._invertClassification.unclassifiedCommand,Z=V.derivedCommands;Z.oit=p.createDerivedCommands(V,i,Z.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}li.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;c(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:l,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,f=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=l?f.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),l){i.sceneFramebuffer.prepareColorTextures(t);let y=f;a&&!s&&(y=u);let h=this.postProcessStages,g=y.getColorTexture(0),x=p.getColorTexture(0),S=(u??f).getDepthStencilTexture();h.execute(t,g,S,x),h.copy(t,d)}!s&&!l&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function Xxt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function Ixt(e){if(e.mode===se.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function sSe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof al){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=sSe(s,t,n);c(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(c(o)&&o>i)return o}return i}li.prototype.getHeight=function(e,t){if(!c(e))return;let n=t===ze.CLAMP_TO_TERRAIN||t===ze.RELATIVE_TO_TERRAIN,i=t===ze.CLAMP_TO_3D_TILE||t===ze.RELATIVE_TO_3D_TILE;if(!c(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=sSe(this.primitives,e,this);c(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&c(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var D8=new pe;li.prototype.updateHeight=function(e,t,n){C.typeOf.func("callback",t);let i=this._ellipsoid,o=y=>{pe.clone(e,D8);let h;c(y)&&(h=y.height),c(h)||(h=this.getHeight(e,n)),c(h)&&(D8.height=h,t(D8))},r=n===ze.CLAMP_TO_TERRAIN||n===ze.RELATIVE_TO_TERRAIN,s=n===ze.CLAMP_TO_3D_TILE||n===ze.RELATIVE_TO_3D_TILE,a;!s&&c(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let l={},d=y=>{if(r||y.isDestroyed()||!y.isCesium3DTileset)return;let h=y.updateHeight(e,o,i);l[y.id]=h};if(!r){let y=this.primitives.length;for(let h=0;h<y;++h){let g=this.primitives.get(h);d(g)}}let u=this.primitives.primitiveAdded.addEventListener(d),f=this.primitives.primitiveRemoved.addEventListener(y=>{y.isDestroyed()||!y.isCesium3DTileset||(c(l[y.id])&&l[y.id](),delete l[y.id])});return()=>{a=a&&a(),Object.values(l).forEach(y=>y()),l={},u(),f()}};function Wxt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!c(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===se.SCENE2D||n===se.MORPHING)return!1;let r=e._globeHeight;return c(r)&&o.height<r}li.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=Ixt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=Wxt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function wxt(e,t){if(e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new p0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Pxt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),c(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function vxt(e){e.primitives.postPassesUpdate(e._frameState),ic.update()}var Fxt=new Y;function Axt(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=jgt;let r=e.backgroundColor??Y.BLACK;e._hdr&&(r=Y.clone(r,Fxt),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;c(s)&&s.enabled&&(!c(e.light)||e.light instanceof Xp?m.negate(i.sunDirectionWC,e._shadowMapCamera.direction):m.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let l=o.passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=je.clone(a,l.viewport),c(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(l,r),e.resolveFramebuffers(l),l.framebuffer=void 0,hxt(e,l),c(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function hS(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Mxt(e){return e._picking.updateMostDetailedRayPicks(e)}li.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,c(e)||(e=ee.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===se.MORPHING;if(!i&&c(this.maximumRenderTimeChange)&&c(this._lastRenderTime)){let o=Math.abs(ee.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=ee.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=w.incrementWrap(t.frameNumber,15e6,1);tSe(this,o,e),t.newFrame=!0}hS(this,Pxt),this.primitives.show&&(hS(this,Mxt),hS(this,Nxt),hS(this,kxt),i||hS(this,Uxt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),hS(this,Axt)),wxt(this,i),hS(this,vxt),Xxt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};li.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};li.prototype.requestRender=function(){this._renderRequested=!0};li.prototype.clampLineWidth=function(e){return Math.max(mt.minimumAliasedLineWidth,Math.min(e,mt.maximumAliasedLineWidth))};li.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};li.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!c(i))return;let o=i.primitive;if(!(o instanceof Ng))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!c(a))return;let l=255*r[2]+r[3];return DA.fromKeyframeNode(o,s,l,a)};li.prototype.pickMetadata=function(e,t,n,i){C.typeOf.object("windowPosition",e),C.typeOf.string("className",n),C.typeOf.string("propertyName",i);let o=this.pick(e);if(!c(o))return;let r=o.detail?.model?.structuralMetadata;if(!c(r))return;let s=r.schema,a=p9(s,t,n,i);if(!c(a))return;let l=y9(r,n,i);if(!c(l))return;let d=new b9(t,n,i,a,l);return this._picking.pickMetadata(this,e,d)};li.prototype.pickMetadataSchema=function(e){C.typeOf.object("windowPosition",e);let t=this.pick(e);return c(t)?t.detail?.model?.structuralMetadata?.schema:void 0};li.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};li.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};li.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Nxt(e){let t=e._frameState;k8.camera=t.camera,k8.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,k8)}function kxt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;U8.camera=e.preloadFlightCamera,U8.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,U8)}function Uxt(e){e.primitives.updateForPass(e._frameState,qgt)}li.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};li.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};li.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};li.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};li.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};li.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};li.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};li.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};li.prototype.cartesianToCanvasCoordinates=function(e,t){return Oi.worldToWindowCoordinates(this,e,t)};li.prototype.completeMorph=function(){this._transitioner.completeMorph()};li.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};li.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};li.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function Oxt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){c(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{c(e)&&c(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}li.prototype.setTerrain=function(e){return C.typeOf.object("terrain",e),Oxt(this,e),e};li.prototype.isDestroyed=function(){return!1};li.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(),c(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,c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),he(this)};var g9=li;var w6i=_(T(),1);function SL(e){e=e??re.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=m.multiplyByScalar(e.radii,t,new m);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 m(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new m(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new m;let i=new m;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(SL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});SL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Y8=new M;SL.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==se.SCENE3D&&n!==se.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,m.ZERO,Y8),o=M.multiplyTransformation(i,Po.Y_UP_TO_Z_UP,Y8),r=M.multiply(this._scaleMatrix,o,Y8);M.clone(r,this._modelMatrix);let s=e.context,a=Dxt(this),l=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||l||!c(t)||!t.show,u=this._command;if(!c(u.vertexArray)){let p=Js.createGeometry(new Js({radii:new m(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:We.POSITION_ONLY}));u.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:An.createAttributeLocations(p),bufferUsage:Ne.STATIC_DRAW}),u.renderState=Oe.fromCache({cull:{enabled:!0,face:_i.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let f=a|d<<2|l<<3;if(f!==this._flags){this._flags=f;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),l&&p.push("GLOBE_TRANSLUCENT");let y=new Be({defines:p,sources:[$m,BV,Bv]}),h=new Be({defines:p,sources:[$m,BV,Dv]});this._spSkyAtmosphere=tn.fromCache({context:s,vertexShaderSource:y,fragmentShaderSource:h}),u.shaderProgram=this._spSkyAtmosphere}return u};function Dxt(e){return!(w.equalsEpsilon(e.hueShift,0,w.EPSILON7)&&w.equalsEpsilon(e.saturationShift,0,w.EPSILON7)&&w.equalsEpsilon(e.brightnessShift,0,w.EPSILON7))}SL.prototype.isDestroyed=function(){return!1};SL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),he(this)};var x9=SL;var iqi=_(T(),1);function VL(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}VL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==se.SCENE3D&&i!==se.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;if(C.defined("this.sources",a),Object.values(Uo.FaceName).some(d=>!c(a[d])))throw new L("this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let l=typeof a.positiveX;if(Object.values(Uo.FaceName).some(d=>typeof a[d]!==l))throw new L("this.sources properties must all be the same type.");typeof a.positiveX=="string"?mE(r,this._sources).then(function(d){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=d}).catch(d=>{this._hasError=!0,this._error=d}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Uo({context:r,source:a}))}let s=this._command;if(!c(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Wa.createGeometry(Wa.fromDimensions({dimensions:new m(2,2,2),vertexFormat:We.POSITION_ONLY})),l=this._attributeLocations=An.createAttributeLocations(a);s.vertexArray=ni.fromGeometry({context:r,geometry:a,attributeLocations:l,bufferUsage:Ne.STATIC_DRAW}),s.renderState=Oe.fromCache({blending:un.ALPHA_BLEND})}if(!c(s.shaderProgram)||this._useHdr!==t){let a=new Be({defines:[t?"HDR":""],sources:[Yv]});s.shaderProgram=tn.fromCache({context:r,vertexShaderSource:Hv,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(c(this._cubeMap))return s};VL.prototype.isDestroyed=function(){return!1};VL.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(),he(this)};function CL(e){return on(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}VL.createEarthSkyBox=function(){return new VL({sources:{positiveX:CL("px"),negativeX:CL("mx"),positiveY:CL("py"),negativeY:CL("my"),positiveZ:CL("pz"),negativeZ:CL("mz")}})};var _9=VL;var Wqi=_(T(),1);function S9(){this.show=!0,this._drawCommand=new et({primitiveType:ve.TRIANGLES,boundingVolume:new ue,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ue,this._boundingVolume2D=new ue,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(S9.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Bxt=new D,Yxt=new D,Hxt=new ce,T9=new ce;S9.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===se.SCENE2D||i===se.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!c(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 R=Math.max(r,s);R=Math.pow(2,Math.ceil(Math.log(R)/Math.log(2))-2),R=Math.max(1,R);let E=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new Pt({context:o,width:R,height:R,pixelFormat:ke.RGBA,pixelDatatype:E}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,v={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new vc({fragmentShaderSource:Kv,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!c(a.vertexArray)){let R={direction:0},E=new Uint8Array(4*2);E[0]=0,E[1]=0,E[2]=255,E[3]=0,E[4]=255,E[5]=255,E[6]=0,E[7]=255;let I=_t.createVertexBuffer({context:o,typedArray:E,usage:Ne.STATIC_DRAW}),v=[{index:R.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:q.UNSIGNED_BYTE}],P=_t.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=tn.fromCache({context:o,vertexShaderSource:Jv,fragmentShaderSource:zv,attributeLocations:R}),a.renderState=Oe.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let l=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,f=this._boundingVolume2D;m.clone(l,u.center),f.center.x=d.z,f.center.y=d.x,f.center.z=d.y,u.radius=w.SOLAR_RADIUS+w.SOLAR_RADIUS*this._glowLengthTS,f.radius=u.radius,i===se.SCENE3D?ue.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&ue.clone(f,a.boundingVolume);let p=Oi.computeActualEllipsoidPosition(e,l,T9),y=m.magnitude(m.subtract(p,e.camera.position,T9)),h=o.uniformState.projection,g=Hxt;g.x=0,g.y=0,g.z=-y,g.w=1;let x=M.multiplyByVector(h,g,T9),S=Oi.clipToGLWindowCoordinates(t.viewport,x,Bxt);g.x=w.SOLAR_RADIUS;let V=M.multiplyByVector(h,g,T9),Z=Oi.clipToGLWindowCoordinates(t.viewport,V,Yxt);return this._size=D.magnitude(D.subtract(Z,S,T9)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};S9.prototype.isDestroyed=function(){return!1};S9.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(),he(this)};var C9=S9;var k$i=_(T(),1);var T$i=_(T(),1);var lSe=_(oN(),1);var vqi=_(T(),1);function zxt(e,t,n){return C.typeOf.string("samplerUniformName",e),C.typeOf.string("matrixUniformName",t),C.typeOf.string("styleUniformName",n),`    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 V9=zxt;var Mqi=_(T(),1);var Kxt={modifyFragmentShader:function(t){return t=Be.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}}},LL=Kxt;var pS={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function L9(e){C.typeOf.object("options",e),C.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=Y.clone(Y.DARKGRAY),this._highlightColor=Y.clone(Y.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=pS.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??Xe.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=Sn.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??Ar.NONE,this._splittingEnabled=!1,this._error=void 0,Jxt(this,e)}Object.defineProperties(L9.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return Y.clone(this._highlightColor)},set:function(e){this._highlightColor=Y.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(c(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ue.clone(e,this._boundingSphere)}}});function Jxt(e,t){let n=I_.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&&c(n.batchTableBinary)&&(n.styleableProperties=zp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),c(n.draco)){let a=n.draco;e._decodingState=pS.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;c(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;c(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;c(r)&&(c(r.constantColor)&&(e._constantColor=Y.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;c(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 Qxt=new m,jxt=new m,qxt=new m,aSe,$D;function $xt(e){if(!c($D)){aSe=new lSe.default(0),$D=new Array(e);for(let t=0;t<e;++t)$D[t]=aSe.random()}return $D}function e_t(e){let n=e.length/3,i=Math.min(n,20),o=$xt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=m.fromElements(r,r,r,Qxt),l=m.fromElements(s,s,s,jxt);for(let u=0;u<i;++u){let f=Math.floor(o[u]*n),p=m.unpack(e,f*3,qxt);m.minimumByComponent(a,p,a),m.maximumByComponent(l,p,l)}let d=ue.fromCornerPoints(a,l);return d.radius+=w.EPSILON2,d}function cSe(e,t){let n=q.fromTypedArray(e);return n===q.INT||n===q.UNSIGNED_INT||n===q.DOUBLE?(ht("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 t_t=new ce,n_t=new ce,i_t=new Y,dSe=0,eB=1,Q8=2,uSe=3,o_t=4,H8=new M,r_t=new M;function s_t(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,l=i.batchIds,d=i.styleableProperties,u=c(d),f=e._isQuantized,p=e._isQuantizedDraco,y=e._isOctEncoded16P,h=e._isOctEncodedDraco,g=e._quantizedRange,x=e._octEncodedRange,S=e._isRGB565,V=e._isTranslucent,Z=e._hasColors,R=e._hasNormals,E=e._hasBatchIds,I,v,P=[],F={};if(e._styleableShaderAttributes=F,u){let O=o_t;for(let H in d)if(d.hasOwnProperty(H)){let U=d[H],K=cSe(U.typedArray,H);I=U.componentCount,v=q.fromTypedArray(K);let Q=_t.createVertexBuffer({context:n,typedArray:K,usage:Ne.STATIC_DRAW});e._geometryByteLength+=Q.sizeInBytes;let ie={index:O,vertexBuffer:Q,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(ie),F[H]={location:O,componentCount:I},++O}}let N=_t.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Ne.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let b;Z&&(b=_t.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let G;R&&(G=_t.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=G.sizeInBytes);let X;E&&(l.typedArray=cSe(l.typedArray,"batchIds"),X=_t.createVertexBuffer({context:n,typedArray:l.typedArray,usage:Ne.STATIC_DRAW}),e._geometryByteLength+=X.sizeInBytes);let W=[];if(f?v=q.UNSIGNED_SHORT:p?v=g<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT:v=q.FLOAT,W.push({index:dSe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(f||p?e._boundingSphere=ue.fromCornerPoints(m.ZERO,e._quantizedVolumeScale):e._boundingSphere=e_t(r.typedArray)),Z)if(S)W.push({index:eB,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let O=V?4:3;W.push({index:eB,vertexBuffer:b,componentsPerAttribute:O,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}R&&(y?(I=2,v=q.UNSIGNED_BYTE):h?(I=2,v=x<=255?q.UNSIGNED_BYTE:q.UNSIGNED_SHORT):(I=3,v=q.FLOAT),W.push({index:Q8,vertexBuffer:G,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&W.push({index:uSe,vertexBuffer:X,componentsPerAttribute:1,componentDatatype:q.fromTypedArray(l.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(W=W.concat(P));let A=new ni({context:n,attributes:W}),k={depthTest:{enabled:!0}},B={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===Xe.CESIUM_3D_TILE&&(k.stencilTest=kt.setCesium3DTileBit(),k.stencilMask=kt.CESIUM_3D_TILE_MASK,B.stencilTest=kt.setCesium3DTileBit(),B.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Oe.fromCache(k),e._translucentRenderState=Oe.fromCache(B),e._drawCommand=new et({boundingVolume:new ue,cull:e._cull,modelMatrix:new M,primitiveType:ve.POINTS,vertexArray:A,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Xe.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function a_t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=t_t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let l=t.camera.frustum,d;t.mode===se.SCENE2D||l instanceof sn?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!c(a))return Y.TRANSPARENT;let l=Y.clone(a.edgeColor,i_t);return l.alpha=a.edgeWidth,l},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!c(a))return M.IDENTITY;let l=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,l,H8);let d=M.multiply(H8,a.modelMatrix,H8);return M.inverseTranspose(d,r_t)}};LL.addUniforms(e,s),(i||o||r)&&(s=St(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=n_t;if(c(e._quantizedVolumeScale)){let l=m.clone(e._quantizedVolumeScale,a);m.divideByScalar(l,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),c(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function z8(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 K8(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 J8(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 c_t={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 l_t(e,t,n){let i,o,r,s=t.context,a=c(n),l=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,f=e._isOctEncodedDraco,p=e._isRGB565,y=e._isTranslucent,h=e._hasColors,g=e._hasNormals,x=e._hasBatchIds,S=e._backFaceCulling,V=e._normalShading,Z=e._drawCommand.vertexArray,R=e.clippingPlanes,E=e._attenuation,I,v,P,F=y,N=He(c_t),b={},G=e._styleableShaderAttributes;for(o in G)G.hasOwnProperty(o)&&(r=G[o],N[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let me={translucent:!1},_e="(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)";I=n.getColorShaderFunction(`getColorFromStyle${_e}`,N,me),v=n.getShowShaderFunction(`getShowFromStyle${_e}`,N,me),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${_e}`,N,me),c(I)&&me.translucent&&(F=!0)}e._styleTranslucent=F;let X=c(I),W=c(v),A=c(P),k=e.isClipped,B=[],O=[];X&&(z8(I,B),K8(I,O)),W&&(z8(v,B),K8(v,O)),A&&(z8(P,B),K8(P,O));let H=O.indexOf("COLOR")>=0,U=O.indexOf("NORMAL")>=0;if(U&&!g)throw new le("Style references the NORMAL semantic but the point cloud does not have normals");for(o in G)if(G.hasOwnProperty(o)){r=G[o];let me=B.indexOf(r.location)>=0,_e=J8(Z,r.location);_e.enabled=me}let K=h&&(!X||H);if(h){let me=J8(Z,eB);me.enabled=K}let Q=g&&(V||S||U);if(g){let me=J8(Z,Q8);me.enabled=Q}let ie={a_position:dSe};K&&(ie.a_color=eB),Q&&(ie.a_normal=Q8),x&&(ie.a_batchId=uSe);let j="",$=B.length;for(i=0;i<$;++i){let me=B[i];r=b[me];let _e=r.componentCount,Ve=`czm_3dtiles_property_${me}`,Ie;_e===1?Ie="float":Ie=`vec${_e}`,j+=`in ${Ie} ${Ve}; 
`,ie[Ve]=r.location}a_t(e,t);let ne=`in vec3 a_position; 
out vec4 v_color; 
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; 
uniform vec4 u_constantColor; 
uniform vec4 u_highlightColor; 
`;ne+=`float u_pointSize; 
float tiles3d_tileset_time; 
`,E&&(ne+=`float u_geometricError; 
float u_depthMultiplier; 
`),ne+=j,K&&(y?ne+=`in vec4 a_color; 
`:p?ne+=`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; 
`:ne+=`in vec3 a_color; 
`),Q&&(u||f?ne+=`in vec2 a_normal; 
`:ne+=`in vec3 a_normal; 
`),x&&(ne+=`in float a_batchId; 
`),(l||d||f)&&(ne+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; 
`),X&&(ne+=I),W&&(ne+=v),A&&(ne+=P),ne+=`void main() 
{ 
    u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; 
    tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; 
`,E&&(ne+=`    u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; 
    u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; 
`),K?y?ne+=`    vec4 color = a_color; 
`:p?ne+=`    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); 
`:ne+=`    vec4 color = vec4(a_color, 1.0); 
`:ne+=`    vec4 color = u_constantColor; 
`,l||d?ne+=`    vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; 
`:ne+=`    vec3 position = a_position; 
`,ne+=`    vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); 
`,Q?(u?ne+=`    vec3 normal = czm_octDecode(a_normal); 
`:f?ne+=`    vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; 
`:ne+=`    vec3 normal = a_normal; 
`,ne+=`    vec3 normalEC = czm_normal * normal; 
`):ne+=`    vec3 normal = vec3(1.0); 
`,X&&(ne+=`    color = getColorFromStyle(position, position_absolute, color, normal); 
`),W&&(ne+=`    float show = float(getShowFromStyle(position, position_absolute, color, normal)); 
`),A?ne+=`    gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; 
`:E?ne+=`    vec4 positionEC = czm_modelView * vec4(position, 1.0); 
    float depth = -positionEC.z; 
    gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); 
`:ne+=`    gl_PointSize = u_pointSize; 
`,ne+=`    color = color * u_highlightColor; 
`,Q&&V&&(ne+=`    float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); 
    diffuseStrength = max(diffuseStrength, 0.4); 
    color.xyz *= diffuseStrength * czm_lightColor; 
`),ne+=`    v_color = color; 
    gl_Position = czm_modelViewProjection * vec4(position, 1.0); 
`,Q&&S&&(ne+=`    float visible = step(-normalEC.z, 0.0); 
    gl_Position *= visible; 
    gl_PointSize *= visible; 
`),W&&(ne+=`    gl_Position.w *= float(show); 
    gl_PointSize *= float(show); 
`),ne+=`} 
`;let be=`in vec4 v_color; 
`;k&&(be+=`uniform highp sampler2D u_clippingPlanes; 
uniform mat4 u_clippingPlanesMatrix; 
uniform vec4 u_clippingPlanesEdgeStyle; 
`,be+=`
`,be+=c0(R,s),be+=`
`),be+=`void main() 
{ 
    out_FragColor = czm_gammaCorrect(v_color); 
`,k&&(be+=V9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),be+=`} 
`,e.splitDirection!==Ar.NONE&&(be=LL.modifyFragmentShader(be)),c(e._vertexShaderLoaded)&&(ne=e._vertexShaderLoaded(ne)),c(e._fragmentShaderLoaded)&&(be=e._fragmentShaderLoaded(be));let Ce=e._drawCommand;c(Ce.shaderProgram)&&Ce.shaderProgram.destroy(),Ce.shaderProgram=tn.fromCache({context:s,vertexShaderSource:ne,fragmentShaderSource:be,attributeLocations:ie});try{Ce.shaderProgram._bind()}catch{throw new le("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function d_t(e,t){if(e._decodingState===pS.READY)return!1;if(e._decodingState===pS.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=eb.decodePointCloud(i,t);c(o)&&(e._decodingState=pS.DECODING,o.then(function(r){e._decodingState=pS.READY;let s=c(r.POSITION)?r.POSITION.array:void 0,a=c(r.RGB)?r.RGB.array:void 0,l=c(r.RGBA)?r.RGBA.array:void 0,d=c(r.NORMAL)?r.NORMAL.array:void 0,u=c(r.BATCH_ID)?r.BATCH_ID.array:void 0,f=c(s)&&c(r.POSITION.data.quantization),p=c(d)&&c(r.NORMAL.data.quantization);if(f){let x=r.POSITION.data.quantization,S=x.range;e._quantizedVolumeScale=m.fromElements(S,S,S),e._quantizedVolumeOffset=m.unpack(x.minValues),e._quantizedRange=(1<<x.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let y=n.styleableProperties,h=i.batchTableProperties;for(let x in h)if(h.hasOwnProperty(x)){let S=r[x];c(y)||(y={}),y[x]={typedArray:S.array,componentCount:S.data.componentsPerAttribute}}c(s)&&(n.positions={typedArray:s});let g=l??a;c(g)&&(n.colors={typedArray:g}),c(d)&&(n.normals={typedArray:d}),c(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=y}).catch(function(r){e._decodingState=pS.FAILED,e._error=r}))}return!0}var u_t=new ce,m_t=new m;L9.prototype.update=function(e){let t=e.context;if(c(this._error)){let d=this._error;throw this._error=void 0,d}if(d_t(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),c(this._drawCommand)||(s_t(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,d),c(this._rtcCenter)&&M.multiplyByTranslation(d,this._rtcCenter,d),c(this._quantizedVolumeOffset)&&M.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==se.SCENE3D){let f=e.mapProjection,p=M.getColumn(d,3,u_t);ce.equals(p,ce.UNIT_W)||wt.basisTo2D(f,d,d)}let u=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,u),this._cull){let f=u.center;M.multiplyByPoint(d,f,f);let p=M.getScale(d,m_t);u.radius*=m.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Ar.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&l_t(this,e,this._style),this._drawCommand.castShadows=Sn.castShadows(this.shadows),this._drawCommand.receiveShadows=Sn.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?Xe.TRANSLUCENT:this._opaquePass;let a=e.commandList,l=e.passes;(l.render||l.pick)&&a.push(this._drawCommand)};L9.prototype.isDestroyed=function(){return!1};L9.prototype.destroy=function(){let e=this._drawCommand;return c(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),he(this)};var Z9=L9;function yS(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.clock",e.clock),C.typeOf.object("options.intervals",e.intervals),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??Sn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Vh(e.shading),this.style=e.style,this.frameFailed=new ye,this.frameChanged=new ye,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new lb,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(yS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(c(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function f_t(e){return`uniform vec4 czm_pickColor;
${e}`}function h_t(e){return function(t){return St(t,{czm_pickColor:function(){return e._pickId.color}})}}function p_t(){return"czm_pickColor"}yS.prototype.makeStyleDirty=function(){this._styleDirty=!0};yS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var b_t=new ee;function q8(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function bS(e,t){return e._intervals.indexOf(t.start)}function y_t(e,t){let n=e._intervals,i=e._clock,o=q8(e);if(o===0)return;let r=e._getAverageLoadTime(),s=ee.addSeconds(i.currentTime,r*o,b_t),a=n.indexOf(s),l=bS(e,t);return a===l&&(o>=0?++a:--a),n.get(a)}function g_t(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function x_t(e,t,n){let i=q8(e),o=bS(e,t),r=bS(e,n);return i>=0?o>=r:o<=r}function fSe(e,t){return function(n){let i=c(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 __t(e,t,n){let i=bS(e,t),o=e._frames,r=o[i];if(!c(r)){let s=t.data.transform,a=c(s)?M.fromArray(s):void 0,l=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ti(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:l},o[i]=r,Ge.fetchArrayBuffer({url:l}).then(function(d){r.pointCloud=new Z9({arrayBuffer:d,cull:!0,fragmentShaderLoaded:f_t,uniformMapLoaded:h_t(e),pickIdLoaded:p_t})}).catch(fSe(e,l))}return r}function T_t(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 S_t(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(c(o)&&!t.ready){let r=i.commandList,s=r.length;if(hSe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ti()-t.timestamp)/1e3;T_t(e,a)}}t.touchedFrameNumber=i.frameNumber}var C_t=new M;function V_t(e,t){let n=e.shading;return c(n)&&c(n.baseResolution)?n.baseResolution:c(t.boundingSphere)?w.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function L_t(e){let t=e.shading;return c(t)&&c(t.maximumAttenuation)?t.maximumAttenuation:10}var Z_t=new Vh;function hSe(e,t,n,i){let o=e.shading??Z_t,r=t.pointCloud,s=t.transform??M.IDENTITY;r.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,C_t),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=V_t(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=L_t(e);try{r.update(i)}catch(a){fSe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function j8(e,t,n,i){let o=__t(e,t,i);S_t(e,o,n,i)}function R_t(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function pSe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(c(r)&&(!c(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),c(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function G_t(e,t){let n=bS(e,t),i=e._frames[n];if(c(i)&&i.ready)return i}function mSe(e,t,n,i,o){return c(n)?n.ready?!0:(j8(e,t,i,o),n.ready):!1}function E_t(e,t,n,i,o){let r,s,a,l=e._intervals,d=e._frames,u=bS(e,n),f=bS(e,t);if(u>=f){for(r=u;r>=f;--r)if(s=l.get(r),a=d[r],mSe(e,s,a,i,o))return s}else for(r=u;r<=f;++r)if(s=l.get(r),a=d[r],mSe(e,s,a,i,o))return s;return t}function X_t(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];c(s)&&c(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var ZL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};yS.prototype.update=function(e){if(e.mode===se.MORPHING||!this.show)return;c(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),c(this._loadTimestamp)||(this._loadTimestamp=ee.clone(e.time));let t=Math.max(ee.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=c(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)&&X_t(this,o,s),ZL.timeSinceLoad=t,ZL.isClipped=r;let a=this.shading,l=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,f=this._previousInterval,p=this._nextInterval,y=g_t(this);if(!c(y))return;let h=!1,g=q8(this),x=g===0;g!==this._clockMultiplier&&(h=!0,this._clockMultiplier=g),(!c(f)||x)&&(f=y),(!c(p)||h||x_t(this,y,p))&&(p=y_t(this,y)),f=E_t(this,f,y,ZL,e);let S=G_t(this,f);c(S)||(j8(this,f,ZL,e),S=this._lastRenderedFrame),c(S)&&hSe(this,S,ZL,e),c(p)&&j8(this,p,ZL,e);let V=this;c(S)&&!c(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),c(S)&&S!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=f,this._nextInterval=p,this._lastRenderedFrame=S;let Z=this._totalMemoryUsageInBytes,R=this.maximumMemoryUsage*1024*1024;Z>R&&pSe(this,R_t(e));let I=d.length-u;c(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&l.update(e,u,a,this.boundingSphere)};yS.prototype.isDestroyed=function(){return!1};yS.prototype.destroy=function(){return pSe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),he(this)};var RL=yS;function gSe(e,t){if(c(t)){let n=t.clock;c(n)&&n.getValue(e)}}function I_t(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!c(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 xSe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,c(e._scene)&&(e._scene.pixelRatio=t),t}function _Se(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=xSe(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 TSe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;c(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Go(e,t){if(!c(e))throw new L("container is required.");e=Wn(e),t=t??z.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=Ot.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=Ot.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 l=c(t.creditContainer)?Wn(t.creditContainer):n;l.appendChild(a);let d=c(t.creditViewport)?Wn(t.creditViewport):n,u=t.showRenderLoopErrors??!0,f=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=l,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=f,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 ye,this._allowDataSourcesToSuspendAnimation=!0,this._clock=c(t.clock)?t.clock:new _f,c(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),_Se(this);try{let p=t.ellipsoid??re.default,y=new g9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=y,y.camera.constrainedAxis=m.UNIT_Z,xSe(this),TSe(this);let h=t.globe;c(h)||(h=new SF(p)),h!==!1&&(y.globe=h,y.globe.shadows=t.terrainShadows??Sn.RECEIVE_ONLY);let g=t.skyBox;!c(g)&&re.WGS84.equals(p)&&(g=_9.createEarthSkyBox()),g!==!1&&(y.skyBox=g,y.sun=new C9,re.WGS84.equals(p)&&(y.moon=new GF));let x=t.skyAtmosphere;!c(x)&&re.WGS84.equals(p)&&(x=new x9(p),x.show=t.globe!==!1&&h.show),x!==!1&&(y.skyAtmosphere=x);let S=t.baseLayer;if(t.globe!==!1&&S!==!1&&(c(S)||(S=Ya.fromWorldImagery()),y.imageryLayers.add(S)),c(t.terrainProvider)&&t.globe!==!1&&(y.terrainProvider=t.terrainProvider),c(t.terrain)&&t.globe!==!1){if(c(t.terrainProvider))throw new L("Specify either options.terrainProvider or options.terrain.");y.setTerrain(t.terrain)}this._screenSpaceEventHandler=new tu(i),c(t.sceneMode)&&(t.sceneMode===se.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===se.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(P,F){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering.  Rendering has stopped.",void 0,F)},y.renderError.addEventListener(this._onRenderError);let Z=t.dataSources,R=!1;c(Z)||(Z=new l2,R=!0);let E=new z2({scene:y,dataSourceCollection:Z}),I=new hr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=Z,this._destroyDataSourceCollection=R,this._dataSourceDisplay=E,this._eventHelper=I,this._canAnimateUpdateCallback=this._updateCanAnimate,I.add(this._clock.onTick,Go.prototype._onTick,this),I.add(y.morphStart,Go.prototype._clearTrackedObject,this),I.add(Z.dataSourceAdded,Go.prototype._onDataSourceAdded,this),I.add(Z.dataSourceRemoved,Go.prototype._onDataSourceRemoved,this),I.add(y.postRender,Go.prototype._postRender,this);let v=Z.length;for(let P=0;P<v;P++)this._dataSourceAdded(Z,Z.get(P));this._dataSourceAdded(void 0,E.defaultDataSource),I.add(Z.dataSourceAdded,Go.prototype._dataSourceAdded,this),I.add(Z.dataSourceRemoved,Go.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL.  Consider trying a different web browser or updating your video drivers.  Detailed error information is below:',p),p}}Object.defineProperties(Go.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){if(e<=0)throw new L("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&I_t(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new L("resolutionScale must be greater than 0.");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,$8(this);let t=this.scene,n=t.mode;!c(e)||!c(e.position)?(this._needTrackedEntityUpdate=!1,(n===se.COLUMBUS_VIEW||n===se.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===se.COLUMBUS_VIEW||n===se.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(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,gSe(this.clock,e))}}});Go.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 l(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}l(),c(window.addEventListener)&&window.addEventListener("resize",l,!1);let d=c(t),u=c(n);if(d||u){let y=document.createElement("div");if(y.className="cesium-widget-errorPanel-message",a.appendChild(y),u){let h=qh(n);d||(typeof n=="string"&&(n=new Error(n)),t=qh({name:n.name,message:n.message}),h=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${h}`);let g=document.createElement("div");g.className="cesium-widget-errorPanel-message-details collapsed";let x=document.createElement("span");x.className="cesium-widget-errorPanel-more-details",x.appendChild(document.createTextNode("See more...")),g.appendChild(x),g.onclick=function(S){g.removeChild(x),g.appendChild(document.createTextNode(h)),g.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",g.onclick=void 0},a.appendChild(g)}y.innerHTML=`<p>${t}</p>`}let f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(f);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){c(l)&&c(window.removeEventListener)&&window.removeEventListener("resize",l,!1),i.removeChild(o)},f.appendChild(p),i.appendChild(o)};Go.prototype.isDestroyed=function(){return!1};Go.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(),c(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()),he(this)};Go.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,_Se(this),TSe(this),this._scene.requestRender())};Go.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Go.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Go.prototype._onEntityCollectionChanged,this)};Go.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Go.prototype._onEntityCollectionChanged,this),c(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Go.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var W_t=new ue;Go.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(c(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??W_t)===ut.DONE&&i.update(t)}};Go.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)}};Go.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Go.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&gSe(this.clock,e)};Go.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Go.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Go.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}};Go.prototype.zoomTo=function(e,t){return SSe(this,e,{offset:t},!1)};Go.prototype.flyTo=function(e,t){return SSe(this,e,t,!0)};function SSe(e,t,n,i){if(!c(t))throw new L("zoomTarget is required.");$8(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 Ya){let s;c(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let l=r.readyEvent.addEventListener(()=>{l(),a(r.getImageryRectangle())})}),s.then(function(a){return WT(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof bs||r instanceof RL||r instanceof Ng){e._zoomTarget=r;return}if(r.isLoading&&c(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,c(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function R9(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function $8(e){let t=e._zoomPromise;c(t)&&(R9(e),e._completeZoom(!1))}Go.prototype._postRender=function(){w_t(this),P_t(this)};var bSe=new ue;function w_t(e){let t=e._zoomTarget;if(!c(t)||e.scene.mode===se.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){c(o.offset)||(o.offset=new rm(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),R9(e)}if(t instanceof RL){if(c(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(f){s(f.boundingSphere),u()});return}if(t instanceof bs||t instanceof Ng){s(t.boundingSphere);return}if(t instanceof pe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),R9(e);return}let a=t,l=[];for(let u=0,f=a.length;u<f;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,bSe);if(p===ut.PENDING)return;p!==ut.FAILED&&l.push(ue.clone(bSe))}if(l.length===0){$8(e);return}e.trackedEntity=void 0;let d=ue.fromBoundingSpheres(l);e._zoomIsFlight?(R9(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(M.IDENTITY),R9(e),e._completeZoom(!0))}var ySe=new ue;function P_t(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=J.getValueOrUndefined(t.position,n);if(!c(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,ySe);if(r===ut.PENDING)return;let s=o.mode;(s===se.COLUMBUS_VIEW||s===se.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===se.COLUMBUS_VIEW||s===se.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ut.FAILED?ySe:void 0;e._entityView=new J2(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var G9=Go;var jeo=_(T(),1);var Eeo=_(T(),1);function XL(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var gS=new de;function v_t(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}XL.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let y=t;y<=i;++y)v_t(e,y,p,s)||s.push(new GL(r,void 0,0,y,p));r.tileXYToRectangle(t,n,e,gS);let a=gS.west,l=gS.north;r.tileXYToRectangle(i,o,e,gS);let d=gS.east,u=gS.south,f=new k_t(e,a,u,d,l);for(let p=0;p<s.length;++p){let y=s[p];e7(y.extent,f)&&U_t(this._maximumLevel,y,f)}};XL.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(EL(i.extent,e)){t=i;break}}return c(t)?E9(void 0,t,e):-1};var F_t=[],A_t=[],M_t=new de,N_t=new de;XL.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=F_t;t.length=0,e.east<e.west?(t.push(de.fromRadians(-Math.PI,e.south,e.east,e.north,M_t)),t.push(de.fromRadians(e.west,e.south,Math.PI,e.north,N_t))):t.push(e);let n=A_t;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)X9(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(c(n[i])&&n[i].length===0)return i;return 0};var CSe=new pe;XL.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,gS);return de.center(i,CSe),this.computeMaximumLevelAtPosition(CSe)>=e};XL.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 GL(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(GL.prototype,{nw:{get:function(){return this._nw||(this._nw=new GL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new GL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new GL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new GL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function k_t(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function e7(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 U_t(e,t,n){for(;t.level<e;)if(tB(t.nw.extent,n))t=t.nw;else if(tB(t.ne.extent,n))t=t.ne;else if(tB(t.sw.extent,n))t=t.sw;else if(tB(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=Wo(t.rectangles,n.level,O_t);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function O_t(e,t){return e.level-t}function tB(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function EL(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function E9(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&EL(t._nw.extent,n),s=t._ne&&EL(t._ne.extent,n),a=t._sw&&EL(t._sw.extent,n),l=t._se&&EL(t._se.extent,n);if(r+s+a+l>1){r&&(i=Math.max(i,E9(t,t._nw,n))),s&&(i=Math.max(i,E9(t,t._ne,n))),a&&(i=Math.max(i,E9(t,t._sw,n))),l&&(i=Math.max(i,E9(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:l?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];EL(a,n)&&(i=a.level)}t=t.parent}return i}function X9(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||e7(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]=D_t(e[s.level],s)}X9(e,t._nw,n),X9(e,t._ne,n),X9(e,t._sw,n),X9(e,t._se,n)}function D_t(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];e7(o,t)?(o.west<t.west&&n.push(new de(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new de(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new de(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new de(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Hf=XL;var B_t=15;function VSe(e){this.ellipsoid=e.ellipsoid??re.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}VSe.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 Y_t(e,t){let n=t.copyrightText;c(n)&&(e.credit=new Ct(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=de.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Ki(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new D(r.xmin,r.ymin),s.rectangleNortheastInMeters=new D(r.xmax,r.ymax),e.tilingScheme=new ss(s)}else throw new le("Invalid spatial reference");let a=t.tileInfo;if(!c(a))throw new le("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?cm.LERC:cm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Hf(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Hf(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=rs.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."),c(t.minValues)&&c(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function H_t(e,t,n){try{let i=await t.fetchJson();Y_t(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,o),i}}function Ug(e){e=e??z.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 ye}Object.defineProperties(Ug.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}}});Ug.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ge.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new VSe(t);await H_t(o,i);let r=new Ug(t);return o.build(r),r._resource=n,r};Ug.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&&!c(t7(this,n+1,e*2,t*2))){let f=LSe(this,n+1,e*2,t*2);s=f.promise,a=f.request}let l=o.fetchArrayBuffer();if(!c(l)||!c(s))return;let d=this,u=this._tilesAvailable;return Promise.all([l,s]).then(function(f){return new Da({buffer:f[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):B_t,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(f){if(c(a)&&a.state===jn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=jn.CANCELLED,Promise.reject(f)}return Promise.reject(f)})};function t7(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}Ug.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Ug.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=t7(this,n,e,t);if(c(i))return i;LSe(this,n,e,t)};Ug.prototype.loadTileDataAvailability=function(e,t,n){};function z_t(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],l={startX:e.x,startY:e.y,endX:0,endY:0},d=new D(e.x+1,e.y+1),u=!1,f=!1;for(;!(u&&f);){let p=d.x,y=f?d.y+1:d.y;if(!u){for(let h=e.y;h<y;++h)if(i[h*t+d.x]!==s){u=!0;break}u?(a.push(new D(d.x,e.y)),--d.x,--p,l.endX=d.x):d.x===o?(l.endX=d.x,u=!0):++d.x}if(!f){let h=d.y*t;for(let g=e.x;g<=p;++g)if(i[h+g]!==s){f=!0;break}f?(a.push(new D(e.x,d.y)),--d.y,l.endY=d.y):d.y===r?(l.endY=d.y,f=!0):++d.y}}return{endingIndices:a,range:l,value:s}}function K_t(e,t,n,i,o){let r=[];if(o.every(function(l){return l===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new D(0,0)];for(;a.length>0;){let l=a.pop(),d=z_t(l,n,i,o);if(d.value===1){let f=d.range;f.startX+=e,f.endX+=e,f.startY+=t,f.endY+=t,r.push(f)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function LSe(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}`,l=e._availableCache;if(c(l[a]))return l[a];let d=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN}),f=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return c(f)?(f=f.then(function(p){let y=K_t(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let h=e._tilesAvailable;for(let g=0;g<y.length;++g){let x=y[g];h.addAvailableTileRange(t,x.startX,x.startY,x.endX,x.endY)}return t7(e,t,n,i)}),l[a]={promise:f,request:d},f=f.finally(function(p){return delete l[a],p}),{promise:f,request:d}):{}}var n7=Ug;var sto=_(T(),1);var ZSe="https://dev.virtualearth.net/REST/v1/Locations";function i7(e){e=e??z.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new L("options.key is required.");this._key=t;let n={key:t};c(e.culture)&&(n.culture=e.culture),this._resource=new Ge({url:ZSe,queryParameters:n}),this._credit=new Ct('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(i7.prototype,{url:{get:function(){return ZSe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});i7.prototype.geocode=async function(e){return C.typeOf.string("query",e),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],l=r[2],d=r[3];return{displayName:o.name,destination:de.fromDegrees(a,s,d,l)}})})};var o7=i7;var dto=_(T(),1);function r7(){}Object.defineProperties(r7.prototype,{credit:{get:function(){}}});r7.prototype.geocode=function(e){C.typeOf.string("query",e);let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:m.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var s7=r7;var _to=_(T(),1);var J_t=new ce,RSe=new m,IL=new m;function Q_t(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,l){c(l)||(l=new m);let d=(a-i)*o;return m.lerp(r,s,d,l)}}return function(i,o){c(o)||(o=new m);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=J_t;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let l,d,u,f,p;return r===0?(l=t[0],d=t[1],u=e.firstTangent,f=m.subtract(t[2],l,RSe),m.multiplyByScalar(f,.5,f),p=M.multiplyByVector(Ry.hermiteCoefficientMatrix,a,a)):r===t.length-2?(l=t[r],d=t[r+1],f=e.lastTangent,u=m.subtract(d,t[r-1],RSe),m.multiplyByScalar(u,.5,u),p=M.multiplyByVector(Ry.hermiteCoefficientMatrix,a,a)):(l=t[r-1],d=t[r],u=t[r+1],f=t[r+2],p=M.multiplyByVector(Og.catmullRomCoefficientMatrix,a,a)),o=m.multiplyByScalar(l,p.x,o),m.multiplyByScalar(d,p.y,IL),m.add(o,IL,o),m.multiplyByScalar(u,p.z,IL),m.add(o,IL,o),m.multiplyByScalar(f,p.w,IL),m.add(o,IL,o)}}var j_t=new m,q_t=new m;function Og(e){e=e??z.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(C.defined("points",t),C.defined("times",n),C.typeOf.number.greaterThanOrEquals("points.length",t.length,2),C.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(c(i)||(i=j_t,m.multiplyByScalar(t[1],2,i),m.subtract(i,t[2],i),m.subtract(i,t[0],i),m.multiplyByScalar(i,.5,i)),!c(o))){let r=t.length-1;o=q_t,m.multiplyByScalar(t[r-1],2,o),m.subtract(t[r],o,o),m.add(o,t[r-2],o),m.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=m.clone(i),this._lastTangent=m.clone(o),this._evaluateFunction=Q_t(this),this._lastTimeIndex=0}Object.defineProperties(Og.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}}});Og.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Og.prototype.findTimeInterval=Pi.prototype.findTimeInterval;Og.prototype.wrapTime=Pi.prototype.wrapTime;Og.prototype.clampTime=Pi.prototype.clampTime;Og.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var a7=Og;var bno=_(T(),1);var Bto=_(T(),1);var Rto=_(T(),1);var nB={};nB.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){if(!c(e))throw new L("threshold is required.");if(!c(t))throw new L("keepAbove is required.");if(!c(n))throw new L("u0 is required.");if(!c(i))throw new L("u1 is required.");if(!c(o))throw new L("u2 is required.");c(r)?r.length=0:r=[];let s,a,l;t?(s=n<e,a=i<e,l=o<e):(s=n>e,a=i>e,l=o>e);let d=s+a+l,u,f,p,y,h,g;return d===1?s?(u=(e-n)/(i-n),f=(e-n)/(o-n),r.push(1),r.push(2),f!==1&&(r.push(-1),r.push(0),r.push(2),r.push(f)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),y=(e-i)/(n-i),r.push(2),r.push(0),y!==1&&(r.push(-1),r.push(1),r.push(0),r.push(y)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):l&&(h=(e-o)/(n-o),g=(e-o)/(i-o),r.push(0),r.push(1),g!==1&&(r.push(-1),r.push(2),r.push(1),r.push(g)),h!==1&&(r.push(-1),r.push(2),r.push(0),r.push(h))):d===2?!s&&n!==e?(y=(e-i)/(n-i),h=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(y),r.push(-1),r.push(2),r.push(0),r.push(h)):!a&&i!==e?(g=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(g),r.push(-1),r.push(0),r.push(1),r.push(u)):!l&&o!==e&&(f=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(f),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};nB.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,l){if(!c(e))throw new L("x is required.");if(!c(t))throw new L("y is required.");if(!c(n))throw new L("x1 is required.");if(!c(i))throw new L("y1 is required.");if(!c(o))throw new L("x2 is required.");if(!c(r))throw new L("y2 is required.");if(!c(s))throw new L("x3 is required.");if(!c(a))throw new L("y3 is required.");let d=n-s,u=s-o,f=r-a,p=i-a,y=1/(f*d+u*p),h=t-a,g=e-s,x=(f*g+u*h)*y,S=(-p*g+d*h)*y,V=1-x-S;return c(l)?(l.x=x,l.y=S,l.z=V,l):new m(x,S,V)};nB.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,l){C.typeOf.number("x00",e),C.typeOf.number("y00",t),C.typeOf.number("x01",n),C.typeOf.number("y01",i),C.typeOf.number("x10",o),C.typeOf.number("y10",r),C.typeOf.number("x11",s),C.typeOf.number("y11",a);let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),f=(a-r)*(n-e)-(s-o)*(i-t);if(f===0)return;let p=d/f,y=u/f;if(p>=0&&p<=1&&y>=0&&y<=1)return c(l)||(l=new D),l.x=e+p*(n-e),l.y=t+p*(i-t),l};var Z0=nB;function Dg(e){if(!c(e)||!c(e.quantizedVertices))throw new L("options.quantizedVertices is required.");if(!c(e.indices))throw new L("options.indices is required.");if(!c(e.minimumHeight))throw new L("options.minimumHeight is required.");if(!c(e.maximumHeight))throw new L("options.maximumHeight is required.");if(!c(e.maximumHeight))throw new L("options.maximumHeight is required.");if(!c(e.boundingSphere))throw new L("options.boundingSphere is required.");if(!c(e.horizonOcclusionPoint))throw new L("options.horizonOcclusionPoint is required.");if(!c(e.westIndices))throw new L("options.westIndices is required.");if(!c(e.southIndices))throw new L("options.southIndices is required.");if(!c(e.eastIndices))throw new L("options.eastIndices is required.");if(!c(e.northIndices))throw new L("options.northIndices is required.");if(!c(e.westSkirtHeight))throw new L("options.westSkirtHeight is required.");if(!c(e.southSkirtHeight))throw new L("options.southSkirtHeight is required.");if(!c(e.eastSkirtHeight))throw new L("options.eastSkirtHeight is required.");if(!c(e.northSkirtHeight))throw new L("options.northSkirtHeight is required.");this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;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=oB(e.westIndices,o,t),this._southIndices=oB(e.southIndices,r,t),this._eastIndices=oB(e.eastIndices,o,t),this._northIndices=oB(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(Dg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return c(this._mesh)}}});var iB=[];function oB(e,t,n){iB.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)iB[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(iB.sort(t),Me.createTypedArray(n,iB)):e}var GSe="createVerticesFromQuantizedTerrainMesh",$_t=new gi(GSe),eTt=new gi(GSe,Ff.maximumAsynchronousTasks);Dg.prototype.createMesh=function(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);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,l=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),f=(a?eTt:$_t).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:l,exaggeration:r,exaggerationRelativeHeight:s});if(!c(f))return;let p=this;return Promise.resolve(f).then(function(y){let h=p._quantizedVertices.length/3,g=h+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,x=Me.createTypedArray(g,y.indices),S=new Float32Array(y.vertices),V=y.center,Z=y.minimumHeight,R=y.maximumHeight,E=p._boundingSphere,I=p._orientedBoundingBox,v=m.clone(y.occludeePointInScaledSpace)??p._horizonOcclusionPoint,P=y.vertexStride,F=Rc.clone(y.encoding);return p._mesh=new dm(V,S,x,y.indexCountWithoutSkirts,h,Z,R,E,v,P,I,F,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var tTt=new gi("upsampleQuantizedTerrainMesh",Ff.maximumAsynchronousTasks);Dg.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new L("tilingScheme is required.");if(!c(t))throw new L("thisX is required.");if(!c(n))throw new L("thisY is required.");if(!c(i))throw new L("thisLevel is required.");if(!c(o))throw new L("descendantX is required.");if(!c(r))throw new L("descendantY is required.");if(!c(s))throw new L("descendantLevel is required.");if(s-i>1)throw new L("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let d=t*2!==o,u=n*2===r,f=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),y=tTt.scheduleTask({vertices:l.vertices,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:d,isNorthChild:u,childRectangle:p,ellipsoid:f});if(!c(y))return;let h=Math.min(this._westSkirtHeight,this._eastSkirtHeight);h=Math.min(h,this._southSkirtHeight),h=Math.min(h,this._northSkirtHeight);let g=d?h*.5:this._westSkirtHeight,x=u?h*.5:this._southSkirtHeight,S=d?this._eastSkirtHeight:h*.5,V=u?this._northSkirtHeight:h*.5,Z=this._credits;return Promise.resolve(y).then(function(R){let E=new Uint16Array(R.vertices),I=Me.createTypedArray(E.length/3,R.indices),v;return c(R.encodedNormals)&&(v=new Uint8Array(R.encodedNormals)),new Dg({quantizedVertices:E,indices:I,encodedNormals:v,minimumHeight:R.minimumHeight,maximumHeight:R.maximumHeight,boundingSphere:ue.clone(R.boundingSphere),orientedBoundingBox:Xn.clone(R.orientedBoundingBox),horizonOcclusionPoint:m.clone(R.horizonOcclusionPoint),westIndices:R.westIndices,southIndices:R.southIndices,eastIndices:R.eastIndices,northIndices:R.northIndices,westSkirtHeight:g,southSkirtHeight:x,eastSkirtHeight:S,northSkirtHeight:V,childTileMask:0,credits:Z,createdByUpsampling:!0})})};var c7=32767,ESe=new m;Dg.prototype.interpolateHeight=function(e,t,n){let i=w.clamp((t-e.west)/e.width,0,1);i*=c7;let o=w.clamp((n-e.south)/e.height,0,1);return o*=c7,c(this._mesh)?rTt(this,i,o):sTt(this,i,o)};function XSe(e,t,n,i,o,r,s,a){let l=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),f=Math.max(i,r,a);return e>=l&&e<=d&&t>=u&&t<=f}var nTt=new D,iTt=new D,oTt=new D;function rTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let d=s[a],u=s[a+1],f=s[a+2],p=r.decodeTextureCoordinates(o,d,nTt),y=r.decodeTextureCoordinates(o,u,iTt),h=r.decodeTextureCoordinates(o,f,oTt);if(XSe(t,n,p.x,p.y,y.x,y.y,h.x,h.y)){let g=Z0.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,h.x,h.y,ESe);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){let x=r.decodeHeight(o,d),S=r.decodeHeight(o,u),V=r.decodeHeight(o,f);return g.x*x+g.y*S+g.z*V}}}}function sTt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,l=s.length;a<l;a+=3){let d=s[a],u=s[a+1],f=s[a+2],p=i[d],y=i[u],h=i[f],g=o[d],x=o[u],S=o[f];if(XSe(t,n,p,g,y,x,h,S)){let V=Z0.computeBarycentricCoordinates(t,n,p,g,y,x,h,S,ESe);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let Z=V.x*r[d]+V.y*r[u]+V.z*r[f];return w.lerp(e._minimumHeight,e._maximumHeight,Z/c7)}}}}Dg.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new L("thisX is required.");if(!c(t))throw new L("thisY is required.");if(!c(n))throw new L("childX is required.");if(!c(i))throw new L("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Dg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var xS=Dg;function aTt(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 WSe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??re.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=[]}WSe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=c(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 wSe(e,t,n){if(!t.format){let g="The tile format is not specified in the layer.json file.";throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}if(!t.tiles||t.tiles.length===0){let g="The layer.json file does not specify any tile URL templates.";throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,c(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 g=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}let l=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new ss({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let g=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}if(e.levelZeroMaximumGeometricError=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let g=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,g),new le(g)}let u;c(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:c(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),c(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),c(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let f=t.metadataAvailability,p=t.available,y;if(c(p)&&!c(f)){y=new Hf(e.tilingScheme,p.length);for(let g=0;g<p.length;++g){let x=p[g],S=e.tilingScheme.getNumberOfYTilesAtLevel(g);c(e.overallAvailability[g])||(e.overallAvailability[g]=[]);for(let V=0;V<x.length;++V){let Z=x[V],R=S-Z.endY-1,E=S-Z.startY-1;e.overallAvailability[g].push([Z.startX,R,Z.endX,E]),y.addAvailableTileRange(g,Z.startX,R,Z.endX,E)}}}else c(f)&&(u=new Hf(e.tilingScheme,d),y=new Hf(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],y.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,c(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new aTt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:l,availability:y,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:f,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let h=t.parentUrl;return c(h)?c(y)?(e.lastResource=e.lastResource.getDerivedResource({url:h}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await u7(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function cTt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(c(t)&&(i+=`
${t.message}`),e.previousError=Ro.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,i),e.previousError.retry)return u7(e,n);throw new le(i)}async function lTt(e,t,n){await wSe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Hf(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 l=s[a];o.addAvailableTileRange(r,l[0],l[1],l[2],l[3])}}}if(e.attribution.length>0){let o=new Ct(e.attribution);e.tileCredits.push(o)}return!0}async function u7(e,t){try{let n=await e.layerJsonResource.fetchJson();return lTt(e,n,t)}catch(n){return c(n)&&n.statusCode===404?(await wSe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):cTt(e,n,t)}}function zf(e){e=e??z.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 ye;let t=e.credit;typeof t=="string"&&(t=new Ct(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 l7={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function ISe(e){return!c(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 dTt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Da({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 uTt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,l=3,d=l+1,u=Float64Array.BYTES_PER_ELEMENT*l,f=Float64Array.BYTES_PER_ELEMENT*d,y=Uint16Array.BYTES_PER_ELEMENT*3,h=3,g=Uint16Array.BYTES_PER_ELEMENT,x=g*h,S=new DataView(t),V=new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let Z=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let R=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=new ue(new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0)),S.getFloat64(a+u,!0));a+=f;let I=new m(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let v=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*y,v>64*1024&&(g=Uint32Array.BYTES_PER_ELEMENT,x=g*h);let F=P.subarray(0,v),N=P.subarray(v,2*v),b=P.subarray(v*2,3*v);Fn.zigZagDeltaDecode(F,N,b),a%g!==0&&(a+=g-a%g);let G=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let X=Me.createTypedArrayFromArrayBuffer(v,t,a,G*h);a+=G*x;let W=0,A=X.length;for(let me=0;me<A;++me){let _e=X[me];X[me]=W-_e,_e===0&&++W}let k=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let B=Me.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*g;let O=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Me.createTypedArrayFromArrayBuffer(v,t,a,O);a+=O*g;let U=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let K=Me.createTypedArrayFromArrayBuffer(v,t,a,U);a+=U*g;let Q=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let ie=Me.createTypedArrayFromArrayBuffer(v,t,a,Q);a+=Q*g;let j,$;for(;a<S.byteLength;){let me=S.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let _e=S.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,me===l7.OCT_VERTEX_NORMALS&&e._requestVertexNormals)j=new Uint8Array(t,a,v*2);else if(me===l7.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,_e);else if(me===l7.METADATA&&e._requestMetadata){let Ve=S.getUint32(a,!0);if(Ve>0){let Ze=er(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ve).available;if(c(Ze))for(let De=0;De<Ze.length;++De){let Ke=n+De+1,rt=Ze[De],Xt=e._tilingScheme.getNumberOfYTilesAtLevel(Ke);for(let Ht=0;Ht<rt.length;++Ht){let qe=rt[Ht],mn=Xt-qe.endY-1,Dt=Xt-qe.startY-1;e.availability.addAvailableTileRange(Ke,qe.startX,mn,qe.endX,Dt),r.availability.addAvailableTileRange(Ke,qe.startX,mn,qe.endX,Dt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=_e}let ne=e.getLevelMaximumGeometricError(n)*5,be=e._tilingScheme.tileXYToRectangle(i,o,n),Ce=Xn.fromRectangle(be,Z,R,e._tilingScheme.ellipsoid);return new xS({center:V,minimumHeight:Z,maximumHeight:R,boundingSphere:E,orientedBoundingBox:Ce,horizonOcclusionPoint:I,quantizedVertices:P,encodedNormals:j,indices:X,westIndices:B,southIndices:H,eastIndices:K,northIndices:ie,westSkirtHeight:ne,southSkirtHeight:ne,eastSkirtHeight:ne,northSkirtHeight:ne,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:$,credits:e._tileCredits})}zf.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,l=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!c(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let f=m7(this,e,t,n,u,d===0);f.result&&(a=!0,l=l.then(()=>f.promise))}return!c(r)&&a?l.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):PSe(this,e,t,n,r,i)};function PSe(e,t,n,i,o,r){if(!c(o))return Promise.reject(new le("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 l=[];e._requestVertexNormals&&o.hasVertexNormals&&l.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&l.push("watermask"),e._requestMetadata&&o.hasMetadata&&l.push("metadata");let d,u,f=s[(t+a+i)%s.length],p=o.resource;c(p._ionEndpoint)&&!c(p._ionEndpoint.externalType)?(l.length!==0&&(u={extensions:l.join("-")}),d=ISe(void 0)):d=ISe(l);let y=p.getDerivedResource({url:f,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(c(y))return y.then(function(h){return c(h)?c(e._heightmapStructure)?dTt(e,h,i,t,n):uTt(e,h,i,t,n,o):Promise.reject(new le("Mesh buffer doesn't exist."))})}Object.defineProperties(zf.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}}});zf.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};zf.fromIonAssetId=async function(e,t){C.defined("assetId",e);let n=await xd.fromAssetId(e);return zf.fromUrl(n,t)};zf.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT,e=await Promise.resolve(e);let n=Ge.createIfNeeded(e);n.appendForwardSlash();let i=new WSe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await u7(i);let o=new zf(t);return i.build(o),o};zf.prototype.getTileDataAvailable=function(e,t,n){if(!c(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(m7(this,e,t,n,i[r],r===0).result)return;return!1};zf.prototype.loadTileDataAvailability=function(e,t,n){if(!c(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=m7(this,e,t,n,i[r],r===0);if(c(s.promise))return s.promise}};function d7(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,l=n/s|0;return{level:r,x:a,y:l}}function m7(e,t,n,i,o,r){if(!c(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},l=o.availabilityTilesLoaded,d=o.availability,u=d7(o,t,n,i);for(;c(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!l.isTileAvailable(u.level,u.x,u.y)){let f;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,f=o.availabilityPromiseCache[s],!c(f))){let p=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN});f=PSe(e,u.x,u.y,u.level,o,p),c(f)&&(o.availabilityPromiseCache[s]=f,f.then(a))}return{result:!0,promise:f}}u=d7(o,u.x,u.y,u.level)}return{result:!1}}zf._getAvailabilityTile=d7;var _S=zf;var Lno=_(T(),1);function R0(e){e=e??z.EMPTY_OBJECT;let t=e.radius;C.typeOf.number("radius",t);let 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 cl(n),this._workerName="createCircleGeometry"}R0.packedLength=cl.packedLength;R0.pack=function(e,t,n){return C.typeOf.object("value",e),cl.pack(e._ellipseGeometry,t,n)};var vSe=new cl({center:new m,semiMajorAxis:1,semiMinorAxis:1}),za={center:new m,radius:void 0,ellipsoid:re.clone(re.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new We,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};R0.unpack=function(e,t,n){let i=cl.unpack(e,t,vSe);return za.center=m.clone(i._center,za.center),za.ellipsoid=re.clone(i._ellipsoid,za.ellipsoid),za.ellipsoid=re.clone(i._ellipsoid,vSe._ellipsoid),za.height=i._height,za.extrudedHeight=i._extrudedHeight,za.granularity=i._granularity,za.vertexFormat=We.clone(i._vertexFormat,za.vertexFormat),za.stRotation=i._stRotation,za.shadowVolume=i._shadowVolume,c(n)?(za.semiMajorAxis=i._semiMajorAxis,za.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new cl(za),n):(za.radius=i._semiMajorAxis,new R0(za))};R0.createGeometry=function(e){return cl.createGeometry(e._ellipseGeometry)};R0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new R0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(R0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var f7=R0;var wno=_(T(),1);function WL(e){e=e??z.EMPTY_OBJECT;let t=e.radius;C.typeOf.number("radius",t);let 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 Md(n),this._workerName="createCircleOutlineGeometry"}WL.packedLength=Md.packedLength;WL.pack=function(e,t,n){return C.typeOf.object("value",e),Md.pack(e._ellipseGeometry,t,n)};var mTt=new Md({center:new m,semiMajorAxis:1,semiMinorAxis:1}),ru={center:new m,radius:void 0,ellipsoid:re.clone(re.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};WL.unpack=function(e,t,n){let i=Md.unpack(e,t,mTt);return ru.center=m.clone(i._center,ru.center),ru.ellipsoid=re.clone(i._ellipsoid,ru.ellipsoid),ru.height=i._height,ru.extrudedHeight=i._extrudedHeight,ru.granularity=i._granularity,ru.numberOfVerticalLines=i._numberOfVerticalLines,c(n)?(ru.semiMajorAxis=i._semiMajorAxis,ru.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Md(ru),n):(ru.radius=i._semiMajorAxis,new WL(ru))};WL.createGeometry=function(e){return Md.createGeometry(e._ellipseGeometry)};var h7=WL;var Ano=_(T(),1);function fTt(e){return e=e??z.EMPTY_OBJECT,_S.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var I9=fTt;var Ono=_(T(),1);function hTt(e){return e=e??z.EMPTY_OBJECT,_S.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:re.WGS84})}var TS=hTt;var $no=_(T(),1);function wL(e){e=e??z.EMPTY_OBJECT,C.defined("options.callback",e.callback),C.defined("options.width",e.width),C.defined("options.height",e.height),this._callback=e.callback,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??re.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=rs.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new ye;let n=e.credit;typeof n=="string"&&(n=new Ct(n)),this._credit=n}Object.defineProperties(wL.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}}});wL.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!c(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let l=a;return Array.isArray(l)&&(l=new Float64Array(l)),new Da({buffer:l,width:r,height:s})})};wL.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};wL.prototype.getTileDataAvailable=function(e,t,n){};wL.prototype.loadTileDataAvailability=function(e,t,n){};var p7=wL;var iio=_(T(),1);var pTt=1953029805,bTt=2917034100;function b7(e,t){if(b7.passThroughDataForTesting)return t;C.typeOf.object("key",e),C.typeOf.object("data",t);let n=e.byteLength;if(n===0||n%4!==0)throw new le("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===pTt||o===bTt)return t;let r=new DataView(e),s=0,a=t.byteLength,l=a-a%8,d=n,u,f=8;for(;s<l;)for(f=(f+8)%24,u=f;s<l&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(f=(f+8)%24,u=f);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}b7.passThroughDataForTesting=!1;var W9=b7;var rio=_(T(),1);function FSe(e){this.proxy=e}FSe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var y7=FSe;var lio=_(T(),1);function ASe(e,t){return Cs("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),e??t}Object.defineProperty(ASe,"EMPTY_OBJECT",{get:function(){return Cs("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),z.EMPTY_OBJECT}});var g7=ASe;var hio=_(T(),1);function rB(){L.throwInstantiationError()}Object.defineProperties(rB.prototype,{credit:{get:L.throwInstantiationError}});rB.getCreditsFromResult=function(e){if(c(e.attributions))return e.attributions.map(Ct.getIonCredit)};rB.prototype.geocode=L.throwInstantiationError;var PL=rB;var bio=_(T(),1),yTt={SEARCH:0,AUTOCOMPLETE:1},Bg=Object.freeze(yTt);var xio=_(T(),1);function MSe(){L.throwInstantiationError()}MSe.createGeometry=function(e){L.throwInstantiationError()};var x7=MSe;var kio=_(T(),1),CTt=_(_7(),1);var Zio=_(T(),1);var Sio=_(T(),1);function gTt(e,t){return(e&t)!==0}var Wc=gTt;var xTt=[1,2,4,8],NSe=15,_Tt=16,TTt=64,STt=128;function pp(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}pp.clone=function(e,t){return c(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 pp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};pp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};pp.prototype.hasSubtree=function(){return Wc(this._bits,_Tt)};pp.prototype.hasImagery=function(){return Wc(this._bits,TTt)};pp.prototype.hasTerrain=function(){return Wc(this._bits,STt)};pp.prototype.hasChildren=function(){return Wc(this._bits,NSe)};pp.prototype.hasChild=function(e){return Wc(this._bits,xTt[e])};pp.prototype.getChildBitmask=function(){return this._bits&NSe};var w9=pp;function VTt(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 LTt=VTt(`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 su(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=w.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(su.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});su.fromUrl=async function(e){C.defined("resourceOrUrl",e);let t=e;typeof t!="string"&&!(t instanceof Ge)&&(C.typeOf.string("resourceOrUrl.url",e.url),t=e.url);let n=Ge.createIfNeeded(t);n.appendForwardSlash();let i=new su;i._resource=n;try{await ZTt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${USe(i,"",1).url}: ${o}`;throw new le(r)}return i};su.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Wc(t,r)?Wc(e,r)&&(s|=1):(s|=2,Wc(e,r)||(s|=1)),i+=s}return i};su.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];Wc(s,2)?Wc(s,1)||(t|=r):(n|=r,Wc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};su.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(c(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),c(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var kSe=new gi("decodeGoogleEarthEnterprisePacket");su.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=USe(this,e,t,n).fetchArrayBuffer();if(!c(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return kSe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,f=-1;if(e!==""){f=e.length+1;let h=d[e];u=r[e],u._bits|=h._bits,delete d[e]}let p=Object.keys(d);p.sort(function(h,g){return h.length-g.length});let y=p.length;for(let h=0;h<y;++h){let g=p[h];if(d[g]!==null){let S=w9.clone(d[g]),V=g.length;if(V===f)S.setParent(u);else if(V>1){let Z=r[g.substring(0,g.length-1)];S.setParent(Z)}r[g]=S}else r[g]=null}})})};su.prototype.populateSubtree=function(e,t,n,i){let o=su.tileXYToQuadKey(e,t,n);return C7(this,o,i)};function C7(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(c(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,l=a[o];if(c(l))return l.then(function(){return s=new Jo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),C7(e,t,s)});if(!c(r)||!r.hasSubtree())return Promise.reject(new le(`Couldn't load metadata for tile ${t}`));if(l=e.getQuadTreePacket(o,r.cnodeVersion,n),!!c(l))return a[o]=l,l.then(function(){return s=new Jo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),C7(e,t,s)}).finally(function(){delete a[o]})}su.prototype.getTileInformation=function(e,t,n){let i=su.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};su.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function USe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var T7,S7;function ZTt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!c(S7)){let n=on("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;S7=sx(n).then(function(){T7=window.cesiumGoogleEarthDbRootParser(CTt),c(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return S7.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=T7.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 l=o.buffer.slice(r,s);return kSe.scheduleTask({buffer:l,type:"DbRoot",key:a},[l])}).then(function(n){let i=T7.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,c(i.endSnippet)&&c(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}c(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 l=r[a],d=l.copyrightString;c(d)&&(o[l.providerId]=new Ct(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=LTt})}var G0=su;var roo=_(T(),1);function SS(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.buffer",e.buffer),C.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),C.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),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(SS.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var BSe="createVerticesFromGoogleEarthEnterpriseBuffer",RTt=new gi(BSe),GTt=new gi(BSe,Ff.maximumAsynchronousTasks),OSe=new de,V7=new de;SS.prototype.createMesh=function(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.tilingScheme",e.tilingScheme),C.typeOf.number("options.x",e.x),C.typeOf.number("options.y",e.y),C.typeOf.number("options.level",e.level);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,l=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,OSe),t.tileXYToRectangle(n,i,o,V7);let d=l.cartographicToCartesian(de.center(V7)),f=40075.16/(1<<o);this._skirtHeight=Math.min(f*8,1e3);let y=(a?GTt:RTt).scheduleTask({buffer:this._buffer,nativeRectangle:OSe,rectangle:V7,relativeToCenter:d,ellipsoid:l,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!c(y))return;let h=this;return y.then(function(g){return h._mesh=new dm(d,new Float32Array(g.vertices),new Uint16Array(g.indices),g.indexCountWithoutSkirts,g.vertexCountWithoutSkirts,g.minimumHeight,g.maximumHeight,ue.clone(g.boundingSphere3D),m.clone(g.occludeePointInScaledSpace),g.numberOfAttributes,Xn.clone(g.orientedBoundingBox),Rc.clone(g.encoding),g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),h._minimumHeight=g.minimumHeight,h._maximumHeight=g.maximumHeight,h._buffer=void 0,h._mesh})};SS.prototype.interpolateHeight=function(e,t,n){let i=w.clamp((t-e.west)/e.width,0,1),o=w.clamp((n-e.south)/e.height,0,1);return c(this._mesh)?wTt(this,i,o):FTt(this,i,o,e)};var ETt=new gi("upsampleQuantizedTerrainMesh",Ff.maximumAsynchronousTasks);SS.prototype.upsample=function(e,t,n,i,o,r,s){if(C.typeOf.object("tilingScheme",e),C.typeOf.number("thisX",t),C.typeOf.number("thisY",n),C.typeOf.number("thisLevel",i),C.typeOf.number("descendantX",o),C.typeOf.number("descendantY",r),C.typeOf.number("descendantLevel",s),s-i>1)throw new L("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let d=t*2!==o,u=n*2===r,f=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),y=ETt.scheduleTask({vertices:l.vertices,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:d,isNorthChild:u,childRectangle:p,ellipsoid:f});if(!c(y))return;let h=this;return y.then(function(g){let x=new Uint16Array(g.vertices),S=Me.createTypedArray(x.length/3,g.indices),V=h._skirtHeight;return new xS({quantizedVertices:x,indices:S,minimumHeight:g.minimumHeight,maximumHeight:g.maximumHeight,boundingSphere:ue.clone(g.boundingSphere),orientedBoundingBox:Xn.clone(g.orientedBoundingBox),horizonOcclusionPoint:m.clone(g.horizonOcclusionPoint),westIndices:g.westIndices,southIndices:g.southIndices,eastIndices:g.eastIndices,northIndices:g.northIndices,westSkirtHeight:V,southSkirtHeight:V,eastSkirtHeight:V,northSkirtHeight:V,childTileMask:0,createdByUpsampling:!0,credits:h._credits})})};SS.prototype.isChildAvailable=function(e,t,n,i){C.typeOf.number("thisX",e),C.typeOf.number("thisY",t),C.typeOf.number("childX",n),C.typeOf.number("childY",i);let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};SS.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var XTt=new D,ITt=new D,WTt=new D,YSe=new m;function wTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let d=s[a],u=s[a+1],f=s[a+2],p=r.decodeTextureCoordinates(o,d,XTt),y=r.decodeTextureCoordinates(o,u,ITt),h=r.decodeTextureCoordinates(o,f,WTt),g=Z0.computeBarycentricCoordinates(t,n,p.x,p.y,y.x,y.y,h.x,h.y,YSe);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){let x=r.decodeHeight(o,d),S=r.decodeHeight(o,u),V=r.decodeHeight(o,f);return g.x*x+g.y*S+g.z*V}}}var PTt=Uint16Array.BYTES_PER_ELEMENT,DSe=Uint32Array.BYTES_PER_ELEMENT,L7=Int32Array.BYTES_PER_ELEMENT,vTt=Float32Array.BYTES_PER_ELEMENT,Z7=Float64Array.BYTES_PER_ELEMENT;function FTt(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 l=new DataView(o),d=0;for(let E=0;E<r;++E)d+=l.getUint32(d,!0),d+=DSe;d+=DSe,d+=2*Z7;let u=w.toRadians(l.getFloat64(d,!0)*180);d+=Z7;let f=w.toRadians(l.getFloat64(d,!0)*180);d+=Z7;let p=i.width/u/2,y=i.height/f/2,h=l.getInt32(d,!0);d+=L7;let g=l.getInt32(d,!0)*3;d+=L7,d+=L7;let x=new Array(h),S=new Array(h),V=new Array(h),Z;for(Z=0;Z<h;++Z)x[Z]=s+l.getUint8(d++)*p,S[Z]=a+l.getUint8(d++)*y,V[Z]=l.getFloat32(d,!0)*6371010,d+=vTt;let R=new Array(g);for(Z=0;Z<g;++Z)R[Z]=l.getUint16(d,!0),d+=PTt;for(Z=0;Z<g;Z+=3){let E=R[Z],I=R[Z+1],v=R[Z+2],P=x[E],F=x[I],N=x[v],b=S[E],G=S[I],X=S[v],W=Z0.computeBarycentricCoordinates(t,n,P,b,F,G,N,X,YSe);if(W.x>=-1e-15&&W.y>=-1e-15&&W.z>=-1e-15)return W.x*V[E]+W.y*V[I]+W.z*V[v]}}var vL=SS;var Voo=_(T(),1);var _m={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},sB=new ee;function aB(){this._terrainCache={},this._lastTidy=ee.now()}aB.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:ee.now()}};aB.prototype.get=function(e){let n=this._terrainCache[e];if(c(n))return delete this._terrainCache[e],n.buffer};aB.prototype.tidy=function(){if(ee.now(sB),ee.secondsDifference(sB,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];ee.secondsDifference(sB,r.timestamp)>10&&delete e[o]}ee.clone(sB,this._lastTidy)}};function Yg(e){e=e??z.EMPTY_OBJECT,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-w.PI,-w.PI,w.PI,w.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new aB,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new ye}Object.defineProperties(Yg.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(){}}});Yg.fromMetadata=function(e,t){if(C.defined("metadata",e),!e.terrainPresent)throw new le(`The server ${e.url} doesn't have terrain`);let n=new Yg(t);return n._metadata=e,n};var ATt=new gi("decodeGoogleEarthEnterprisePacket");function HSe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===_m.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());c(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}Yg.prototype.requestTileGeometry=function(e,t,n,i){let o=G0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!c(a))return Promise.reject(new le("Terrain tile doesn't exist"));let l=a.terrainState;c(l)||(l=a.terrainState=_m.UNKNOWN);let d=r.get(o);if(c(d)){let S=s.providers[a.terrainProvider];return Promise.resolve(new vL({buffer:d,childTileMask:HSe(o,a,s),credits:c(S)?[S]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(l===_m.NONE)return Promise.reject(new le("Terrain tile doesn't exist"))}else return Promise.resolve(new Da({buffer:new Uint8Array(16*16),width:16,height:16}));let u,f=o,p=-1;switch(l){case _m.SELF:p=a.terrainVersion;break;case _m.PARENT:f=f.substring(0,f.length-1),u=s.getTileInformationFromQuadKey(f),p=u.terrainVersion;break;case _m.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(f=f.substring(0,f.length-1),u=s.getTileInformationFromQuadKey(f),c(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new le("Terrain tile doesn't exist"));let y=this._terrainPromises,h=this._terrainRequests,g,x;if(c(y[f]))g=y[f],x=h[f];else{x=i;let S=MTt(this,f,p,x).fetchArrayBuffer();if(!c(S))return;g=S.then(function(V){return c(V)?ATt.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(Z){let R=s.getTileInformationFromQuadKey(f);R.terrainState=_m.SELF,r.add(f,Z[0]);let E=R.terrainProvider,I=Z.length-1;for(let v=0;v<I;++v){let P=f+v.toString(),F=s.getTileInformationFromQuadKey(P);c(F)&&(r.add(P,Z[v+1]),F.terrainState=_m.PARENT,F.terrainProvider===0&&(F.terrainProvider=E))}}):Promise.reject(new le("Failed to load terrain."))}),y[f]=g,h[f]=x,g=g.finally(function(){delete y[f],delete h[f]})}return g.then(function(){let S=r.get(o);if(c(S)){let V=s.providers[a.terrainProvider];return new vL({buffer:S,childTileMask:HSe(o,a,s),credits:c(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new le("Failed to load terrain."))}).catch(function(S){return x.state===jn.CANCELLED?(i.state=x.state,Promise.reject(S)):(a.terrainState=_m.NONE,Promise.reject(S))})};Yg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Yg.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=G0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(c(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===_m.NONE)return!1;if((!c(s)||s===_m.UNKNOWN)&&(r.terrainState=_m.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!c(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Jo({throttle:!1,throttleByServer:!0,type:us.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};Yg.prototype.loadTileDataAvailability=function(e,t,n){};function MTt(e,t,n,i){return n=c(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var R7=Yg;var Poo=_(T(),1);var NTt="https://maps.googleapis.com/maps/api/geocode/json",zSe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function G7(e){e=e??z.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new L("options.key is required.");this._resource=new Ge({url:NTt,queryParameters:{key:t}}),this._credit=new Ct(zSe,!0)}Object.defineProperties(G7.prototype,{credit:{get:function(){return this._credit}}});G7.prototype.geocode=async function(e){C.typeOf.string("query",e);let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new le(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:de.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:zSe,collapsible:!1}}})};var E7=G7;var Moo=_(T(),1);var cB={};cB.defaultApiKey=void 0;cB.mapTilesApiEndpoint=new Ge({url:"https://tile.googleapis.com/v1/"});cB.getDefaultCredit=function(){return new Ct('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var CS=cB;var Uoo=_(T(),1);var P9={};P9.type=void 0;P9.getRequiredDataPoints=L.throwInstantiationError;P9.interpolateOrderZero=L.throwInstantiationError;P9.interpolate=L.throwInstantiationError;var X7=P9;var Doo=_(T(),1),kTt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},E0=Object.freeze(kTt);var cro=_(T(),1);var joo=_(T(),1);function I7(e){C.defined("url",e),this._url=Ge.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(I7.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});I7.prototype.geocode=async function(e,t){return C.typeOf.string("query",e),this._url.getDerivedResource({url:t===Bg.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(c(s))r=de.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],l=o.geometry.coordinates[1];r=m.fromDegrees(a,l)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var v9=I7;function KSe(e){if(!Object.values(E0).some(t=>t===e))throw new L(`Invalid geocodeProviderType: "${e}"`)}var JSe=Object.freeze({[E0.GOOGLE]:"google",[E0.BING]:"bing",[E0.DEFAULT]:void 0});function UTt(e){return JSe[e]}function OTt(e){return Object.entries(JSe).find(t=>t[1]===e)[0]}function W7(e){e=e??z.EMPTY_OBJECT,C.typeOf.object("options.scene",e.scene);let t=e.geocodeProviderType??E0.DEFAULT;KSe(t);let n=e.accessToken??Ym.defaultAccessToken,i=Ge.createIfNeeded(e.server??Ym.defaultServer);i.appendForwardSlash();let o=Ym.getDefaultTokenCredit(n);c(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Ct.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});c(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new v9(r),this.geocodeProviderType=t}Object.defineProperties(W7.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return OTt(this._pelias.url.queryParameters.geocoder)},set:function(e){KSe(e);let t={...this._pelias.url.queryParameters,geocoder:UTt(e)};c(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});W7.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var VS=W7;var pro=_(T(),1);var Eo={};Eo.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Eo.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Eo.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Eo.defaultAccessToken=void 0;Eo.defaultShareKey=void 0;Eo._getAuthorizationHeader=function(){if(!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");return c(Eo.defaultShareKey)?`Basic ${Eo.defaultShareKey}`:`Bearer ${Eo.defaultAccessToken}`};Eo.apiEndpoint=new Ge({url:"https://api.bentley.com"});Eo.getExports=async function(e){if(C.typeOf.string("iModelId",e),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let t=new Ge({url:`${Eo.apiEndpoint}mesh-export`,headers:{Authorization:Eo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Eo.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new le(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new le("Not allowed, forbidden");if(n.statusCode===422)throw new le(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new le("Too many requests")}throw new le(`Unknown request failure ${n.statusCode}`)}};Eo.getRealityDataMetadata=async function(e,t){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let n=new Ge({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Eo._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 le(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new le("Not allowed, forbidden");if(i.statusCode===404)throw new le(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new le(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new le("Too many requests")}throw new le(`Unknown request failure ${i.statusCode}`)}};Eo.getRealityDataURL=async function(e,t,n){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),C.typeOf.string("rootDocument",n),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=new Ge({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Eo._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 le(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new le("Not allowed, forbidden");if(o.statusCode===404)throw new le(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new le(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new le("Too many requests")}throw new le(`Unknown request failure ${o.statusCode}`)}};var as=Eo;var gro=_(T(),1);function lB(){L.throwInstantiationError()}Object.defineProperties(lB.prototype,{ellipsoid:{get:L.throwInstantiationError}});lB.prototype.project=L.throwInstantiationError;lB.prototype.unproject=L.throwInstantiationError;var w7=lB;var Lro=_(T(),1);function FL(e){e=e??z.EMPTY_OBJECT;let t=e.weights,n=e.times;if(C.defined("weights",t),C.defined("times",n),C.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%n.length!==0)throw new L("times.length must be a factor of weights.length.");this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(FL.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});FL.prototype.findTimeInterval=Pi.prototype.findTimeInterval;FL.prototype.wrapTime=Pi.prototype.wrapTime;FL.prototype.clampTime=Pi.prototype.clampTime;FL.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]);c(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 P7=FL;var Pro=_(T(),1);function v7(e,t,n){C.defined("url",e),C.defined("apiKey",t),c(n)&&C.typeOf.object("params",n),e=Ge.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Ct('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(v7.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});v7.prototype.geocode=async function(e){return C.typeOf.string("query",e),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(c(r))o=de.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=m.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var F7=v7;var Aro=_(T(),1);var DTt={packedLength:void 0,pack:L.throwInstantiationError,unpack:L.throwInstantiationError},A7=DTt;var kro=_(T(),1);var BTt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:L.throwInstantiationError,unpackInterpolationResult:L.throwInstantiationError},M7=BTt;var Yro=_(T(),1);var YTt=new m;function HTt(e,t,n,i){let o=px(e,t,n,i,YTt);return c(o)?o.x>0&&o.y>0&&o.z>0:!1}var N7=HTt;var Kro=_(T(),1);function QSe(){L.throwInstantiationError()}QSe.prototype.getURL=L.throwInstantiationError;var k7=QSe;var mso=_(T(),1);function zTt(e,t,n,i,o,r,s){let a=vi.numberOfPoints(e,t,o),l,d=n.red,u=n.green,f=n.blue,p=n.alpha,y=i.red,h=i.green,g=i.blue,x=i.alpha;if(Y.equals(n,i)){for(l=0;l<a;l++)r[s++]=Y.floatToByte(d),r[s++]=Y.floatToByte(u),r[s++]=Y.floatToByte(f),r[s++]=Y.floatToByte(p);return s}let S=(y-d)/a,V=(h-u)/a,Z=(g-f)/a,R=(x-p)/a,E=s;for(l=0;l<a;l++)r[E++]=Y.floatToByte(d+l*S),r[E++]=Y.floatToByte(u+l*V),r[E++]=Y.floatToByte(f+l*Z),r[E++]=Y.floatToByte(p+l*R);return E}function F9(e){e=e??z.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new L("At least two positions are required.");if(c(n)&&(i&&n.length<t.length||!i&&n.length<t.length-1))throw new L("colors has an invalid length.");this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??Kt.GEODESIC,this._granularity=e.granularity??w.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??re.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*m.packedLength;o+=c(n)?1+n.length*Y.packedLength:1,this.packedLength=o+re.packedLength+3}F9.pack=function(e,t,n){if(!c(e))throw new L("value is required");if(!c(t))throw new L("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=m.packedLength)m.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=Y.packedLength)Y.pack(s[i],t,n);return re.pack(e._ellipsoid,t,n),n+=re.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};F9.unpack=function(e,t,n){if(!c(e))throw new L("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=m.packedLength)r[i]=m.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=Y.packedLength)s[i]=Y.unpack(e,t);let a=re.unpack(e,t);t+=re.packedLength;let l=e[t++]===1,d=e[t++],u=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=l,n._arcType=d,n._granularity=u,n):new F9({positions:r,colors:s,ellipsoid:a,colorsPerVertex:l,arcType:d,granularity:u})};var dB=new Array(2),uB=new Array(2),KTt={positions:dB,height:uB,ellipsoid:void 0,minDistance:void 0,granularity:void 0};F9.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=w.chordLength(r,s.maximumRadius),l=c(n)&&!i,d,u=t.length,f,p,y,h,g=0;if(o===Kt.GEODESIC||o===Kt.RHUMB){let R,E,I;o===Kt.GEODESIC?(R=w.chordLength(r,s.maximumRadius),E=vi.numberOfPoints,I=vi.generateArc):(R=r,E=vi.numberOfPointsRhumbLine,I=vi.generateRhumbArc);let v=vi.extractHeights(t,s),P=KTt;if(o===Kt.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,l){let F=0;for(d=0;d<u-1;d++)F+=E(t[d],t[d+1],R)+1;f=new Float64Array(F*3),y=new Uint8Array(F*4),P.positions=dB,P.height=uB;let N=0;for(d=0;d<u-1;++d){dB[0]=t[d],dB[1]=t[d+1],uB[0]=v[d],uB[1]=v[d+1];let b=I(P);if(c(n)){let G=b.length/3;h=n[d];for(let X=0;X<G;++X)y[N++]=Y.floatToByte(h.red),y[N++]=Y.floatToByte(h.green),y[N++]=Y.floatToByte(h.blue),y[N++]=Y.floatToByte(h.alpha)}f.set(b,g),g+=b.length}}else if(P.positions=t,P.height=v,f=new Float64Array(I(P)),c(n)){for(y=new Uint8Array(f.length/3*4),d=0;d<u-1;++d){let N=t[d],b=t[d+1],G=n[d],X=n[d+1];g=zTt(N,b,G,X,a,y,g)}let F=n[u-1];y[g++]=Y.floatToByte(F.red),y[g++]=Y.floatToByte(F.green),y[g++]=Y.floatToByte(F.blue),y[g++]=Y.floatToByte(F.alpha)}}else{p=l?u*2-2:u,f=new Float64Array(p*3),y=c(n)?new Uint8Array(p*4):void 0;let R=0,E=0;for(d=0;d<u;++d){let I=t[d];if(l&&d>0&&(m.pack(I,f,R),R+=3,h=n[d-1],y[E++]=Y.floatToByte(h.red),y[E++]=Y.floatToByte(h.green),y[E++]=Y.floatToByte(h.blue),y[E++]=Y.floatToByte(h.alpha)),l&&d===u-1)break;m.pack(I,f,R),R+=3,c(n)&&(h=n[d],y[E++]=Y.floatToByte(h.red),y[E++]=Y.floatToByte(h.green),y[E++]=Y.floatToByte(h.blue),y[E++]=Y.floatToByte(h.alpha))}}let x=new fn;x.position=new Ee({componentDatatype:q.DOUBLE,componentsPerAttribute:3,values:f}),c(n)&&(x.color=new Ee({componentDatatype:q.UNSIGNED_BYTE,componentsPerAttribute:4,values:y,normalize:!0})),p=f.length/3;let S=(p-1)*2,V=Me.createTypedArray(p,S),Z=0;for(d=0;d<p-1;++d)V[Z++]=d,V[Z++]=d+1;return new dt({attributes:x,indices:V,primitiveType:ve.LINES,boundingSphere:ue.fromPoints(t)})};var U7=F9;var xso=_(T(),1);function AL(e){let t=e.radius??1,i={radii:new m(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Js(i),this._workerName="createSphereGeometry"}AL.packedLength=Js.packedLength;AL.pack=function(e,t,n){return C.typeOf.object("value",e),Js.pack(e._ellipsoidGeometry,t,n)};var JTt=new Js,Hg={radius:void 0,radii:new m,vertexFormat:new We,stackPartitions:void 0,slicePartitions:void 0};AL.unpack=function(e,t,n){let i=Js.unpack(e,t,JTt);return Hg.vertexFormat=We.clone(i._vertexFormat,Hg.vertexFormat),Hg.stackPartitions=i._stackPartitions,Hg.slicePartitions=i._slicePartitions,c(n)?(m.clone(i._radii,Hg.radii),n._ellipsoidGeometry=new Js(Hg),n):(Hg.radius=i._radii.x,new AL(Hg))};AL.createGeometry=function(e){return Js.createGeometry(e._ellipsoidGeometry)};var O7=AL;var Sso=_(T(),1);function QTt(e){return C.defined("value",e),e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var LS=QTt;var Lso=_(T(),1);function zg(e){throw new L("This type should not be instantiated directly.  Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}Object.defineProperties(zg.prototype,{ellipsoid:{get:L.throwInstantiationError},rectangle:{get:L.throwInstantiationError},projection:{get:L.throwInstantiationError}});zg.prototype.getNumberOfXTilesAtLevel=L.throwInstantiationError;zg.prototype.getNumberOfYTilesAtLevel=L.throwInstantiationError;zg.prototype.rectangleToNativeRectangle=L.throwInstantiationError;zg.prototype.tileXYToNativeRectangle=L.throwInstantiationError;zg.prototype.tileXYToRectangle=L.throwInstantiationError;zg.prototype.positionToTileXY=L.throwInstantiationError;var D7=zg;var Wso=_(T(),1);function ZS(e){e=e??z.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??Ye.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(ZS.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(c(t)&&(this._clockSubscription(),this._clockSubscription=void 0),c(e)&&(this._clockSubscription=e.onTick.addEventListener(ZS.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(c(t)&&t.removeEventListener("seeked",this._seekFunction,!1),c(e)&&(this._seeking=!1,this._seekFunction=jTt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});ZS.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,he(this)};ZS.prototype.isDestroyed=function(){return!1};ZS.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};ZS.prototype._onTick=function(e){let t=this._element;if(!c(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??Ye.MINIMUM_VALUE,s=ee.secondsDifference(o,r),a=t.duration,l,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),l=s):s>a?l=a:s<0?l=0:l=s;let u=i?this.tolerance??1:.001;Math.abs(l-d)>u&&(this._seeking=!0,t.currentTime=l)};function jTt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var B7=ZS;var Jso=_(T(),1);function qTt(e,t){this.rectangle=e,this.maxLevel=t}function jSe(e){this.ellipsoid=e.ellipsoid??re.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}jSe.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 $Tt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ki({ellipsoid:e.ellipsoid});else throw new le(`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=rs.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=w.toRadians(parseFloat(s.getAttribute("minx"))),l=w.toRadians(parseFloat(s.getAttribute("miny"))),d=w.toRadians(parseFloat(s.getAttribute("maxx"))),u=w.toRadians(parseFloat(s.getAttribute("maxy"))),f=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new qTt(new de(a,l,d,u),f))}}function eSt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i=`${i}: ${t.message}`),Ro.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new le(i)}async function tSt(e,t,n){try{let i=await t.fetchXML();$Tt(e,i)}catch(i){eSt(t,i,n)}}function Kg(e){e=e??z.EMPTY_OBJECT,this._errorEvent=new ye,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 Ct(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Kg.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(){}}});Kg.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=new jSe(t),i=Ge.createIfNeeded(e);await tSt(n,i);let o=new Kg(t);return n.build(o),o._resource=i,o};Kg.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(!c(s))return;let a=this;return Promise.resolve(s).then(function(l){return new Da({buffer:Rm(l),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:nSt(a,e,t,n),structure:a._terrainDataStructure})})};Kg.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var qSe=new de;function nSt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let l=0;l<r.length&&a!==15;++l){let d=r[l];if(d.maxLevel<=i)continue;let u=d.rectangle,f=de.intersection(u,s,qSe);c(f)&&(mB(o,u,t*2,n*2,i+1)&&(a|=4),mB(o,u,t*2+1,n*2,i+1)&&(a|=8),mB(o,u,t*2,n*2+1,i+1)&&(a|=1),mB(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function mB(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return c(de.intersection(r,t,qSe))}Kg.prototype.getTileDataAvailable=function(e,t,n){};Kg.prototype.loadTileDataAvailability=function(e,t,n){};var Y7=Kg;var jso=_(T(),1),iSt={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},H7=Object.freeze(iSt);var eao=_(T(),1);function oSt(e){switch(e){case oe.FLOAT:return"float";case oe.FLOAT_VEC2:return"vec2";case oe.FLOAT_VEC3:return"vec3";case oe.FLOAT_VEC4:return"vec4";case oe.FLOAT_MAT2:return"mat2";case oe.FLOAT_MAT3:return"mat3";case oe.FLOAT_MAT4:return"mat4";case oe.SAMPLER_2D:return"sampler2D";case oe.BOOL:return"bool"}}var z7=oSt;var iao=_(T(),1);function rSt(e,t,n){if(typeof t!="function")throw new L("oldFunction is required to be a function.");if(typeof n!="function")throw new L("oldFunction is required to be a function.");return function(){n.apply(e,arguments),t.apply(e,arguments)}}var A9=rSt;var cao=_(T(),1);var sSt=new m(1,1,1);function K7(e){e=e??sSt,C.defined("dimensions",e),C.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),C.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),C.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=m.clone(e)}Object.defineProperties(K7.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){C.defined("value",e),C.typeOf.number.greaterThanOrEquals("value.x",e.x,0),C.typeOf.number.greaterThanOrEquals("value.y",e.y,0),C.typeOf.number.greaterThanOrEquals("value.z",e.z,0),m.clone(e,this._dimensions)}}});var aSt=new m;K7.prototype.emit=function(e){let t=this._dimensions,n=m.multiplyByScalar(t,.5,aSt),i=w.randomBetween(-n.x,n.x),o=w.randomBetween(-n.y,n.y),r=w.randomBetween(-n.z,n.z);e.position=m.fromElements(i,o,r,e.position),e.velocity=m.normalize(e.position,e.velocity)};var J7=K7;var uao=_(T(),1);function bp(){this.featurePropertiesDirty=!1}Object.defineProperties(bp.prototype,{featuresLength:{get:function(){L.throwInstantiationError()}},pointsLength:{get:function(){L.throwInstantiationError()}},trianglesLength:{get:function(){L.throwInstantiationError()}},geometryByteLength:{get:function(){L.throwInstantiationError()}},texturesByteLength:{get:function(){L.throwInstantiationError()}},batchTableByteLength:{get:function(){L.throwInstantiationError()}},innerContents:{get:function(){L.throwInstantiationError()}},ready:{get:function(){L.throwInstantiationError()}},tileset:{get:function(){L.throwInstantiationError()}},tile:{get:function(){L.throwInstantiationError()}},url:{get:function(){L.throwInstantiationError()}},batchTable:{get:function(){L.throwInstantiationError()}},metadata:{get:function(){L.throwInstantiationError()},set:function(e){L.throwInstantiationError()}},group:{get:function(){L.throwInstantiationError()},set:function(e){L.throwInstantiationError()}}});bp.prototype.hasProperty=function(e,t){L.throwInstantiationError()};bp.prototype.getFeature=function(e){L.throwInstantiationError()};bp.prototype.applyDebugSettings=function(e,t){L.throwInstantiationError()};bp.prototype.applyStyle=function(e){L.throwInstantiationError()};bp.prototype.update=function(e,t){L.throwInstantiationError()};bp.prototype.pick=function(e,t,n){L.throwInstantiationError()};bp.prototype.isDestroyed=function(){L.throwInstantiationError()};bp.prototype.destroy=function(){L.throwInstantiationError()};var Q7=bp;var Lao=_(T(),1);var bao=_(T(),1);function ML(e,t){this._conditionsExpression=He(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,lSt(this,t)}Object.defineProperties(ML.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function cSt(e,t){this.condition=e,this.expression=t}function lSt(e,t){let n=[],i=e._conditions;if(!c(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),l=String(s[1]);n.push(new cSt(new Iu(a,t),new Iu(l,t)))}e._runtimeConditions=n}ML.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!c(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)}};ML.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!c(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)}};ML.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!c(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let l=o[a],d=l.condition.getShaderExpression(t,n),u=l.expression.getShaderExpression(t,n);r+=`    ${a===0?"if":"else if"} (${d})
    {
        return ${u};
    }
`}return r=`${i} ${e}
{
${r}    return ${i}(1.0);
}
`,r};ML.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!c(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var M9=ML;function Jg(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,dSt(this,e)}function dSt(e,t){t=He(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(c(t.meta)){let i=t.defines,o=t.meta??z.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Iu(o[r],i))}e._meta=n,e._ready=!0}function cr(e,t){let n=(e._style??z.EMPTY_OBJECT).defines;if(c(t)){if(typeof t=="boolean"||typeof t=="number")return new Iu(String(t));if(typeof t=="string")return new Iu(t,n);if(c(t.conditions))return new M9(t,n)}else return;return t}function lr(e){if(c(e)){if(c(e.expression))return e.expression;if(c(e.conditionsExpression))return He(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Jg.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=cr(this,e),this._style.show=lr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=cr(this,e),this._style.color=lr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=cr(this,e),this._style.pointSize=lr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=cr(this,e),this._style.pointOutlineColor=lr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=cr(this,e),this._style.pointOutlineWidth=lr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=cr(this,e),this._style.labelColor=lr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=cr(this,e),this._style.labelOutlineColor=lr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=cr(this,e),this._style.labelOutlineWidth=lr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=cr(this,e),this._style.font=lr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=cr(this,e),this._style.labelStyle=lr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=cr(this,e),this._style.labelText=lr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=cr(this,e),this._style.backgroundColor=lr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=cr(this,e),this._style.backgroundPadding=lr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=cr(this,e),this._style.backgroundEnabled=lr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=cr(this,e),this._style.scaleByDistance=lr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=cr(this,e),this._style.translucencyByDistance=lr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=cr(this,e),this._style.distanceDisplayCondition=lr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=cr(this,e),this._style.heightOffset=lr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=cr(this,e),this._style.anchorLineEnabled=lr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=cr(this,e),this._style.anchorLineColor=lr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=cr(this,e),this._style.image=lr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=cr(this,e),this._style.disableDepthTestDistance=lr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=cr(this,e),this._style.horizontalOrigin=lr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=cr(this,e),this._style.verticalOrigin=lr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=cr(this,e),this._style.labelHorizontalOrigin=lr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=cr(this,e),this._style.labelVerticalOrigin=lr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Jg.fromUrl=function(e){if(!c(e))throw new L("url is required");return Ge.createIfNeeded(e).fetchJson(e).then(function(n){return new Jg(n)})};Jg.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,c(this.color)&&c(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Jg.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,c(this.show)&&c(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Jg.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,c(this.pointSize)&&c(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Jg.prototype.getVariables=function(){let e=[];return c(this.color)&&c(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),c(this.show)&&c(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),c(this.pointSize)&&c(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var RS=Jg;var ico=_(T(),1);var Xao=_(T(),1);function N9(e){e=e??z.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new mS({comparator:N9.comparator})}N9.prototype.addSubtree=function(e){let t=new uSt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates();if(this.find(i)===void 0)throw new L("parent node needs to exist")}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};N9.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}};N9.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 uSt(e,t){this.subtree=e,this.stamp=t}var k9=N9;function U9(e){e=e??z.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=m.ZERO.clone(),paddingAfter:l=m.ZERO.clone(),globalTransform:d=M.IDENTITY.clone(),shapeTransform:u=M.IDENTITY.clone(),minBounds:f,maxBounds:p,minimumValues:y,maximumValues:h,maximumTileCount:g}=e;C.typeOf.string("className",t),C.typeOf.object("names",n),C.typeOf.object("types",i),C.typeOf.object("componentTypes",o),C.typeOf.string("shape",r),C.typeOf.object("dimensions",s),this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=f,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=l,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===La.ELLIPSOID?gm.Z_UP:gm.Y_UP,this._minimumValues=y,this._maximumValues=h,this._maximumTileCount=g,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new k9}Object.defineProperties(U9.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}}});U9.fromUrl=async function(e){C.defined("url",e);let t=Ge.createIfNeeded(e),n=await t.fetchJson();fSt(n);let i=_St(n,t);await i.load();let{root:o}=n,r=ri(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new K_({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],l=a.class,d=TSt(s,l);Object.assign(d,hSt(o)),c(o.transform)?d.globalTransform=M.unpack(o.transform):d.globalTransform=M.clone(M.IDENTITY),d.dimensions=m.unpack(a.dimensions),d.maximumTileCount=mSt(s),c(a.padding)&&(d.paddingBefore=m.unpack(a.padding.before),d.paddingAfter=m.unpack(a.padding.after));let u=new U9(d),f=new Q_(t,o,i.schema);return u._implicitTileset=f,u._availableLevels=f.availableLevels,Ri.unload(i),u};function mSt(e){if(c(e.tileset))return e.tileset.getPropertyBySemantic(y_.TILESET_TILE_COUNT)}function fSt(e){let t=e.root;if(!c(t.content))throw new le("Root must have content");if(!ri(t.content,"3DTILES_content_voxels"))throw new le("Root tile content must have 3DTILES_content_voxels extension");if(!ri(t,"3DTILES_implicit_tiling")&&!c(t.implicitTiling))throw new le("Root tile must have implicit tiling");if(!c(e.schema)&&!c(e.schemaUri)&&!ri(e,"3DTILES_metadata"))throw new le("Tileset must have a metadata schema")}function hSt(e){let t=e.boundingVolume;if(c(t.box))return gSt(t.box);if(c(t.region))return pSt(t.region);if(ri(t,"3DTILES_bounding_volume_cylinder"))return xSt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new le("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function pSt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=M.fromScale(re.WGS84.radii),l=new m(t,n,r),d=new m(i,o,s);return{shape:La.ELLIPSOID,minBounds:l,maxBounds:d,shapeTransform:a}}var bSt=new m,ySt=new te;function gSt(e){let t=Xn.unpack(e),n=te.getScale(t.halfAxes,bSt),i=te.getRotation(t.halfAxes,ySt);return{shape:La.BOX,minBounds:m.negate(n,new m),maxBounds:m.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function xSt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-w.PI,maxAngle:r=w.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e;C.typeOf.number("minRadius",t),C.typeOf.number("maxRadius",n),C.typeOf.number("height",i),C.typeOf.number("minAngle",o),C.typeOf.number("maxAngle",r),C.typeOf.object("translation",s),C.typeOf.object("rotation",a);let l=-.5*i+s[2],d=.5*i+s[2],u=M.fromTranslationQuaternionRotationScale(m.unpack(s),Fe.unpack(a),m.ONE);return{shape:La.CYLINDER,minBounds:m.fromElements(t,o,l),maxBounds:m.fromElements(n,r,d),shapeTransform:u}}function _St(e,t){let{schemaUri:n,schema:i}=e;return c(n)?Ri.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ri.getSchemaLoader({schema:i})}function TSt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([y,h])=>{let{type:g,componentType:x}=h,S=o?.properties[y].min,V=o?.properties[y].max,Z=lt.getComponentCount(g),R=$Se(S,Z),E=$Se(V,Z);return{id:y,type:g,componentType:x,minValue:R,maxValue:E}}),a=s.map(y=>y.id),l=s.map(y=>y.type),d=s.map(y=>y.componentType),u=s.map(y=>y.minValue),f=s.map(y=>y.maxValue),p=u.some(c);return{className:t,names:a,types:l,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?f:void 0}}function $Se(e,t){if(!c(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function SSt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(c(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),c(o))return o;let l=Gb(a);return o=await b_.fromSubtreeJson(s,l.jsonPayload,l.binaryPayload,n,t),i.addSubtree(o),o}U9.prototype.requestData=async function(e){e=e??z.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 j_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),l=a.isSubtreeRoot()&&a.level>0,d=l?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),f=await SSt(this,d);if(!(l?f.childSubtreeIsAvailableAtCoordinates:f.tileIsAvailableAtCoordinates).call(f,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:h,baseResource:g}=s,x=h[0].getDerivedResource({templateValues:a.getTemplateValues()}),S=g.getDerivedResource({url:x.url});return cS.fromGltf(S)};var j7=U9;var cco=_(T(),1);function q7(e){e=e??1,C.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(q7.prototype,{radius:{get:function(){return this._radius},set:function(e){C.typeOf.number.greaterThan("value",e,0),this._radius=e}}});q7.prototype.emit=function(e){let t=w.randomBetween(0,w.TWO_PI),n=w.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=m.fromElements(i,o,r,e.position),e.velocity=m.clone(m.UNIT_Z,e.velocity)};var O9=q7;var tlo=_(T(),1);var dco=_(T(),1),$7={CUMULUS:0};$7.validate=function(e){return e===$7.CUMULUS};var GS=Object.freeze($7);var gco=_(T(),1);function Kf(e,t){if(e=e??z.EMPTY_OBJECT,this._show=e.show??!0,this._position=m.clone(e.position??m.ZERO),!c(e.scale)&&c(e.maximumSize))this._maximumSize=m.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(e.scale??new D(20,12));let n=new m(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=m.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=Y.clone(e.color??Y.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var CSt=Kf.SHOW_INDEX=0,VSt=Kf.POSITION_INDEX=1,LSt=Kf.SCALE_INDEX=2,ZSt=Kf.MAXIMUM_SIZE_INDEX=3,RSt=Kf.SLICE_INDEX=4,GSt=Kf.BRIGHTNESS_INDEX=5,ESt=Kf.COLOR_INDEX=6;Kf.NUMBER_OF_PROPERTIES=7;function ES(e,t){let n=e._cloudCollection;c(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Kf.prototype,{show:{get:function(){return this._show},set:function(e){C.typeOf.bool("value",e),this._show!==e&&(this._show=e,ES(this,CSt))}},position:{get:function(){return this._position},set:function(e){C.typeOf.object("value",e);let t=this._position;m.equals(t,e)||(m.clone(e,t),ES(this,VSt))}},scale:{get:function(){return this._scale},set:function(e){C.typeOf.object("value",e);let t=this._scale;D.equals(t,e)||(D.clone(e,t),ES(this,LSt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){C.typeOf.object("value",e);let t=this._maximumSize;m.equals(t,e)||(m.clone(e,t),ES(this,ZSt))}},color:{get:function(){return this._color},set:function(e){C.typeOf.object("value",e);let t=this._color;Y.equals(t,e)||(Y.clone(e,t),ES(this,ESt))}},slice:{get:function(){return this._slice},set:function(e){C.typeOf.number("value",e),this._slice!==e&&(this._slice=e,ES(this,RSt))}},brightness:{get:function(){return this._brightness},set:function(e){C.typeOf.number("value",e),this._brightness!==e&&(this._brightness=e,ES(this,GSt))}}});Kf.prototype._destroy=function(){this._cloudCollection=void 0};var au=Kf;var cu,fB=new m,XSt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},ISt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},WSt=au.SHOW_INDEX,wSt=au.POSITION_INDEX,PSt=au.SCALE_INDEX,vSt=au.MAXIMUM_SIZE_INDEX,FSt=au.SLICE_INDEX,ASt=au.BRIGHTNESS_INDEX,MSt=au.NUMBER_OF_PROPERTIES,NSt=au.COLOR_INDEX;function Jf(e){e=e??z.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(MSt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=m.clone(e.noiseOffset??m.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:eCe(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 eCe(e){return function(){return fB.x=e._textureSliceWidth,fB.y=e._noiseTextureRows,fB.z=1/e._noiseTextureRows,fB}}Object.defineProperties(Jf.prototype,{length:{get:function(){return t6(this),this._clouds.length}}});function tCe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Jf.prototype.add=function(e){e=e??z.EMPTY_OBJECT;let t=e.cloudType??GS.CUMULUS;if(!GS.validate(t))throw new L("invalid cloud type");let n;return t===GS.CUMULUS&&(n=new au(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};Jf.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Jf.prototype.removeAll=function(){tCe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function t6(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];c(s)&&(n._index=r++,t.push(s))}e._clouds=t}}Jf.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};Jf.prototype.contains=function(e){return c(e)&&e._cloudCollection===this};Jf.prototype.get=function(e){return C.typeOf.number("index",e),t6(this),this._clouds[e]};var kSt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),USt=new Uint16Array([0,1,2,0,2,3]);function OSt(e){let t=_t.createVertexBuffer({context:e,typedArray:kSt,usage:Ne.STATIC_DRAW}),n=_t.createIndexBuffer({context:e,typedArray:USt,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:q.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var n6;function DSt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(c(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=_t.createIndexBuffer({context:e,typedArray:o,usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function BSt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return c(t)||(t=_t.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Ne.STATIC_DRAW,indexDatatype:Me.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function YSt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return c(t)||(t=_t.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Ne.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function HSt(e,t,n){let i=[{index:cu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.packedAttribute0,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.packedAttribute1,componentsPerAttribute:4,componentDatatype:q.FLOAT,usage:Ne.STATIC_DRAW},{index:cu.color,componentsPerAttribute:4,componentDatatype:q.UNSIGNED_BYTE,normalize:!0,usage:Ne.STATIC_DRAW}];n&&i.push({index:cu.direction,componentsPerAttribute:2,componentDatatype:q.FLOAT,vertexBuffer:YSt(e)});let o=n?t:4*t;return new Ip(e,i,o,n)}var e6=new Bn;function nCe(e,t,n,i){let o,r=n[cu.positionHighAndScaleX],s=n[cu.positionLowAndScaleY],a=i.position;Bn.fromCartesian(a,e6);let l=i.scale,d=e6.high,u=e6.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,l.x),s(o,u.x,u.y,u.z,l.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,l.x),r(o+1,d.x,d.y,d.z,l.x),r(o+2,d.x,d.y,d.z,l.x),r(o+3,d.x,d.y,d.z,l.x),s(o+0,u.x,u.y,u.z,l.y),s(o+1,u.x,u.y,u.z,l.y),s(o+2,u.x,u.y,u.z,l.y),s(o+3,u.x,u.y,u.z,l.y))}function iCe(e,t,n,i){let o,r=n[cu.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 oCe(e,t,n,i){let o,r=n[cu.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 rCe(e,t,n,i){let o,r=n[cu.color],s=i.color,a=Y.floatToByte(s.red),l=Y.floatToByte(s.green),d=Y.floatToByte(s.blue),u=Y.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,l,d,u)):(o=i._index*4,r(o+0,a,l,d,u),r(o+1,a,l,d,u),r(o+2,a,l,d,u),r(o+3,a,l,d,u))}function zSt(e,t,n,i){nCe(e,t,n,i),iCe(e,t,n,i),oCe(e,t,n,i),rCe(e,t,n,i)}function KSt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows;if(r/s<1||r%s!==0)throw new L("noiseTextureRows must evenly divide textureSliceWidth");let a=t.context;o._vaNoise=OSt(a),o._spNoise=tn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let l=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new Pt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA,sampler:new en({wrapS:xn.REPEAT,wrapT:xn.REPEAT,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})});let u=new vc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:eCe(o),u_noiseDetail:function(){return l},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(f){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function JSt(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=HSt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let l=o[a];zSt(e,t,s,l)}n._vaf.commit(n6(i))}}var QSt=[];function jSt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,l=i._propertiesChanged,d=QSt;d.length=0,(l[wSt]||l[PSt])&&d.push(nCe),(l[WSt]||l[ASt])&&d.push(iCe),(l[vSt]||l[FSt])&&d.push(oCe),l[NSt]&&d.push(rCe);let u=d.length,f=i._vaf.writers,p,y,h;if(a/r>.1){for(p=0;p<a;++p)for(y=s[p],y._dirty=!1,h=0;h<u;++h)d[h](e,t,f,y);i._vaf.commit(n6(n))}else{for(p=0;p<a;++p){for(y=s[p],y._dirty=!1,h=0;h<u;++h)d[h](e,t,f,y);i._instanced?i._vaf.subCommit(y._index,1):i._vaf.subCommit(y._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function qSt(e,t,n,i){let o=t.context,r=e,s=new Be({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Be({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=tn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:cu}),r._rs=Oe.fromCache({depthTest:{enabled:!0,func:oe.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function $St(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,l=a.length;s.length=l;for(let d=0;d<l;d++){let u=s[d];c(u)||(u=s[d]=new et),u.pass=Xe.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}Jf.prototype.update=function(e){if(t6(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:c(this._noiseTexture),!this._ready&&!this._loading&&!t&&KSt(this,e,wv,Wv),this._instanced=e.context.instancedArrays,cu=this._instanced?ISt:XSt,n6=this._instanced?BSt:DSt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?JSt(this,e):r>0&&jSt(this,e),r>i*1.5&&(o.length=i),!(!c(this._vaf)||!c(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&qSt(this,e,Iv,Xv),$St(this,e))};Jf.prototype.isDestroyed=function(){return!1};Jf.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(),tCe(this._clouds),he(this)};var i6=Jf;var slo=_(T(),1);var eCt=w.toRadians(30);function o6(e){this._angle=e??eCt}Object.defineProperties(o6.prototype,{angle:{get:function(){return this._angle},set:function(e){C.typeOf.number("value",e),this._angle=e}}});o6.prototype.emit=function(e){let t=Math.tan(this._angle),n=w.randomBetween(0,w.TWO_PI),i=w.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=m.fromElements(o,r,s,e.velocity),m.normalize(e.velocity,e.velocity),e.position=m.clone(m.ZERO,e.position)};var r6=o6;var Vlo=_(T(),1);var tCt=new Y,nCt=new Y,iCt=new Y,oCt=new Y,sCe=new ce,D9=new Uint8Array(4);function aCe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return Y.lerp(t.color,n.color,o,i)}function hB(e,t){return{height:e,color:Y.clone(t)}}function cCe(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?Y.equals(t.color,i[n-1].color):!1,a=r?Y.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?Y.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function rCt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length;if(!Array.isArray(s)||a===0)throw new L("entries must be an array with size > 0.");let l=[];for(n=0;n<a;n++){let y=s[n];if(!c(y.height))throw new L("entry requires a height.");if(!c(y.color))throw new L("entry requires a color.");let h=w.clamp(y.height,id._minimumHeight,id._maximumHeight),g=Y.clone(y.color,tCt);g.red*=g.alpha,g.green*=g.alpha,g.blue*=g.alpha,l.push(hB(h,g))}let d=!0,u=!0;for(n=0;n<a-1;n++){let y=l[n+0],h=l[n+1];d=d&&y.height<=h.height,u=u&&y.height>=h.height}u?l=l.reverse():d||h0(l,function(y,h){return w.sign(y.height-h.height)});let f=r.extendDownwards??!1,p=r.extendUpwards??!1;l.length===1&&!f&&!p&&(f=!0,p=!0),f&&l.splice(0,0,hB(id._minimumHeight,l[0].color)),p&&l.splice(l.length,0,hB(id._maximumHeight,l[l.length-1].color)),l=cCe(l),i.push(l)}return i}function sCt(e){let t=rCt(e),n=[],i=[],o;function r(d,u){n.push(hB(d,u))}function s(d,u,f){let p=Y.multiplyByScalar(f,1-u.alpha,oCt);p=Y.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,f=0;i=n,n=[];let p=d.length,y=i.length;for(;u<p||f<y;){let h=u<p?d[u]:void 0,g=u>0?d[u-1]:void 0,x=u<p-1?d[u+1]:void 0,S=f<y?i[f]:void 0,V=f>0?i[f-1]:void 0,Z=f<y-1?i[f+1]:void 0;if(c(h)&&c(S)&&h.height===S.height){let R=c(Z)&&S.height===Z.height,E=!c(V),I=!c(Z),v=c(x)&&h.height===x.height,P=!c(g),F=!c(x);R?v?(s(h.height,h.color,S.color),s(h.height,x.color,Z.color)):P?(r(h.height,S.color),s(h.height,h.color,Z.color)):F?(s(h.height,h.color,S.color),r(h.height,Z.color)):(s(h.height,h.color,S.color),s(h.height,h.color,Z.color)):E?v?(r(h.height,h.color),s(h.height,x.color,S.color)):F?(r(h.height,h.color),r(h.height,S.color)):(P||r(h.height,h.color),s(h.height,h.color,S.color)):I?v?(s(h.height,h.color,S.color),r(h.height,x.color)):P?(r(h.height,S.color),r(h.height,h.color)):F?s(h.height,h.color,S.color):(s(h.height,h.color,S.color),r(h.height,h.color)):v?(s(h.height,h.color,S.color),s(h.height,x.color,S.color)):P?(r(h.height,S.color),s(h.height,h.color,S.color)):F?(s(h.height,h.color,S.color),r(h.height,S.color)):s(h.height,h.color,S.color),u+=v?2:1,f+=R?2:1}else if(c(h)&&c(S)&&c(V)&&h.height<S.height){let R=aCe(h.height,V,S,iCt);c(g)?c(x)?s(h.height,h.color,R):(s(h.height,h.color,R),r(h.height,R)):(r(h.height,R),s(h.height,h.color,R)),u++}else if(c(S)&&c(h)&&c(g)&&S.height<h.height){let R=aCe(S.height,g,h,nCt);c(V)?c(Z)?s(S.height,R,S.color):(s(S.height,R,S.color),r(S.height,R)):(r(S.height,R),s(S.height,R,S.color)),f++}else c(h)&&(!c(S)||h.height<S.height)?(c(S)&&!c(V)&&!c(x)?(r(h.height,h.color),r(h.height,id._emptyColor),r(S.height,id._emptyColor)):(!c(S)&&c(V)&&!c(g)&&(r(V.height,id._emptyColor),r(h.height,id._emptyColor)),r(h.height,h.color)),u++):c(S)&&(!c(h)||S.height<h.height)&&(r(S.height,S.color),f++)}}return cCe(n)}function id(e){let{scene:t,layers:n}=e??z.EMPTY_OBJECT;C.typeOf.object("options.scene",t),C.defined("options.layers",n),C.typeOf.number.greaterThan("options.layers.length",n.length,0);let{context:i}=t,o=sCt(n),r=o.length,s,a,l;if(!id._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,l=ke.RGBA,s=new Uint8Array(r*4);for(let y=0;y<r;y++)ce.packFloat(o[y].height,sCe),ce.pack(sCe,s,y*4)}else{a=Ue.FLOAT,l=i.webgl2?ke.RED:ke.LUMINANCE,s=new Float32Array(r);for(let y=0;y<r;y++)s[y]=o[y].height}let u=Pt.create({context:i,pixelFormat:l,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.NEAREST,magnificationFilter:di.NEAREST})}),f=new Uint8Array(r*4);for(let y=0;y<r;y++)o[y].color.toBytes(D9),f[y*4+0]=D9[0],f[y*4+1]=D9[1],f[y*4+2]=D9[2],f[y*4+3]=D9[3];let p=Pt.create({context:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:f,width:r,height:1},sampler:new en({wrapS:xn.CLAMP_TO_EDGE,wrapT:xn.CLAMP_TO_EDGE,minificationFilter:Jt.LINEAR,magnificationFilter:di.LINEAR})});return zi.fromType("ElevationBand",{heights:u,colors:p})}id._useFloatTexture=function(e){return e.floatingPointTexture};id._maximumHeight=5906376425472;id._minimumHeight=-5906376425472;id._emptyColor=new Y(0,0,0,0);var s6=id;var Plo=_(T(),1);async function aCt(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??z.EMPTY_OBJECT,C.typeOf.object("apiOptions",e),e.onlyUsingWithGoogleGeocoder||ht("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??CS.defaultApiKey;if(!c(n))return cCt(t);let i,o=CS.getDefaultCredit();c(o)&&(i=[o]);let r=new Ge({url:`${CS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return bs.fromUrl(r,t)}var lCe={};async function cCt(e){let i=lCe[2275207];c(i)||(i=xd.fromAssetId(2275207),lCe[2275207]=i);let o=await i;return bs.fromUrl(o,e)}var a6=aCt;var Ulo=_(T(),1);async function lCt(e){let t=await bs.fromIonAssetId(96188,e);e=e??z.EMPTY_OBJECT;let n=e.style;if(!c(n)){let i=(e.defaultColor??Y.WHITE).toCssColorString();n=new RS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var c6=lCt;var qlo=_(T(),1);function dCt(e){e=e??z.EMPTY_OBJECT;let t=[],n=e.geometry;if(!c(n))throw new L("options.geometry is required.");(!c(n.attributes)||!c(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(e.modelMatrix??M.IDENTITY),r=e.length??1e4;if(c(i.normal)&&t.push(new Rt({geometry:An.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Yt(1,0,0,1)},modelMatrix:o})),c(i.tangent)&&t.push(new Rt({geometry:An.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Yt(0,1,0,1)},modelMatrix:o})),c(i.bitangent)&&t.push(new Rt({geometry:An.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Yt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new an({flat:!0,translucent:!1})})}var l6=dCt;var odo=_(T(),1);function B9(e){e=e??z.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;if(!c(t))throw new L("options.attributeName is required.");c(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;default:throw new L("options.glslDatatype must be float, vec2, vec3, or vec4.")}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=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(B9.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}}});B9.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;B9.prototype.isTranslucent=no.prototype.isTranslucent;B9.prototype.getRenderState=no.prototype.getRenderState;var d6=B9;var ydo=_(T(),1);function pB(e){e=e??z.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}pB.prototype.update=function(e){if(this.show){if(!c(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,c(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 e0({positions:[m.ZERO,m.UNIT_X],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[Y.RED,Y.RED],arcType:Kt.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Rt({geometry:new e0({positions:[m.ZERO,m.UNIT_Y],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[Y.GREEN,Y.GREEN],arcType:Kt.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Rt({geometry:new e0({positions:[m.ZERO,m.UNIT_Z],width:this.width,vertexFormat:es.VERTEX_FORMAT,colors:[Y.BLUE,Y.BLUE],arcType:Kt.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new es,asynchronous:!1})}this._primitive.update(e)}};pB.prototype.isDestroyed=function(){return!1};pB.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),he(this)};var Y9=pB;var Cdo=_(T(),1);function uCt(e){if(C.typeOf.object("options",e),C.typeOf.object("options.direction",e.direction),m.equals(e.direction,m.ZERO))throw new L("options.direction cannot be zero-length");this.direction=m.clone(e.direction),this.color=Y.clone(e.color??Y.WHITE),this.intensity=e.intensity??1}var u6=uCt;var Fdo=_(T(),1);var Ldo=_(T(),1),H9=`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);
materialInput.normalEC = normalEC;
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
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 Rdo=_(T(),1),z9=`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;
v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function XS(e){e=e??z.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=c(e.material)?e.material:zi.fromType(zi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??z9,this._fragmentShaderSource=e.fragmentShaderSource??H9,this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(XS.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 XS.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});XS.VERTEX_FORMAT=We.POSITION_AND_ST;XS.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;XS.prototype.isTranslucent=no.prototype.isTranslucent;XS.prototype.getRenderState=no.prototype.getRenderState;var m6=XS;var Bdo=_(T(),1);function od(e){if(!c(e)||!c(e.scene))throw new L("options.scene is required.");this._scene=e.scene,this.samplingWindow=e.samplingWindow??od.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??od.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??od.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??od.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??od.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new ye,this._nominalFrameRate=new ye,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){mCt(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(){fCt(t)}this._visibilityChangeRemoveListener=void 0,c(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}od.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};od.fromScene=function(e){if(!c(e))throw new L("scene is required.");return(!c(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new od({scene:e})),e._frameRateMonitor};Object.defineProperties(od.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}}});od.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};od.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};od.prototype.isDestroyed=function(){return!1};od.prototype.destroy=function(){return this._preUpdateRemoveListener(),c(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),he(this)};function mCt(e,t){if(e._pauseCount>0)return;let n=Ti();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Kn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Kn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Kn.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 fCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var K9=od;var ruo=_(T(),1);var dCe=_(_7(),1);function f6(){this._image=new Image}f6.prototype.isReady=function(){return!0};f6.prototype.shouldDiscardImage=function(e){return e===this._image};function IS(e){e=e??z.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 Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new de(-w.PI,-w.PI,w.PI,w.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Ct(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new f6),this._errorEvent=new ye}Object.defineProperties(IS.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}}});IS.fromMetadata=function(e,t){if(C.defined("metadata",e),!e.imageryPresent)throw new le(`The server ${e.url} doesn't have imagery`);let n=new IS(t);return n._metadata=e,n};IS.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(c(o)){let r=i.providers[o.imageryProvider];if(c(r))return[r]}};IS.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=G0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!c(a)){if(r.isValid(s)){let d=new Jo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let l=hCt(this,a,e,t,n,i).fetchArrayBuffer();if(c(l))return l.then(function(d){W9(r.key,d);let u=new Uint8Array(d),f,p=r.protoImagery;if((!c(p)||!p)&&(f=pCt(u)),!c(f)&&(!c(p)||p)){let y=bCt(u);f=y.imageType,u=y.imageData}return!c(f)||!c(u)?o:l_({uint8Array:u,format:f,flipY:!0})})};IS.prototype.pickFeatures=function(e,t,n,i,o){};function hCt(e,t,n,i,o,r){let s=G0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=c(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function pCt(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 bCt(e){let t=dCe.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,c(a)||(a=i.copyrightIds=[]),(s&7)===2){let l=t.uint32()+t.pos;for(;t.pos<l;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(c(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new le("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return c(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var h6=IS;var muo=_(T(),1);var yCt=new Y(1,1,1,.4),gCt=new Y(0,1,0,.05),xCt=new Y(0,.5,0,.2);function WS(e){e=e??z.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=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??yCt,this._glowColor=e.glowColor??gCt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??xCt,this._errorEvent=new ye,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(WS.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}}});WS.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()};WS.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};WS.prototype.getTileCredits=function(e,t,n){};WS.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};WS.prototype.pickFeatures=function(e,t,n,i,o){};var p6=WS;var Jmo=_(T(),1);var xmo=_(T(),1);var nmo=_(T(),1);var Cuo=_(T(),1);function Qf(){}Qf._maxDecodingConcurrency=Math.max(Ot.hardwareConcurrency-1,1);Qf._decodeTaskProcessor=new gi("decodeI3S",Qf._maxDecodingConcurrency);Qf._promise=void 0;async function _Ct(){if(await Qf._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Qf._decodeTaskProcessor;throw new le("I3S decoder could not be initialized.")}Qf.decode=async function(e,t,n,i,o){return C.typeOf.string("url",e),C.defined("defaultGeometrySchema",t),C.defined("geometryData",n),c(Qf._promise)||(Qf._promise=_Ct()),Qf._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,l=0,d=0,u=0;c(s.obb)?(l=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):c(s.mbs)&&(l=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let f=te.fromRotationX(-w.PI_OVER_TWO),p=new te;te.multiply(f,a,p);let y=pe.fromDegrees(l,d,u),h=re.WGS84.cartographicToCartesian(y),g={binaryData:n._data,featureData:c(i)&&c(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:re.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:y,cartesianCenter:h,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(g)})};var J9=Qf;var Ruo=_(T(),1);function b6(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,c(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(b6.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});b6.prototype.load=async function(){return this._data=await jf.loadJson(this._resource),this._data};var Q9=b6;var Iuo=_(T(),1);function X0(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;c(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(X0.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(c(this._values)){if(c(this._values.attributeValues))return this._values.attributeValues;if(c(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function bB(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 TCt(e){return e==="String"?1:bB(e)}async function SCt(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)}X0.prototype.load=function(){return c(this._loadPromise)?this._loadPromise:(this._loadPromise=SCt(this).catch(function(e){console.error(e)}),this._loadPromise)};X0.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}};X0.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};X0.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(c(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],l="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(l+=u.value),t=u.offset}this._values[o].push(l)}}}};X0.prototype._getBodyOffset=function(e){let t=0;return c(this._storageInfo.attributeValues)?t=bB(this._storageInfo.attributeValues.valueType):c(this._storageInfo.objectIds)&&(t=bB(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};X0.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=TCt(i.valueType)}if(e.byteLength<t)throw new le(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};X0.prototype._validateBody=function(e,t){if(!c(this._header.count))throw new le(`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(c(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=bB(s.valueType);t+=a*this._header.count}else{if(!c(n))throw new le(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let l=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=l.value,n=l.offset}}else throw new le(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new le(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var j9=X0;var Muo=_(T(),1);function q9(e,t){let n=e._dataProvider,i=e._layer,o;c(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(q9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});q9.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var CCt=new m,VCt=new m,LCt=new m,ZCt=new m,RCt=new m;function y6(e,t,n,i){let o=m.subtract(i,n,CCt),r=m.cross(o,m.subtract(e,n,VCt),ZCt),s=m.cross(o,m.subtract(t,n,LCt),RCt);return m.dot(r,s)>=0}var GCt=new m,ECt=new m,XCt=new m,ICt=new m,WCt=new m,wCt=new m,PCt=new m,vCt=new m,FCt=new m,ACt=new m;q9.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(c(this._customAttributes)&&c(this._customAttributes.positions)){let i=new m(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,te.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,l,d=this._customAttributes.positions,u=this._customAttributes.indices,f;c(u)?f=u.length:f=d.length/3;for(let p=0;p<f;p++){let y,h,g;c(u)?(y=u[p],h=u[p+1],g=u[p+2]):(y=p*3,h=p*3+1,g=p*3+2);let x=m.fromElements(d[y*3],d[y*3+1],d[y*3+2],GCt),S=m.fromElements(d[h*3],d[h*3+1],d[h*3+2],ECt),V=new m(d[g*3],d[g*3+1],d[g*3+2],XCt);if(!y6(i,x,S,V)||!y6(i,S,x,V)||!y6(i,V,x,S))continue;let Z=m.subtract(S,x,ICt),R=m.subtract(V,x,WCt),E=m.cross(Z,R,wCt);if(m.magnitude(E)===0)continue;let I=m.normalize(E,PCt),v=m.subtract(i,x,vCt),P=Math.abs(m.dot(v,I));if(P<o){o=P,r=p;let F=m.magnitudeSquared(m.subtract(i,x,v)),N=m.magnitudeSquared(m.subtract(i,S,FCt)),b=m.magnitudeSquared(m.subtract(i,V,ACt));F<N&&F<b?(a=y,l=x,s=F):N<b?(a=h,l=S,s=N):(a=g,l=V,s=b)}}if(c(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:m.clone(l)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function uCe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(LS(e[i])):t.push(e[i]);return t}q9.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let l={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,f="";if(c(this._parent._data.mesh)&&c(this._layer._data.materialDefinitions)){let Z=this._parent._data.mesh.material.definition;if(Z>=0&&Z<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[Z],l=u,c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorTexture)){d=!0,l.pbrMetallicRoughness.baseColorTexture.index=0;let R="0";if(c(this._layer._data.textureSetDefinitions))for(let E=0;E<this._layer._data.textureSetDefinitions.length;E++){let I=this._layer._data.textureSetDefinitions[E];for(let v=0;v<I.formats.length;v++){let P=I.formats[v];if(P.format==="jpg"){R=P.name;break}}}c(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(f=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${R}`}).url)}c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorFactor)&&(l.pbrMetallicRoughness.baseColorFactor=uCe(l.pbrMetallicRoughness.baseColorFactor)),c(l.emissiveFactor)&&(l.emissiveFactor=uCe(l.emissiveFactor))}}else c(this._parent._data.textureData)&&(d=!0,f=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,l.pbrMetallicRoughness.baseColorTexture={index:0});c(l.alphaMode)&&(l.alphaMode=l.alphaMode.toUpperCase());let p=[],y=[],h=[];d&&(p=[{sampler:0,source:0}],y=[{uri:f}],h=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let g=[],x=n.length;for(let V=0;V<x;V++){let Z=n[V].primitives,R=Z.length;for(let E=0;E<R;E++){let I=Z[E];if(c(I.material)){for(;I.material>=g.length;){let P=He(l,!0);g.push(P)}let v=g[I.material];c(I.extra)&&I.extra.isTransparent?c(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:g,textures:p,images:y,samplers:h,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var NL=q9;function wc(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(wc.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}}});wc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Ku(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!c(this._nodeIndex)){let o=await jf.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/":c(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),c(i)&&c(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function mCe(e,t){let n=new j9(e,t);return e._fields[t.name]=n,n.load()}wc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(c(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];c(o)?t.push(o.load()):t.push(mCe(this,i))}return Promise.all(t)};wc.prototype.loadField=function(e){C.defined("name",e);let t=this._fields[e];if(c(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return mCe(this,o)}return Promise.resolve()};wc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!c(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)};wc.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};wc.prototype._loadChildren=function(){let e=this;if(c(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(c(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new wc(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};wc.prototype._loadGeometryData=function(){let e=[];if(c(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new NL(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(c(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new NL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};wc.prototype._loadFeatureData=function(){let e=[];if(c(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new Q9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};wc.prototype._clearGeometryData=function(){this._geometryData=[]};wc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!c(e)&&!c(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(c(e)?n=pe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=pe.fromDegrees(t[0],t[1],t[2]),c(this._dataProvider._geoidDataList)&&c(n))for(let S=0;S<this._dataProvider._geoidDataList.length;S++){let V=this._dataProvider._geoidDataList[S],Z=V.projection.project(n);if(Z.x>V.nativeExtent.west&&Z.x<V.nativeExtent.east&&Z.y>V.nativeExtent.south&&Z.y<V.nativeExtent.north){n.height+=UCt(Z.x,Z.y,V);break}}let i={},o,r=0;c(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=re.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=re.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(c(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let S=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/S}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let S=this._data.lodThreshold;s=r/S}else console.error("Invalid lodSelectionMetricType in Layer");else if(c(this._data.lodSelection))for(let S=0;S<this._data.lodSelection.length;S++)this._data.lodSelection[S].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[S].maxError);s===1/0&&(s=1e5);let a=s*16,l=new Ea(0,0,0),d=wt.headingPitchRollQuaternion(o,l);c(this._data.obb)&&(d=new Fe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=te.fromQuaternion(d),f=te.inverse(u,new te),p=new M(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),y=M.inverse(p,new M),h=M.clone(p);c(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,h),this._globalTransform=p,this._inverseGlobalTransform=y,this._inverseRotationMatrix=f;let g=[];for(let S=0;S<this._children.length;S++)g.push(this._children[S]._create3DTileDefinition());return{children:g,refine:"REPLACE",boundingVolume:i,transform:[h[0],h[4],h[8],h[12],h[1],h[5],h[9],h[13],h[2],h[6],h[10],h[14],h[3],h[7],h[11],h[15]],content:{uri:c(this._resource)?this._resource.url:void 0},geometricError:a}};wc.prototype._loadSymbology=async function(){!c(this._symbologyData)&&c(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};wc.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),c(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 J9.decode(o,r,s,this._featureData[0],this._symbologyData);if(!c(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 MCt(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 NCt(e,t,n){if(!c(n.values)||n.values.length===0)return!1;let i=c(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 fCe(e,t){let n=e._tile.content.batchTable;if(c(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await MCt(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(!NCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}wc.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(c(this._geometryData)&&this._geometryData.length>0&&c(t)&&t.ready){t.show=!1;let n=fCe(this,t);e.push(n)}return Promise.all(e)};Ku.prototype._hookedRequestContent=Ku.prototype.requestContent;Ku.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(!c(t)){e._isLoading=!1;return}return e._contentResource=new Ge({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return c(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&c(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{fCe(e._i3sNode,n)})),e._isLoading=!1,t})}};function kCt(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 yB(e,t,n,i){let o=e+t*n;return i[o]}function UCt(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 l=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=yB(s,a,n.width,n.buffer),f=yB(l,a,n.width,n.buffer),p=yB(s,d,n.width,n.buffer),y=yB(l,d,n.width,n.buffer),h=kCt(o,r,u,f,p,y);return h=h*n.scale+n.offset,h}Object.defineProperties(Ku.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var kL=wc;var amo=_(T(),1);function gB(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(gB.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function g6(e,t){let n=[];for(let i=0;i<e.length;i++){let o=Y.byteToFloat(e[i]);i<3?n.push(LS(o)):n.push(o)}return n.length===3&&(c(t)?n.push(1-t/100):n.push(1)),n}function UL(e,t){let n={edges:void 0,material:void 0};if(c(e)&&c(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(c(r)?(n.edges={},c(r.color)&&(n.edges.color=g6(r.color,r.transparency))):c(s)&&(n.edges={},c(s.color)&&(n.edges.color=g6(s.color,s.transparency))),!t){let a=o.material;c(a)&&(n.material={colorMixMode:a.colorMixMode},c(a.color)&&(n.material.color=g6(a.color,a.transparency)))}break}}return n}function OCt(e,t){if(c(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(c(o))for(let r=0;r<o.length;r++){let s=UL(o[r].symbol,t),a=o[r].values;for(let l=0;l<a.length;l++){let d=a[l],u=n;for(let f=0;f<d.length;f++){let p=d[f];f===d.length-1?u[p]=s:(c(u[p])||(u[p]={}),u=u[p])}}}}return n}if(c(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=UL(o.symbol,t)}return n}}function DCt(e,t){if(c(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:[]};c(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];c(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),c(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(UL(r.symbol,t)))}return i.symbols.push(void 0),i}}gB.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(c(e)&&c(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=c(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=UL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=UL(i.defaultSymbol,n),this._valueFields.push(i.field1),c(i.field2)&&this._valueFields.push(i.field2),c(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=OCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=UL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=DCt(i,n))}};function hCe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return c(s)&&++n<t.length?hCe(s,t,n,i):s}}function BCt(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 YCt(e,t,n){let i=t[n],o=BCt(e.ranges,i);return e.symbols[o]}gB.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(c(this._uniqueValueHash)?o=r=>hCe(this._uniqueValueHash,i,0,r):c(this._classBreaksHash)&&(o=r=>YCt(this._classBreaksHash,i[0],r)),c(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);c(a)&&(t[s]=a)}}}return t};var $9=gB;function rd(e,t,n){this._dataProvider=e,this._parent=n,!c(t.href)&&c(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Ge({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(rd.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(c(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});rd.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new le(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new $9(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()};rd.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],c(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(c(r.compressedAttributes)&&e){a=!0;let l=r.compressedAttributes.attributes;for(let d=0;d<l.length;d++)s.push(l[d])}else for(let l in r)l!=="offset"&&s.push(l);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)}};rd.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(c(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(c(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};rd.prototype._loadRootNode=function(e){if(c(this._data.nodePages)){let t=0;c(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new kL(this,t,!0)}else this._rootNode=new kL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};rd.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]})};rd._fetchJson=function(e){return e.fetchJson()};rd.prototype._loadNodePage=function(e){let t=this;if(!c(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=rd._fetchJson(n).then(function(o){return c(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};rd.prototype._computeExtent=function(){c(this._data.fullExtent)?this._extent=de.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):c(this._data.store.extent)&&(this._extent=de.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};rd.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;c(o)&&!c(e?.outlineColor)&&(e=c(e)?He(e):{},e.outlineColor=Y.fromCartesian4(ce.fromArray(o))),this._tileset=await bs.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){c(r._i3sNode)&&r._i3sNode._loadChildren()})};rd.prototype._updateVisibility=function(){c(this._tileset)&&(this._tileset.show=this._parent.show)};rd.prototype.filterByAttributes=function(e){this._filters=c(e)?He(e,!0):[];let t=this._rootNode;return c(t)?t._filterFeatures():Promise.resolve()};var wS=rd;var Vmo=_(T(),1);function xB(e,t){this._dataProvider=e,this._resource=new Ge({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(xB.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});xB.prototype.load=async function(){return this._data=await jf.loadJson(this._resource),this._data};xB.prototype._getValues=function(e){let t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return c(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var eM=xB;var Imo=_(T(),1);function tM(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(tM.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(C.defined("value",e),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}}});tM._fromData=async function(e,t,n,i){let o=new tM(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(c(r)){let s=[];for(let l=0;l<r.length;l++){let d=tM._fromData(e,t,r[l],o);s.push(d)}let a=await Promise.all(s);for(let l=0;l<a.length;l++){let d=a[l];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ge({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await jf.loadJson(o._resource),l=new wS(e,a,o);o._i3sLayers.push(l)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var nM=tM;var yCe=_(pCe(),1);function xs(e){e=e??z.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??z.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(xs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(C.defined("value",e),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}}});xs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)c(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return he(this)};xs.prototype.isDestroyed=function(){return!1};xs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};xs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};xs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};xs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)c(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function HCt(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 bCe(e,t,n){if(t.layerType==="Building"){c(n.showFeatures)||(e._showFeatures=!0),c(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),c(n.applySymbology)||(e._applySymbology=!0),c(n.calculateNormals)||(e._calculateNormals=!0);let i=HCt(e,t.id);if(c(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=nM._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(c(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new eM(e,o);await r.load(),e._attributeStatistics.push(r)}if(c(t.fullExtent)){let o=de.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!c(n.calculateNormals)&&!c(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new wS(e,t,e);e._layers.push(i),c(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}xs.fromUrl=async function(e,t){C.defined("url",e),t=t??z.EMPTY_OBJECT;let n=Ge.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await xs.loadJson(n),o=new xs(t);if(o._resource=n,o._data=i,c(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let l=bCe(o,i.layers[a],t);s.push(l)}await Promise.all(s)}else await bCe(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};xs._fetchJson=function(e){return e.fetchJson()};xs.loadJson=async function(e){let t=await xs._fetchJson(e);if(c(t.error)){if(console.error("Failed to fetch I3S ",e.url),c(t.error.message)&&console.error(t.error.message),c(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new le(t.error)}return t};xs.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 le(`Failed to load binary: ${e.url}`);return t};xs.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 zCt=new D;function KCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=pe.fromRadians(t.west,t.north),a=pe.fromRadians(t.east,t.south),l=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let f=l.x;f<=d.x;f++)for(let p=l.y;p<=d.y;p++){let y=D.fromElements(f,p,zCt),h=y.toString();if(!o.hasOwnProperty(h)){let g={x:y.x,y:y.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[h]=g,i.push(g)}}let u=[];for(let f=0;f<i.length;++f){let p=i[f],y=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(y)}return Promise.all(u).then(function(f){let p=[];for(let y=0;y<f.length;y++){let h={tilingScheme:n,x:i[y].x,y:i[y].y,level:i[y].level},g=f[y],x="Geographic";n._projection instanceof Wi&&(x="WebMercator");let S={projectionType:x,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(h.x,h.y,h.level),height:g._height,width:g._width,scale:g._structure.heightScale,offset:g._structure.heightOffset};if(g._encoding===cm.LERC){let V=yCe.default.decode(g._buffer);S.buffer=V.pixels[0]}else S.buffer=g._buffer;p.push(S)}return p})}async function JCt(e){let t=e._geoidTiledTerrainProvider;if(c(t))try{let n=await KCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}xs.prototype.loadGeoidData=async function(){return c(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=JCt(this),this._geoidDataPromise)};xs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];c(e)?de.union(e,n,e):e=de.clone(n)}this._extent=e};xs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};xs.prototype.getAttributeValues=function(e){C.defined("name",e);for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(c(n))return n}return[]};xs.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 jf=xs;var sfo=_(T(),1);var iM={};iM.createTilesetFromIModelId=async function(e,t){let{exports:n}=await as.getExports(e);if(n.length>0&&n.every(a=>a.status===as.ExportStatus.Invalid))throw new le(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===as.ExportStatus.Complete);if(!c(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new Ge({url:r});return bs.fromUrl(s,t)};iM.createTilesetForRealityDataId=async function(e,t,n,i){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),c(n)&&C.typeOf.string("type",n),c(i)&&C.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await as.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![as.RealityDataType.Cesium3DTiles,as.RealityDataType.PNTS,as.RealityDataType.RealityMesh3DTiles,as.RealityDataType.Terrain3DTiles].includes(n))throw new le(`Reality data type is not a mesh type: ${n}`);let r=await as.getRealityDataURL(e,t,i);return bs.fromUrl(r,{maximumScreenSpaceError:4})};iM.createDataSourceForRealityDataId=async function(e,t,n,i){if(C.typeOf.string("iTwinId",e),C.typeOf.string("realityDataId",t),c(n)&&C.typeOf.string("type",n),c(i)&&C.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await as.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![as.RealityDataType.KML,as.RealityDataType.GeoJSON].includes(n))throw new le(`Reality data type is not a data source type: ${n}`);let r=await as.getRealityDataURL(e,t,i);return n===as.RealityDataType.GeoJSON?gg.load(r):XT.load(r)};iM.loadGeospatialFeatures=async function(e,t,n){if(C.typeOf.string("iTwinId",e),C.typeOf.string("collectionId",t),c(n)&&(C.typeOf.number("limit",n),C.typeOf.number.lessThanOrEquals("limit",n,1e4),C.typeOf.number.greaterThanOrEquals("limit",n,1)),!c(as.defaultAccessToken)&&!c(as.defaultShareKey))throw new L("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=n??1e4,o=`${as.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new Ge({url:o,headers:{Authorization:as._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return gg.load(r)};var x6=iM;var lfo=_(T(),1);function gCe(){}Object.defineProperties(gCe.prototype,{color:{get:L.throwInstantiationError},intensity:{get:L.throwInstantiationError}});var _6=gCe;var yfo=_(T(),1);var QCt=/\/$/,xCe=new Ct('&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 OL(e){e=e??z.EMPTY_OBJECT;let t=e.styleId;if(!c(t))throw new L("options.styleId is required.");let n=e.accessToken;if(!c(n))throw new L("options.accessToken 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;let i=Ge.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=c(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();QCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let l;c(e.credit)?(l=e.credit,typeof l=="string"&&(l=new Ct(l))):l=xCe,this._resource=i,this._imageryProvider=new Ba({url:i,credit:l,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(OL.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}}});OL.prototype.getTileCredits=function(e,t,n){};OL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};OL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};OL._defaultCredit=xCe;var T6=OL;var xfo=_(T(),1);function S6(e){}S6.prototype.isReady=function(){return!0};S6.prototype.shouldDiscardImage=function(e){return!1};var C6=S6;var Efo=_(T(),1);var jCt=new Ct("MapQuest, Open Street Map and contributors, CC-BY-SA");function TB(e){e=e??z.EMPTY_OBJECT;let t=Ge.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new ss({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,l=n.positionToTileXY(de.southwest(a),r),d=n.positionToTileXY(de.northeast(a),r),u=(Math.abs(d.x-l.x)+1)*(Math.abs(d.y-l.y)+1);if(u>4)throw new L(`The rectangle and minimumLevel indicate that there are ${u} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);let f=e.credit??jCt;typeof f=="string"&&(f=new Ct(f)),Ba.call(this,{url:t,credit:f,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}c(Object.create)&&(TB.prototype=Object.create(Ba.prototype),TB.prototype.constructor=TB);var I0=TB;var Ffo=_(T(),1);var qCt=new D(1,1);function V6(e){e=e??z.EMPTY_OBJECT,this.mass=e.mass??1,this.position=m.clone(e.position??m.ZERO),this.velocity=m.clone(e.velocity??m.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=Y.clone(e.startColor??Y.WHITE),this.endColor=Y.clone(e.endColor??Y.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=D.clone(e.imageSize??qCt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(V6.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var _Ce=new m;V6.prototype.update=function(e,t){return m.multiplyByScalar(this.velocity,e,_Ce),m.add(this.position,_Ce,this.position),c(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 DL=V6;var Nfo=_(T(),1);function TCe(e){e=e??z.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(TCe.prototype,{complete:{get:function(){return this._complete}}});var L6=TCe;var Ofo=_(T(),1);function SCe(e){throw new L("This type should not be instantiated directly.  Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}SCe.prototype.emit=function(e){L.throwInstantiationError()};var Z6=SCe;var oho=_(T(),1);var CCe=new D(1,1);function oM(e){e=e??z.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;c(t)||(t=new O9(.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=Y.clone(e.color??e.startColor??Y.WHITE),this._endColor=Y.clone(e.color??e.endColor??Y.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=D.clone(e.imageSize??e.minimumImageSize??CCe),this._maximumImageSize=D.clone(e.imageSize??e.maximumImageSize??CCe),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 ye,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(oM.prototype,{emitter:{get:function(){return this._emitter},set:function(e){C.defined("value",e),this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){C.defined("value",e),this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){C.defined("value",e),this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){C.defined("value",e),Y.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){C.defined("value",e),Y.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){C.typeOf.object("value",e),C.typeOf.number.greaterThanOrEquals("value.x",e.x,0),C.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){C.typeOf.object("value",e),C.typeOf.number.greaterThanOrEquals("value.x",e.x,0),C.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){C.typeOf.bool("value",e),this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){C.typeOf.number.greaterThanOrEquals("value",e,0),this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function $Ct(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(c(o)){let f=o.length;for(let p=0;p<f;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),l=e._particles,d=e._particlePool,u=Math.max(a-l.length-d.length,0);for(let f=0;f<u;++f){let p=new DL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function e1t(e){let t=e._particlePool.pop();return c(t)||(t=new DL),t}function t1t(e,t){e._particlePool.push(t)}function n1t(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 l=a;l<r;++l){let d=n[l];i.remove(d._billboard)}n.length=a}function i1t(e){c(e._billboard)&&(e._billboard.show=!1)}function VCe(e,t){let n=t._billboard;c(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=w.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=w.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=w.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=w.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new Y(i,o,r,s),n.scale=w.lerp(t.startScale,t.endScale,t.normalizedAge)}function o1t(e,t){t.startColor=Y.clone(e._startColor,t.startColor),t.endColor=Y.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=w.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=w.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=w.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=w.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=w.randomBetween(e._minimumSpeed,e._maximumSpeed);m.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function r1t(e,t){if(e._isComplete)return 0;t=w.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),c(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;c(s)&&!s._complete&&a>s.time&&(i+=w.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var SB=new m;oM.prototype.update=function(e){if(!this.show)return;c(this._billboardCollection)||(this._billboardCollection=new Gd),this._updateParticlePool&&($Ct(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=ee.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)?VCe(this,s):(i1t(s),t1t(this,s),n[r]=n[a-1],--r,--a);n.length=a;let l=r1t(this,t);if(l>0&&c(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<l;r++)s=e1t(this),this._emitter.emit(s),m.add(s.position,s.velocity,SB),M.multiplyByPoint(d,SB,SB),s.position=M.multiplyByPoint(d,s.position,s.position),m.subtract(SB,s.position,s.velocity),m.normalize(s.velocity,s.velocity),o1t(this,s),VCe(this,s)}if(this._billboardCollection.update(e),this._previousTime=ee.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=w.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&n1t(this)};oM.prototype.isDestroyed=function(){return!1};oM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),he(this)};var R6=oM;var aho=_(T(),1);function lu(){L.throwInstantiationError()}lu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(lu.prototype,{quadtree:{get:L.throwInstantiationError,set:L.throwInstantiationError},tilingScheme:{get:L.throwInstantiationError},errorEvent:{get:L.throwInstantiationError}});lu.prototype.update=L.throwInstantiationError;lu.prototype.beginUpdate=L.throwInstantiationError;lu.prototype.endUpdate=L.throwInstantiationError;lu.prototype.getLevelMaximumGeometricError=L.throwInstantiationError;lu.prototype.loadTile=L.throwInstantiationError;lu.prototype.computeTileVisibility=L.throwInstantiationError;lu.prototype.showTileThisFrame=L.throwInstantiationError;lu.prototype.computeDistanceToTile=L.throwInstantiationError;lu.prototype.isDestroyed=L.throwInstantiationError;lu.prototype.destroy=L.throwInstantiationError;var G6=lu;var mho=_(T(),1);function E6(e){e=e??1,C.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(E6.prototype,{radius:{get:function(){return this._radius},set:function(e){C.typeOf.number.greaterThan("value",e,0),this._radius=e}}});E6.prototype.emit=function(e){let t=w.randomBetween(0,w.TWO_PI),n=w.randomBetween(0,w.PI),i=w.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=m.fromElements(o,r,s,e.position),e.velocity=m.normalize(e.position,e.velocity)};var X6=E6;var pho=_(T(),1);function rM(){}rM.prototype.evaluate=function(e,t){L.throwInstantiationError()};rM.prototype.evaluateColor=function(e,t){L.throwInstantiationError()};rM.prototype.getShaderFunction=function(e,t,n,i){L.throwInstantiationError()};rM.prototype.getVariables=function(){L.throwInstantiationError()};var I6=rM;var Tho=_(T(),1);function BL(e){C.typeOf.object("terrainProviderPromise",e),this._ready=!1,this._provider=void 0,this._errorEvent=new ye,this._readyEvent=new ye,a1t(this,e)}Object.defineProperties(BL.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}}});BL.fromWorldTerrain=function(e){return new BL(TS(e))};BL.fromWorldBathymetry=function(e){return new BL(I9(e))};function s1t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function a1t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){s1t(e._errorEvent,i)}}var sM=BL;var Vho=_(T(),1);function YL(){}YL.prototype.boundingVolume=void 0;YL.prototype.boundingSphere=void 0;YL.prototype.distanceToCamera=function(e){L.throwInstantiationError()};YL.prototype.intersectPlane=function(e){L.throwInstantiationError()};YL.prototype.createDebugVolume=function(e){L.throwInstantiationError()};var W6=YL;var Iho=_(T(),1);function aM(e){e=e??z.EMPTY_OBJECT,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._color=e.color??Y.YELLOW,this._errorEvent=new ye,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(aM.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}}});aM.prototype.getTileCredits=function(e,t,n){};aM.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)};aM.prototype.pickFeatures=function(e,t,n,i,o){};var cM=aM;var Pho=_(T(),1);function w6(e){L.throwInstantiationError()}w6.prototype.isReady=L.throwInstantiationError;w6.prototype.shouldDiscardImage=L.throwInstantiationError;var P6=w6;var Fho=_(T(),1),c1t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},v6=Object.freeze(c1t);var Jho=_(T(),1);function CB(e,t){this.show=!0,c(e)||(e=new je),this.rectangle=je.clone(e),c(t)||(t=zi.fromType(zi.ColorType,{color:new Y(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}CB.prototype.update=function(e){if(!this.show)return;if(!c(this.material))throw new L("this.material must be defined.");if(!c(this.rectangle))throw new L("this.rectangle must be defined.");let t=this._rs;if((!c(t)||!je.equals(t.viewport,this.rectangle))&&(this._rs=Oe.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!c(this._overlayCommand)){this._material=this.material,c(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Be({sources:[this._material.shaderSource,Qv]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Xe.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};CB.prototype.isDestroyed=function(){return!1};CB.prototype.destroy=function(){return c(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),he(this)};var F6=CB;var qho=_(T(),1);function A6(){L.throwInstantiationError()}Object.defineProperties(A6.prototype,{globalTransform:{get:L.throwInstantiationError},shapeTransform:{get:L.throwInstantiationError},shape:{get:L.throwInstantiationError},minBounds:{get:L.throwInstantiationError},maxBounds:{get:L.throwInstantiationError},dimensions:{get:L.throwInstantiationError},paddingBefore:{get:L.throwInstantiationError},paddingAfter:{get:L.throwInstantiationError},names:{get:L.throwInstantiationError},types:{get:L.throwInstantiationError},componentTypes:{get:L.throwInstantiationError},minimumValues:{get:L.throwInstantiationError},maximumValues:{get:L.throwInstantiationError},maximumTileCount:{get:L.throwInstantiationError},availableLevels:{get:L.throwInstantiationError},keyframeCount:{get:L.throwInstantiationError},timeIntervalCollection:{get:L.throwInstantiationError}});A6.prototype.requestData=function(e){L.throwInstantiationError()};var M6=A6;var tpo=_(T(),1);function PS(){L.throwInstantiationError()}Object.defineProperties(PS.prototype,{orientedBoundingBox:{get:L.throwInstantiationError},boundingSphere:{get:L.throwInstantiationError},boundTransform:{get:L.throwInstantiationError},shapeTransform:{get:L.throwInstantiationError},shaderUniforms:{get:L.throwInstantiationError},shaderDefines:{get:L.throwInstantiationError},shaderMaximumIntersectionsLength:{get:L.throwInstantiationError}});PS.prototype.update=L.throwInstantiationError;PS.prototype.computeOrientedBoundingBoxForTile=L.throwInstantiationError;PS.prototype.computeOrientedBoundingBoxForSample=L.throwInstantiationError;PS.DefaultMinBounds=L.throwInstantiationError;PS.DefaultMaxBounds=L.throwInstantiationError;var N6=PS;var ipo=_(T(),1),k6=`uniform sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
z_window = czm_reverseLogDepth(z_window);
float n_range = czm_depthRange.near;
float f_range = czm_depthRange.far;
float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
}
`;var fpo=_(T(),1);function l1t(e){e=e??z.EMPTY_OBJECT;let t=c(e.typedArray),n=c(e.url);if(t===n)throw new L("exactly one of options.typedArray, options.url must be defined");if(t&&(!c(e.width)||!c(e.height)))throw new L("options.width and options.height are required when options.typedArray is defined");this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??ke.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let i=e.url;typeof i=="string"&&(i=Ge.createIfNeeded(i)),this.resource=i;let r=e.repeat??!0?xn.REPEAT:xn.CLAMP_TO_EDGE;this.sampler=new en({wrapS:r,wrapT:r,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var U6=l1t;var ppo=_(T(),1),d1t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},O6=Object.freeze(d1t);var ypo=_(T(),1),u1t={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},D6=Object.freeze(u1t);var _po=_(T(),1);function m1t(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: ${qh(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 B6=m1t;globalThis.CESIUM_VERSION="1.129";var lMo=_(T(),1);var v2o=_(T(),1);var I2o=_(T(),1);var S2o=_(T(),1),lM;typeof ko<"u"&&(lM=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 l(b,G){return b===null||typeof b in g?b===G:!1}function d(b,G){var X;return function(){X||(X=h.a.setTimeout(function(){X=e,b()},G))}}function u(b,G){var X;return function(){clearTimeout(X),X=h.a.setTimeout(b,G)}}function f(b,G){G&&G!=="change"?G==="beforeChange"?this.pc(b):this.gb(b,G):this.qc(b)}function p(b,G){G!==null&&G.s&&G.s()}function y(b,G){var X=this.qd,W=X[R];W.ra||(this.Qb&&this.mb[G]?(X.uc(G,b,this.mb[G]),this.mb[G]=null,--this.Qb):W.I[G]||X.uc(G,b,W.J?{da:b}:X.$c(b)),b.Ja&&b.gd())}var h=typeof s<"u"?s:{};h.b=function(b,G){for(var X=b.split("."),W=h,A=0;A<X.length-1;A++)W=W[X[A]];W[X[X.length-1]]=G},h.L=function(b,G,X){b[G]=X},h.version="3.5.1",h.b("version",h.version),h.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},h.a=function(){function b(j,$){for(var ne in j)A.call(j,ne)&&$(ne,j[ne])}function G(j,$){if($)for(var ne in $)A.call($,ne)&&(j[ne]=$[ne]);return j}function X(j,$){return j.__proto__=$,j}function W(j,$,ne,be){var Ce=j[$].match(Q)||[];h.a.D(ne.match(Q),function(me){h.a.Na(Ce,me,be)}),j[$]=Ce.join(" ")}var A=Object.prototype.hasOwnProperty,k={__proto__:[]}instanceof Array,B=typeof Symbol=="function",O={},H={};O[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],O.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(O,function(j,$){if($.length)for(var ne=0,be=$.length;ne<be;ne++)H[$[ne]]=j});var U={propertychange:!0},K=n&&function(){for(var j=3,$=n.createElement("div"),ne=$.getElementsByTagName("i");$.innerHTML="<!--[if gt IE "+ ++j+"]><i></i><![endif]-->",ne[0];);return 4<j?j:e}(),Q=/\S+/g,ie;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(j,$,ne){for(var be=0,Ce=j.length;be<Ce;be++)$.call(ne,j[be],be,j)},A:typeof Array.prototype.indexOf=="function"?function(j,$){return Array.prototype.indexOf.call(j,$)}:function(j,$){for(var ne=0,be=j.length;ne<be;ne++)if(j[ne]===$)return ne;return-1},Lb:function(j,$,ne){for(var be=0,Ce=j.length;be<Ce;be++)if($.call(ne,j[be],be,j))return j[be];return e},Pa:function(j,$){var ne=h.a.A(j,$);0<ne?j.splice(ne,1):ne===0&&j.shift()},wc:function(j){var $=[];return j&&h.a.D(j,function(ne){0>h.a.A($,ne)&&$.push(ne)}),$},Mb:function(j,$,ne){var be=[];if(j)for(var Ce=0,me=j.length;Ce<me;Ce++)be.push($.call(ne,j[Ce],Ce));return be},jb:function(j,$,ne){var be=[];if(j)for(var Ce=0,me=j.length;Ce<me;Ce++)$.call(ne,j[Ce],Ce)&&be.push(j[Ce]);return be},Nb:function(j,$){if($ instanceof Array)j.push.apply(j,$);else for(var ne=0,be=$.length;ne<be;ne++)j.push($[ne]);return j},Na:function(j,$,ne){var be=h.a.A(h.a.bc(j),$);0>be?ne&&j.push($):ne||j.splice(be,1)},Ba:k,extend:G,setPrototypeOf:X,Ab:k?X:G,P:b,Ga:function(j,$,ne){if(!j)return j;var be={},Ce;for(Ce in j)A.call(j,Ce)&&(be[Ce]=$.call(ne,j[Ce],Ce,j));return be},Tb:function(j){for(;j.firstChild;)h.removeNode(j.firstChild)},Yb:function(j){j=h.a.la(j);for(var $=(j[0]&&j[0].ownerDocument||n).createElement("div"),ne=0,be=j.length;ne<be;ne++)$.appendChild(h.oa(j[ne]));return $},Ca:function(j,$){for(var ne=0,be=j.length,Ce=[];ne<be;ne++){var me=j[ne].cloneNode(!0);Ce.push($?h.oa(me):me)}return Ce},va:function(j,$){if(h.a.Tb(j),$)for(var ne=0,be=$.length;ne<be;ne++)j.appendChild($[ne])},Xc:function(j,$){var ne=j.nodeType?[j]:j;if(0<ne.length){for(var be=ne[0],Ce=be.parentNode,me=0,_e=$.length;me<_e;me++)Ce.insertBefore($[me],be);for(me=0,_e=ne.length;me<_e;me++)h.removeNode(ne[me])}},Ua:function(j,$){if(j.length){for($=$.nodeType===8&&$.parentNode||$;j.length&&j[0].parentNode!==$;)j.splice(0,1);for(;1<j.length&&j[j.length-1].parentNode!==$;)j.length--;if(1<j.length){var ne=j[0],be=j[j.length-1];for(j.length=0;ne!==be;)j.push(ne),ne=ne.nextSibling;j.push(be)}}return j},Zc:function(j,$){7>K?j.setAttribute("selected",$):j.selected=$},Db:function(j){return j===null||j===e?"":j.trim?j.trim():j.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(j,$){return j=j||"",$.length>j.length?!1:j.substring(0,$.length)===$},vd:function(j,$){if(j===$)return!0;if(j.nodeType===11)return!1;if($.contains)return $.contains(j.nodeType!==1?j.parentNode:j);if($.compareDocumentPosition)return($.compareDocumentPosition(j)&16)==16;for(;j&&j!=$;)j=j.parentNode;return!!j},Sb:function(j){return h.a.vd(j,j.ownerDocument.documentElement)},kd:function(j){return!!h.a.Lb(j,h.a.Sb)},R:function(j){return j&&j.tagName&&j.tagName.toLowerCase()},Ac:function(j){return h.onError?function(){try{return j.apply(this,arguments)}catch($){throw h.onError&&h.onError($),$}}:j},setTimeout:function(j,$){return setTimeout(h.a.Ac(j),$)},Gc:function(j){setTimeout(function(){throw h.onError&&h.onError(j),j},0)},B:function(j,$,ne){var be=h.a.Ac(ne);if(ne=U[$],h.options.useOnlyNativeEvents||ne||!o)if(ne||typeof j.addEventListener!="function")if(typeof j.attachEvent<"u"){var Ce=function(_e){be.call(j,_e)},me="on"+$;j.attachEvent(me,Ce),h.a.K.za(j,function(){j.detachEvent(me,Ce)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else j.addEventListener($,be,!1);else ie||(ie=typeof o(j).on=="function"?"on":"bind"),o(j)[ie]($,be)},Fb:function(j,$){if(!j||!j.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ne;if(h.a.R(j)==="input"&&j.type&&$.toLowerCase()=="click"?(ne=j.type,ne=ne=="checkbox"||ne=="radio"):ne=!1,h.options.useOnlyNativeEvents||!o||ne)if(typeof n.createEvent=="function")if(typeof j.dispatchEvent=="function")ne=n.createEvent(H[$]||"HTMLEvents"),ne.initEvent($,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,j),j.dispatchEvent(ne);else throw Error("The supplied element doesn't support dispatchEvent");else if(ne&&j.click)j.click();else if(typeof j.fireEvent<"u")j.fireEvent("on"+$);else throw Error("Browser doesn't support triggering events");else o(j).trigger($)},f:function(j){return h.O(j)?j():j},bc:function(j){return h.O(j)?j.v():j},Eb:function(j,$,ne){var be;$&&(typeof j.classList=="object"?(be=j.classList[ne?"add":"remove"],h.a.D($.match(Q),function(Ce){be.call(j.classList,Ce)})):typeof j.className.baseVal=="string"?W(j.className,"baseVal",$,ne):W(j,"className",$,ne))},Bb:function(j,$){var ne=h.a.f($);(ne===null||ne===e)&&(ne="");var be=h.h.firstChild(j);!be||be.nodeType!=3||h.h.nextSibling(be)?h.h.va(j,[j.ownerDocument.createTextNode(ne)]):be.data=ne,h.a.Ad(j)},Yc:function(j,$){if(j.name=$,7>=K)try{var ne=j.name.replace(/[&<>'"]/g,function(be){return"&#"+be.charCodeAt(0)+";"});j.mergeAttributes(n.createElement("<input name='"+ne+"'/>"),!1)}catch{}},Ad:function(j){9<=K&&(j=j.nodeType==1?j:j.parentNode,j.style&&(j.style.zoom=j.style.zoom))},wd:function(j){if(K){var $=j.style.width;j.style.width=0,j.style.width=$}},Pd:function(j,$){j=h.a.f(j),$=h.a.f($);for(var ne=[],be=j;be<=$;be++)ne.push(be);return ne},la:function(j){for(var $=[],ne=0,be=j.length;ne<be;ne++)$.push(j[ne]);return $},Da:function(j){return B?Symbol(j):j},Zd:K===6,$d:K===7,W:K,Lc:function(j,$){for(var ne=h.a.la(j.getElementsByTagName("input")).concat(h.a.la(j.getElementsByTagName("textarea"))),be=typeof $=="string"?function(_e){return _e.name===$}:function(_e){return $.test(_e.name)},Ce=[],me=ne.length-1;0<=me;me--)be(ne[me])&&Ce.push(ne[me]);return Ce},Nd:function(j){return typeof j=="string"&&(j=h.a.Db(j))?r&&r.parse?r.parse(j):new Function("return "+j)():null},hc:function(j,$,ne){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(h.a.f(j),$,ne)},Od:function(j,$,ne){ne=ne||{};var be=ne.params||{},Ce=ne.includeFields||this.Jc,me=j;if(typeof j=="object"&&h.a.R(j)==="form")for(var me=j.action,_e=Ce.length-1;0<=_e;_e--)for(var Ve=h.a.Lc(j,Ce[_e]),Ie=Ve.length-1;0<=Ie;Ie--)be[Ve[Ie].name]=Ve[Ie].value;$=h.a.f($);var Ze=n.createElement("form");Ze.style.display="none",Ze.action=me,Ze.method="post";for(var De in $)j=n.createElement("input"),j.type="hidden",j.name=De,j.value=h.a.hc(h.a.f($[De])),Ze.appendChild(j);b(be,function(Ke,rt){var Xt=n.createElement("input");Xt.type="hidden",Xt.name=Ke,Xt.value=rt,Ze.appendChild(Xt)}),n.body.appendChild(Ze),ne.submitter?ne.submitter(Ze):Ze.submit(),setTimeout(function(){Ze.parentNode.removeChild(Ze)},0)}}}(),h.b("utils",h.a),h.b("utils.arrayForEach",h.a.D),h.b("utils.arrayFirst",h.a.Lb),h.b("utils.arrayFilter",h.a.jb),h.b("utils.arrayGetDistinctValues",h.a.wc),h.b("utils.arrayIndexOf",h.a.A),h.b("utils.arrayMap",h.a.Mb),h.b("utils.arrayPushAll",h.a.Nb),h.b("utils.arrayRemoveItem",h.a.Pa),h.b("utils.cloneNodes",h.a.Ca),h.b("utils.createSymbolOrString",h.a.Da),h.b("utils.extend",h.a.extend),h.b("utils.fieldsIncludedWithJsonPost",h.a.Jc),h.b("utils.getFormFields",h.a.Lc),h.b("utils.objectMap",h.a.Ga),h.b("utils.peekObservable",h.a.bc),h.b("utils.postJson",h.a.Od),h.b("utils.parseJson",h.a.Nd),h.b("utils.registerEventHandler",h.a.B),h.b("utils.stringifyJson",h.a.hc),h.b("utils.range",h.a.Pd),h.b("utils.toggleDomNodeCssClass",h.a.Eb),h.b("utils.triggerEvent",h.a.Fb),h.b("utils.unwrapObservable",h.a.f),h.b("utils.objectForEach",h.a.P),h.b("utils.addOrRemoveItem",h.a.Na),h.b("utils.setTextContent",h.a.Bb),h.b("unwrap",h.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var G=this;if(arguments.length===1)return function(){return G.apply(b,arguments)};var X=Array.prototype.slice.call(arguments,1);return function(){var W=X.slice(0);return W.push.apply(W,arguments),G.apply(b,W)}}),h.a.g=new function(){var b=0,G="__ko__"+new Date().getTime(),X={},W,A;return h.a.W?(W=function(k,B){var O=k[G];if(!O||O==="null"||!X[O]){if(!B)return e;O=k[G]="ko"+b++,X[O]={}}return X[O]},A=function(k){var B=k[G];return B?(delete X[B],k[G]=null,!0):!1}):(W=function(k,B){var O=k[G];return!O&&B&&(O=k[G]={}),O},A=function(k){return k[G]?(delete k[G],!0):!1}),{get:function(k,B){var O=W(k,!1);return O&&O[B]},set:function(k,B,O){(k=W(k,O!==e))&&(k[B]=O)},Ub:function(k,B,O){return k=W(k,!0),k[B]||(k[B]=O)},clear:A,Z:function(){return b+++G}}},h.b("utils.domData",h.a.g),h.b("utils.domData.clear",h.a.g.clear),h.a.K=new function(){function b(B,O){var H=h.a.g.get(B,W);return H===e&&O&&(H=[],h.a.g.set(B,W,H)),H}function G(B){var O=b(B,!1);if(O)for(var O=O.slice(0),H=0;H<O.length;H++)O[H](B);h.a.g.clear(B),h.a.K.cleanExternalData(B),k[B.nodeType]&&X(B.childNodes,!0)}function X(B,O){for(var H=[],U,K=0;K<B.length;K++)if((!O||B[K].nodeType===8)&&(G(H[H.length]=U=B[K]),B[K]!==U))for(;K--&&h.a.A(H,B[K])==-1;);}var W=h.a.g.Z(),A={1:!0,8:!0,9:!0},k={1:!0,9:!0};return{za:function(B,O){if(typeof O!="function")throw Error("Callback must be a function");b(B,!0).push(O)},yb:function(B,O){var H=b(B,!1);H&&(h.a.Pa(H,O),H.length==0&&h.a.g.set(B,W,e))},oa:function(B){return h.u.G(function(){A[B.nodeType]&&(G(B),k[B.nodeType]&&X(B.getElementsByTagName("*")))}),B},removeNode:function(B){h.oa(B),B.parentNode&&B.parentNode.removeChild(B)},cleanExternalData:function(B){o&&typeof o.cleanData=="function"&&o.cleanData([B])}}},h.oa=h.a.K.oa,h.removeNode=h.a.K.removeNode,h.b("cleanNode",h.oa),h.b("removeNode",h.removeNode),h.b("utils.domNodeDisposal",h.a.K),h.b("utils.domNodeDisposal.addDisposeCallback",h.a.K.za),h.b("utils.domNodeDisposal.removeDisposeCallback",h.a.K.yb),function(){var b=[0,"",""],G=[1,"<table>","</table>"],X=[3,"<table><tbody><tr>","</tr></tbody></table>"],W=[1,"<select multiple='multiple'>","</select>"],A={thead:G,tbody:G,tfoot:G,tr:[2,"<table><tbody>","</tbody></table>"],td:X,th:X,option:W,optgroup:W},k=8>=h.a.W;h.a.ua=function(B,O){var H;if(o){if(o.parseHTML)H=o.parseHTML(B,O)||[];else if((H=o.clean([B],O))&&H[0]){for(var U=H[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(H=O)||(H=n);var U=H.parentWindow||H.defaultView||t,K=h.a.Db(B).toLowerCase(),Q=H.createElement("div"),ie;for(ie=(K=K.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&A[K[1]]||b,K=ie[0],ie="ignored<div>"+ie[1]+B+ie[2]+"</div>",typeof U.innerShiv=="function"?Q.appendChild(U.innerShiv(ie)):(k&&H.body.appendChild(Q),Q.innerHTML=ie,k&&Q.parentNode.removeChild(Q));K--;)Q=Q.lastChild;H=h.a.la(Q.lastChild.childNodes)}return H},h.a.Md=function(B,O){var H=h.a.ua(B,O);return H.length&&H[0].parentElement||h.a.Yb(H)},h.a.fc=function(B,O){if(h.a.Tb(B),O=h.a.f(O),O!==null&&O!==e)if(typeof O!="string"&&(O=O.toString()),o)o(B).html(O);else for(var H=h.a.ua(O,B.ownerDocument),U=0;U<H.length;U++)B.appendChild(H[U])}}(),h.b("utils.parseHtmlFragment",h.a.ua),h.b("utils.setHtml",h.a.fc),h.aa=function(){function b(X,W){if(X){if(X.nodeType==8){var A=h.aa.Uc(X.nodeValue);A!=null&&W.push({ud:X,Kd:A})}else if(X.nodeType==1)for(var A=0,k=X.childNodes,B=k.length;A<B;A++)b(k[A],W)}}var G={};return{Xb:function(X){if(typeof X!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var W=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return G[W]=X,"<!--[ko_memo:"+W+"]-->"},bd:function(X,W){var A=G[X];if(A===e)throw Error("Couldn't find any memo with ID "+X+". Perhaps it's already been unmemoized.");try{return A.apply(null,W||[]),!0}finally{delete G[X]}},cd:function(X,W){var A=[];b(X,A);for(var k=0,B=A.length;k<B;k++){var O=A[k].ud,H=[O];W&&h.a.Nb(H,W),h.aa.bd(A[k].Kd,H),O.nodeValue="",O.parentNode&&O.parentNode.removeChild(O)}},Uc:function(X){return(X=X.match(/^\[ko_memo\:(.*?)\]$/))?X[1]:null}}}(),h.b("memoization",h.aa),h.b("memoization.memoize",h.aa.Xb),h.b("memoization.unmemoize",h.aa.bd),h.b("memoization.parseMemoText",h.aa.Uc),h.b("memoization.unmemoizeDomNodeAndDescendants",h.aa.cd),h.na=function(){function b(){if(A){for(var O=A,H=0,U;B<A;)if(U=W[B++]){if(B>O){if(5e3<=++H){B=A,h.a.Gc(Error("'Too much recursion' after processing "+H+" task groups."));break}O=A}try{U()}catch(K){h.a.Gc(K)}}}}function G(){b(),B=A=W.length=0}var X,W=[],A=0,k=1,B=0;return t.MutationObserver?X=function(O){var H=n.createElement("div");return new MutationObserver(O).observe(H,{attributes:!0}),function(){H.classList.toggle("foo")}}(G):X=n&&"onreadystatechange"in n.createElement("script")?function(O){var H=n.createElement("script");H.onreadystatechange=function(){H.onreadystatechange=null,n.documentElement.removeChild(H),H=null,O()},n.documentElement.appendChild(H)}:function(O){setTimeout(O,0)},{scheduler:X,zb:function(O){return A||h.na.scheduler(G),W[A++]=O,k++},cancel:function(O){O=O-(k-A),O>=B&&O<A&&(W[O]=null)},resetForTesting:function(){var O=A-B;return B=A=W.length=0,O},Sd:b}}(),h.b("tasks",h.na),h.b("tasks.schedule",h.na.zb),h.b("tasks.runEarly",h.na.Sd),h.Ta={throttle:function(b,G){b.throttleEvaluation=G;var X=null;return h.$({read:b,write:function(W){clearTimeout(X),X=h.a.setTimeout(function(){b(W)},G)}})},rateLimit:function(b,G){var X,W,A;typeof G=="number"?X=G:(X=G.timeout,W=G.method),b.Hb=!1,A=typeof W=="function"?W:W=="notifyWhenChangesStop"?u:d,b.ub(function(k){return A(k,X,G)})},deferred:function(b,G){if(G!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(X){var W,A=!1;return function(){if(!A){h.na.cancel(W),W=h.na.zb(X);try{A=!0,b.notifySubscribers(e,"dirty")}finally{A=!1}}}}))},notify:function(b,G){b.equalityComparer=G=="always"?null:l}};var g={undefined:1,boolean:1,number:1,string:1};h.b("extenders",h.Ta),h.ic=function(b,G,X){this.da=b,this.lc=G,this.mc=X,this.Ib=!1,this.fb=this.Jb=null,h.L(this,"dispose",this.s),h.L(this,"disposeWhenNodeIsRemoved",this.l)},h.ic.prototype.s=function(){this.Ib||(this.fb&&h.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},h.ic.prototype.l=function(b){this.Jb=b,h.a.K.za(b,this.fb=this.s.bind(this))},h.T=function(){h.a.Ab(this,x),x.qb(this)};var x={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,G,X){var W=this;X=X||"change";var A=new h.ic(W,G?b.bind(G):b,function(){h.a.Pa(W.U[X],A),W.hb&&W.hb(X)});return W.Qa&&W.Qa(X),W.U[X]||(W.U[X]=[]),W.U[X].push(A),A},notifySubscribers:function(b,G){if(G=G||"change",G==="change"&&this.Gb(),this.Wa(G)){var X=G==="change"&&this.ed||this.U[G].slice(0);try{h.u.xc();for(var W=0,A;A=X[W];++W)A.Ib||A.lc(b)}finally{h.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var G=this,X=h.O(G),W,A,k,B,O;G.gb||(G.gb=G.notifySubscribers,G.notifySubscribers=f);var H=b(function(){G.Ja=!1,X&&B===G&&(B=G.nc?G.nc():G());var U=A||O&&G.sb(k,B);O=A=W=!1,U&&G.gb(k=B)});G.qc=function(U,K){K&&G.Ja||(O=!K),G.ed=G.U.change.slice(0),G.Ja=W=!0,B=U,H()},G.pc=function(U){W||(k=U,G.gb(U,"beforeChange"))},G.rc=function(){O=!0},G.gd=function(){G.sb(k,G.v(!0))&&(A=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var G=0;return h.a.P(this.U,function(X,W){X!=="dirty"&&(G+=W.length)}),G},sb:function(b,G){return!this.equalityComparer||!this.equalityComparer(b,G)},toString:function(){return"[object Object]"},extend:function(b){var G=this;return b&&h.a.P(b,function(X,W){var A=h.Ta[X];typeof A=="function"&&(G=A(G,W)||G)}),G}};h.L(x,"init",x.qb),h.L(x,"subscribe",x.subscribe),h.L(x,"extend",x.extend),h.L(x,"getSubscriptionsCount",x.Bd),h.a.Ba&&h.a.setPrototypeOf(x,Function.prototype),h.T.fn=x,h.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},h.b("subscribable",h.T),h.b("isSubscribable",h.Qc),h.S=h.u=function(){function b(k){X.push(W),W=k}function G(){W=X.pop()}var X=[],W,A=0;return{xc:b,end:G,cc:function(k){if(W){if(!h.Qc(k))throw Error("Only subscribable things can act as dependencies");W.od.call(W.pd,k,k.fd||(k.fd=++A))}},G:function(k,B,O){try{return b(),k.apply(B,O||[])}finally{G()}},qa:function(){if(W)return W.o.qa()},Va:function(){if(W)return W.o.Va()},Ya:function(){if(W)return W.Ya},o:function(){if(W)return W.o}}}(),h.b("computedContext",h.S),h.b("computedContext.getDependenciesCount",h.S.qa),h.b("computedContext.getDependencies",h.S.Va),h.b("computedContext.isInitial",h.S.Ya),h.b("computedContext.registerDependency",h.S.cc),h.b("ignoreDependencies",h.Yd=h.u.G);var S=h.a.Da("_latestValue");h.ta=function(b){function G(){return 0<arguments.length?(G.sb(G[S],arguments[0])&&(G.ya(),G[S]=arguments[0],G.xa()),this):(h.u.cc(G),G[S])}return G[S]=b,h.a.Ba||h.a.extend(G,h.T.fn),h.T.fn.qb(G),h.a.Ab(G,V),h.options.deferUpdates&&h.Ta.deferred(G,!0),G};var V={equalityComparer:l,v:function(){return this[S]},xa:function(){this.notifySubscribers(this[S],"spectate"),this.notifySubscribers(this[S])},ya:function(){this.notifySubscribers(this[S],"beforeChange")}};h.a.Ba&&h.a.setPrototypeOf(V,h.T.fn);var Z=h.ta.Ma="__ko_proto__";V[Z]=h.ta,h.O=function(b){if((b=typeof b=="function"&&b[Z])&&b!==V[Z]&&b!==h.o.fn[Z])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},h.Za=function(b){return typeof b=="function"&&(b[Z]===V[Z]||b[Z]===h.o.fn[Z]&&b.Nc)},h.b("observable",h.ta),h.b("isObservable",h.O),h.b("isWriteableObservable",h.Za),h.b("isWritableObservable",h.Za),h.b("observable.fn",V),h.L(V,"peek",V.v),h.L(V,"valueHasMutated",V.xa),h.L(V,"valueWillMutate",V.ya),h.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=h.ta(b),h.a.Ab(b,h.Ha.fn),b.extend({trackArrayChanges:!0})},h.Ha.fn={remove:function(b){for(var G=this.v(),X=[],W=typeof b!="function"||h.O(b)?function(B){return B===b}:b,A=0;A<G.length;A++){var k=G[A];if(W(k)){if(X.length===0&&this.ya(),G[A]!==k)throw Error("Array modified during remove; cannot remove item");X.push(k),G.splice(A,1),A--}}return X.length&&this.xa(),X},removeAll:function(b){if(b===e){var G=this.v(),X=G.slice(0);return this.ya(),G.splice(0,G.length),this.xa(),X}return b?this.remove(function(W){return 0<=h.a.A(b,W)}):[]},destroy:function(b){var G=this.v(),X=typeof b!="function"||h.O(b)?function(k){return k===b}:b;this.ya();for(var W=G.length-1;0<=W;W--){var A=G[W];X(A)&&(A._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(G){return 0<=h.a.A(b,G)}):[]},indexOf:function(b){var G=this();return h.a.A(G,b)},replace:function(b,G){var X=this.indexOf(b);0<=X&&(this.ya(),this.v()[X]=G,this.xa())},sorted:function(b){var G=this().slice(0);return b?G.sort(b):G.sort()},reversed:function(){return this().slice(0).reverse()}},h.a.Ba&&h.a.setPrototypeOf(h.Ha.fn,h.ta.fn),h.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){h.Ha.fn[b]=function(){var G=this.v();this.ya(),this.zc(G,b,arguments);var X=G[b].apply(G,arguments);return this.xa(),X===G?this:X}}),h.a.D(["slice"],function(b){h.Ha.fn[b]=function(){var G=this();return G[b].apply(G,arguments)}}),h.Pc=function(b){return h.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},h.b("observableArray",h.Ha),h.b("isObservableArray",h.Pc),h.Ta.trackArrayChanges=function(b,G){function X(){function Q(){if(O){var ie=[].concat(b.v()||[]),j;b.Wa("arrayChange")&&((!A||1<O)&&(A=h.a.Pb(H,ie,b.Ob)),j=A),H=ie,A=null,O=0,j&&j.length&&b.notifySubscribers(j,"arrayChange")}}W?Q():(W=!0,B=b.subscribe(function(){++O},null,"spectate"),H=[].concat(b.v()||[]),A=null,k=b.subscribe(Q))}if(b.Ob={},G&&typeof G=="object"&&h.a.extend(b.Ob,G),b.Ob.sparse=!0,!b.zc){var W=!1,A=null,k,B,O=0,H,U=b.Qa,K=b.hb;b.Qa=function(Q){U&&U.call(b,Q),Q==="arrayChange"&&X()},b.hb=function(Q){K&&K.call(b,Q),Q!=="arrayChange"||b.Wa("arrayChange")||(k&&k.s(),B&&B.s(),B=k=null,W=!1,H=e)},b.zc=function(Q,ie,j){function $(Ze,De,Ke){return ne[ne.length]={status:Ze,value:De,index:Ke}}if(W&&!O){var ne=[],be=Q.length,Ce=j.length,me=0;switch(ie){case"push":me=be;case"unshift":for(ie=0;ie<Ce;ie++)$("added",j[ie],me+ie);break;case"pop":me=be-1;case"shift":be&&$("deleted",Q[me],me);break;case"splice":ie=Math.min(Math.max(0,0>j[0]?be+j[0]:j[0]),be);for(var be=Ce===1?be:Math.min(ie+(j[1]||0),be),Ce=ie+Ce-2,me=Math.max(be,Ce),_e=[],Ve=[],Ie=2;ie<me;++ie,++Ie)ie<be&&Ve.push($("deleted",Q[ie],ie)),ie<Ce&&_e.push($("added",j[Ie],ie));h.a.Kc(Ve,_e);break;default:return}A=ne}}}};var R=h.a.Da("_state");h.o=h.$=function(b,G,X){function W(){if(0<arguments.length){if(typeof A=="function")A.apply(k.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 k.ra||h.u.cc(W),(k.ka||k.J&&W.Xa())&&W.ha(),k.X}if(typeof b=="object"?X=b:(X=X||{},b&&(X.read=b)),typeof X.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var A=X.write,k={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:X.read,nb:G||X.owner,l:X.disposeWhenNodeIsRemoved||X.l||null,Sa:X.disposeWhen||X.Sa,Rb:null,I:{},V:0,Ic:null};return W[R]=k,W.Nc=typeof A=="function",h.a.Ba||h.a.extend(W,h.T.fn),h.T.fn.qb(W),h.a.Ab(W,E),X.pure?(k.wb=!0,k.J=!0,h.a.extend(W,I)):X.deferEvaluation&&h.a.extend(W,v),h.options.deferUpdates&&h.Ta.deferred(W,!0),k.l&&(k.jc=!0,k.l.nodeType||(k.l=null)),k.J||X.deferEvaluation||W.ha(),k.l&&W.ja()&&h.a.K.za(k.l,k.Rb=function(){W.s()}),W};var E={equalityComparer:l,qa:function(){return this[R].V},Va:function(){var b=[];return h.a.P(this[R].I,function(G,X){b[X.Ka]=X.da}),b},Vb:function(b){if(!this[R].V)return!1;var G=this.Va();return h.a.A(G,b)!==-1?!0:!!h.a.Lb(G,function(X){return X.Vb&&X.Vb(b)})},uc:function(b,G,X){if(this[R].wb&&G===this)throw Error("A 'pure' computed must not be called recursively");this[R].I[b]=X,X.Ka=this[R].V++,X.La=G.ob()},Xa:function(){var b,G,X=this[R].I;for(b in X)if(Object.prototype.hasOwnProperty.call(X,b)&&(G=X[b],this.Ia&&G.da.Ja||G.da.Dd(G.La)))return!0},Jd:function(){this.Ia&&!this[R].rb&&this.Ia(!1)},ja:function(){var b=this[R];return b.ka||0<b.V},Rd:function(){this.Ja?this[R].ka&&(this[R].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var G=b.subscribe(this.Jd,this,"dirty"),X=b.subscribe(this.Rd,this);return{da:b,s:function(){G.s(),X.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,G=b.throttleEvaluation;G&&0<=G?(clearTimeout(this[R].Ic),this[R].Ic=h.a.setTimeout(function(){b.ha(!0)},G)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var G=this[R],X=G.Sa,W=!1;if(!G.rb&&!G.ra){if(G.l&&!h.a.Sb(G.l)||X&&X()){if(!G.jc){this.s();return}}else G.jc=!1;G.rb=!0;try{W=this.zd(b)}finally{G.rb=!1}return W}},zd:function(b){var G=this[R],W=!1,X=G.wb?e:!G.V,W={qd:this,mb:G.I,Qb:G.V};h.u.xc({pd:W,od:y,o:this,Ya:X}),G.I={},G.V=0;var A=this.yd(G,W);return G.V?W=this.sb(G.X,A):(this.s(),W=!0),W&&(G.J?this.Gb():this.notifySubscribers(G.X,"beforeChange"),G.X=A,this.notifySubscribers(G.X,"spectate"),!G.J&&b&&this.notifySubscribers(G.X),this.rc&&this.rc()),X&&this.notifySubscribers(G.X,"awake"),W},yd:function(b,G){try{var X=b.Wc;return b.nb?X.call(b.nb):X()}finally{h.u.end(),G.Qb&&!b.J&&h.a.P(G.mb,p),b.sa=b.ka=!1}},v:function(b){var G=this[R];return(G.ka&&(b||!G.V)||G.J&&this.Xa())&&this.ha(),G.X},ub:function(b){h.T.fn.ub.call(this,b),this.nc=function(){return this[R].J||(this[R].sa?this.ha():this[R].ka=!1),this[R].X},this.Ia=function(G){this.pc(this[R].X),this[R].ka=!0,G&&(this[R].sa=!0),this.qc(this,!G)}},s:function(){var b=this[R];!b.J&&b.I&&h.a.P(b.I,function(G,X){X.s&&X.s()}),b.l&&b.Rb&&h.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},I={Qa:function(b){var G=this,X=G[R];if(!X.ra&&X.J&&b=="change"){if(X.J=!1,X.sa||G.Xa())X.I=null,X.V=0,G.ha()&&G.Gb();else{var W=[];h.a.P(X.I,function(A,k){W[k.Ka]=A}),h.a.D(W,function(A,k){var B=X.I[A],O=G.$c(B.da);O.Ka=k,O.La=B.La,X.I[A]=O}),G.Xa()&&G.ha()&&G.Gb()}X.ra||G.notifySubscribers(X.X,"awake")}},hb:function(b){var G=this[R];G.ra||b!="change"||this.Wa("change")||(h.a.P(G.I,function(X,W){W.s&&(G.I[X]={da:W.da,Ka:W.Ka,La:W.La},W.s())}),G.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[R];return b.J&&(b.sa||this.Xa())&&this.ha(),h.T.fn.ob.call(this)}},v={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};h.a.Ba&&h.a.setPrototypeOf(E,h.T.fn);var P=h.ta.Ma;E[P]=h.o,h.Oc=function(b){return typeof b=="function"&&b[P]===E[P]},h.Fd=function(b){return h.Oc(b)&&b[R]&&b[R].wb},h.b("computed",h.o),h.b("dependentObservable",h.o),h.b("isComputed",h.Oc),h.b("isPureComputed",h.Fd),h.b("computed.fn",E),h.L(E,"peek",E.v),h.L(E,"dispose",E.s),h.L(E,"isActive",E.ja),h.L(E,"getDependenciesCount",E.qa),h.L(E,"getDependencies",E.Va),h.xb=function(b,G){return typeof b=="function"?h.o(b,G,{pure:!0}):(b=h.a.extend({},b),b.pure=!0,h.o(b,G))},h.b("pureComputed",h.xb),function(){function b(W,A,k){if(k=k||new X,W=A(W),typeof W!="object"||W===null||W===e||W instanceof RegExp||W instanceof Date||W instanceof String||W instanceof Number||W instanceof Boolean)return W;var B=W instanceof Array?[]:{};return k.save(W,B),G(W,function(O){var H=A(W[O]);switch(typeof H){case"boolean":case"number":case"string":case"function":B[O]=H;break;case"object":case"undefined":var U=k.get(H);B[O]=U!==e?U:b(H,A,k)}}),B}function G(W,A){if(W instanceof Array){for(var k=0;k<W.length;k++)A(k);typeof W.toJSON=="function"&&A("toJSON")}else for(k in W)A(k)}function X(){this.keys=[],this.values=[]}h.ad=function(W){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(W,function(A){for(var k=0;h.O(A)&&10>k;k++)A=A();return A})},h.toJSON=function(W,A,k){return W=h.ad(W),h.a.hc(W,A,k)},X.prototype={constructor:X,save:function(W,A){var k=h.a.A(this.keys,W);0<=k?this.values[k]=A:(this.keys.push(W),this.values.push(A))},get:function(W){return W=h.a.A(this.keys,W),0<=W?this.values[W]:e}}}(),h.b("toJS",h.ad),h.b("toJSON",h.toJSON),h.Wd=function(b,G,X){function W(A){var k=h.xb(b,X).extend({ma:"always"}),B=k.subscribe(function(O){O&&(B.s(),A(O))});return k.notifySubscribers(k.v()),B}return typeof Promise!="function"||G?W(G.bind(X)):new Promise(W)},h.b("when",h.Wd),function(){h.w={M:function(b){switch(h.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?h.a.g.get(b,h.c.options.$b):7>=h.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?h.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,G,X){switch(h.a.R(b)){case"option":typeof G=="string"?(h.a.g.set(b,h.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=G):(h.a.g.set(b,h.c.options.$b,G),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof G=="number"?G:"");break;case"select":(G===""||G===null)&&(G=e);for(var W=-1,A=0,k=b.options.length,B;A<k;++A)if(B=h.w.M(b.options[A]),B==G||B===""&&G===e){W=A;break}(X||0<=W||G===e&&1<b.size)&&(b.selectedIndex=W,h.a.W===6&&h.a.setTimeout(function(){b.selectedIndex=W},0));break;default:(G===null||G===e)&&(G=""),b.value=G}}}}(),h.b("selectExtensions",h.w),h.b("selectExtensions.readValue",h.w.M),h.b("selectExtensions.writeValue",h.w.cb),h.m=function(){function b(O){O=h.a.Db(O),O.charCodeAt(0)===123&&(O=O.slice(1,-1)),O+=`
,`;var H=[],U=O.match(W),K,Q=[],ie=0;if(1<U.length){for(var j=0,$;$=U[j];++j){var ne=$.charCodeAt(0);if(ne===44){if(0>=ie){H.push(K&&Q.length?{key:K,value:Q.join("")}:{unknown:K||Q.join("")}),K=ie=0,Q=[];continue}}else if(ne===58){if(!ie&&!K&&Q.length===1){K=Q.pop();continue}}else{if(ne===47&&1<$.length&&($.charCodeAt(1)===47||$.charCodeAt(1)===42))continue;ne===47&&j&&1<$.length?(ne=U[j-1].match(A))&&!k[ne[0]]&&(O=O.substr(O.indexOf($)+1),U=O.match(W),j=-1,$="/"):ne===40||ne===123||ne===91?++ie:ne===41||ne===125||ne===93?--ie:K||Q.length||ne!==34&&ne!==39||($=$.slice(1,-1))}Q.push($)}if(0<ie)throw Error("Unbalanced parentheses, braces, or brackets")}return H}var G=["true","false","null","undefined"],X=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,W=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),A=/[\])"'A-Za-z0-9_$]+$/,k={in:1,return:1,typeof:1},B={};return{Ra:[],wa:B,ac:b,vb:function(O,H){function U(ne,be){var Ce;if(!j){var me=h.getBindingHandler(ne);if(me&&me.preprocess&&!(be=me.preprocess(be,ne,U)))return;(me=B[ne])&&(Ce=be,0<=h.a.A(G,Ce)?Ce=!1:(me=Ce.match(X),Ce=me===null?!1:me[1]?"Object("+me[1]+")"+me[2]:Ce),me=Ce),me&&Q.push("'"+(typeof B[ne]=="string"?B[ne]:ne)+"':function(_z){"+Ce+"=_z}")}ie&&(be="function(){return "+be+" }"),K.push("'"+ne+"':"+be)}H=H||{};var K=[],Q=[],ie=H.valueAccessors,j=H.bindingParams,$=typeof O=="string"?b(O):O;return h.a.D($,function(ne){U(ne.key||ne.unknown,ne.value)}),Q.length&&U("_ko_property_writers","{"+Q.join(",")+" }"),K.join(",")},Id:function(O,H){for(var U=0;U<O.length;U++)if(O[U].key==H)return!0;return!1},eb:function(O,H,U,K,Q){O&&h.O(O)?!h.Za(O)||Q&&O.v()===K||O(K):(O=H.get("_ko_property_writers"))&&O[U]&&O[U](K)}}}(),h.b("expressionRewriting",h.m),h.b("expressionRewriting.bindingRewriteValidators",h.m.Ra),h.b("expressionRewriting.parseObjectLiteral",h.m.ac),h.b("expressionRewriting.preProcessBindings",h.m.vb),h.b("expressionRewriting._twoWayBindings",h.m.wa),h.b("jsonExpressionRewriting",h.m),h.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",h.m.vb),function(){function b(U){return U.nodeType==8&&k.test(A?U.text:U.nodeValue)}function G(U){return U.nodeType==8&&B.test(A?U.text:U.nodeValue)}function X(U,K){for(var Q=U,ie=1,j=[];Q=Q.nextSibling;){if(G(Q)&&(h.a.g.set(Q,H,!0),ie--,ie===0))return j;j.push(Q),b(Q)&&ie++}if(!K)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function W(U,K){var Q=X(U,K);return Q?0<Q.length?Q[Q.length-1].nextSibling:U.nextSibling:null}var A=n&&n.createComment("test").text==="<!--test-->",k=A?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,B=A?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,O={ul:!0,ol:!0},H="__ko_matchedEndComment__";h.h={ea:{},childNodes:function(U){return b(U)?X(U):U.childNodes},Ea:function(U){if(b(U)){U=h.h.childNodes(U);for(var K=0,Q=U.length;K<Q;K++)h.removeNode(U[K])}else h.a.Tb(U)},va:function(U,K){if(b(U)){h.h.Ea(U);for(var Q=U.nextSibling,ie=0,j=K.length;ie<j;ie++)Q.parentNode.insertBefore(K[ie],Q)}else h.a.va(U,K)},Vc:function(U,K){var Q;b(U)?(Q=U.nextSibling,U=U.parentNode):Q=U.firstChild,Q?K!==Q&&U.insertBefore(K,Q):U.appendChild(K)},Wb:function(U,K,Q){Q?(Q=Q.nextSibling,b(U)&&(U=U.parentNode),Q?K!==Q&&U.insertBefore(K,Q):U.appendChild(K)):h.h.Vc(U,K)},firstChild:function(U){if(b(U))return!U.nextSibling||G(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&G(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(b(U)&&(U=W(U)),U.nextSibling&&G(U.nextSibling)){var K=U.nextSibling;if(G(K)&&!h.a.g.get(K,H))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:b,Vd:function(U){return(U=(A?U.text:U.nodeValue).match(k))?U[1]:null},Sc:function(U){if(O[h.a.R(U)]){var K=U.firstChild;if(K)do if(K.nodeType===1){var Q;Q=K.firstChild;var ie=null;if(Q)do if(ie)ie.push(Q);else if(b(Q)){var j=W(Q,!0);j?Q=j:ie=[Q]}else G(Q)&&(ie=[Q]);while(Q=Q.nextSibling);if(Q=ie)for(ie=K.nextSibling,j=0;j<Q.length;j++)ie?U.insertBefore(Q[j],ie):U.appendChild(Q[j])}while(K=K.nextSibling)}}}}(),h.b("virtualElements",h.h),h.b("virtualElements.allowedBindings",h.h.ea),h.b("virtualElements.emptyNode",h.h.Ea),h.b("virtualElements.insertAfter",h.h.Wb),h.b("virtualElements.prepend",h.h.Vc),h.b("virtualElements.setDomNodeChildren",h.h.va),function(){h.ga=function(){this.nd={}},h.a.extend(h.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||h.j.getComponentNameForNode(b);case 8:return h.h.Cd(b);default:return!1}},getBindings:function(b,G){var X=this.getBindingsString(b,G),X=X?this.parseBindingsString(X,G,b):null;return h.j.tc(X,b,G,!1)},getBindingAccessors:function(b,G){var X=this.getBindingsString(b,G),X=X?this.parseBindingsString(X,G,b,{valueAccessors:!0}):null;return h.j.tc(X,b,G,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return h.h.Vd(b);default:return null}},parseBindingsString:function(b,G,X,W){try{var A=this.nd,k=b+(W&&W.valueAccessors||""),B;if(!(B=A[k])){var O,H="with($context){with($data||{}){return{"+h.m.vb(b,W)+"}}}";O=new Function("$context","$element",H),B=A[k]=O}return B(G,X)}catch(U){throw U.message=`Unable to parse bindings.
Bindings value: `+b+`
Message: `+U.message,U}}}),h.ga.instance=new h.ga}(),h.b("bindingProvider",h.ga),function(){function b(me){var _e=(me=h.a.g.get(me,Ce))&&me.N;_e&&(me.N=null,_e.Tc())}function G(me,_e,Ve){this.node=me,this.yc=_e,this.kb=[],this.H=!1,_e.N||h.a.K.za(me,b),Ve&&Ve.N&&(Ve.N.kb.push(me),this.Kb=Ve)}function X(me){return function(){return me}}function W(me){return me()}function A(me){return h.a.Ga(h.u.G(me),function(_e,Ve){return function(){return me()[Ve]}})}function k(me,_e,Ve){return typeof me=="function"?A(me.bind(null,_e,Ve)):h.a.Ga(me,X)}function B(me,_e){return A(this.getBindings.bind(this,me,_e))}function O(me,_e){var Ve=h.h.firstChild(_e);if(Ve){var Ie,Ze=h.ga.instance,De=Ze.preprocessNode;if(De){for(;Ie=Ve;)Ve=h.h.nextSibling(Ie),De.call(Ze,Ie);Ve=h.h.firstChild(_e)}for(;Ie=Ve;)Ve=h.h.nextSibling(Ie),H(me,Ie)}h.i.ma(_e,h.i.H)}function H(me,_e){var Ve=me,Ie=_e.nodeType===1;Ie&&h.h.Sc(_e),(Ie||h.ga.instance.nodeHasBindings(_e))&&(Ve=K(_e,null,me).bindingContextForDescendants),Ve&&!ne[h.a.R(_e)]&&O(Ve,_e)}function U(me){var _e=[],Ve={},Ie=[];return h.a.P(me,function Ze(De){if(!Ve[De]){var Ke=h.getBindingHandler(De);Ke&&(Ke.after&&(Ie.push(De),h.a.D(Ke.after,function(rt){if(me[rt]){if(h.a.A(Ie,rt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ie.join(", "));Ze(rt)}}),Ie.length--),_e.push({key:De,Mc:Ke})),Ve[De]=!0}}),_e}function K(me,_e,Ve){var Ie=h.a.g.Ub(me,Ce,{}),Ze=Ie.hd;if(!_e){if(Ze)throw Error("You cannot apply bindings multiple times to the same element.");Ie.hd=!0}Ze||(Ie.context=Ve),Ie.Zb||(Ie.Zb={});var De;if(_e&&typeof _e!="function")De=_e;else{var Ke=h.ga.instance,rt=Ke.getBindingAccessors||B,Xt=h.$(function(){return(De=_e?_e(Ve,me):rt.call(Ke,me,Ve))&&(Ve[ie]&&Ve[ie](),Ve[$]&&Ve[$]()),De},null,{l:me});De&&Xt.ja()||(Xt=null)}var Ht=Ve,qe;if(De){var mn=function(){return h.a.Ga(Xt?Xt():De,W)},Dt=Xt?function(Lt){return function(){return W(Xt()[Lt])}}:function(Lt){return De[Lt]};mn.get=function(Lt){return De[Lt]&&W(Dt(Lt))},mn.has=function(Lt){return Lt in De},h.i.H in De&&h.i.subscribe(me,h.i.H,function(){var Lt=(0,De[h.i.H])();if(Lt){var Vi=h.h.childNodes(me);Vi.length&&Lt(Vi,h.Ec(Vi[0]))}}),h.i.pa in De&&(Ht=h.i.Cb(me,Ve),h.i.subscribe(me,h.i.pa,function(){var Lt=(0,De[h.i.pa])();Lt&&h.h.firstChild(me)&&Lt(me)})),Ie=U(De),h.a.D(Ie,function(Lt){var Vi=Lt.Mc.init,ln=Lt.Mc.update,ge=Lt.key;if(me.nodeType===8&&!h.h.ea[ge])throw Error("The binding '"+ge+"' cannot be used with virtual elements");try{typeof Vi=="function"&&h.u.G(function(){var Le=Vi(me,Dt(ge),mn,Ht.$data,Ht);if(Le&&Le.controlsDescendantBindings){if(qe!==e)throw Error("Multiple bindings ("+qe+" and "+ge+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");qe=ge}}),typeof ln=="function"&&h.$(function(){ln(me,Dt(ge),mn,Ht.$data,Ht)},null,{l:me})}catch(Le){throw Le.message='Unable to process binding "'+ge+": "+De[ge]+`"
Message: `+Le.message,Le}})}return Ie=qe===e,{shouldBindDescendants:Ie,bindingContextForDescendants:Ie&&Ht}}function Q(me,_e){return me&&me instanceof h.fa?me:new h.fa(me,e,e,_e)}var ie=h.a.Da("_subscribable"),j=h.a.Da("_ancestorBindingInfo"),$=h.a.Da("_dataDependency");h.c={};var ne={script:!0,textarea:!0,template:!0};h.getBindingHandler=function(me){return h.c[me]};var be={};h.fa=function(me,_e,Ve,Ie,Ze){function De(){var Dt=Ht?Xt():Xt,Lt=h.a.f(Dt);return _e?(h.a.extend(Ke,_e),j in _e&&(Ke[j]=_e[j])):(Ke.$parents=[],Ke.$root=Lt,Ke.ko=h),Ke[ie]=qe,rt?Lt=Ke.$data:(Ke.$rawData=Dt,Ke.$data=Lt),Ve&&(Ke[Ve]=Lt),Ie&&Ie(Ke,_e,Lt),_e&&_e[ie]&&!h.S.o().Vb(_e[ie])&&_e[ie](),mn&&(Ke[$]=mn),Ke.$data}var Ke=this,rt=me===be,Xt=rt?e:me,Ht=typeof Xt=="function"&&!h.O(Xt),qe,mn=Ze&&Ze.dataDependency;Ze&&Ze.exportDependencies?De():(qe=h.xb(De),qe.v(),qe.ja()?qe.equalityComparer=null:Ke[ie]=e)},h.fa.prototype.createChildContext=function(me,_e,Ve,Ie){if(!Ie&&_e&&typeof _e=="object"&&(Ie=_e,_e=Ie.as,Ve=Ie.extend),_e&&Ie&&Ie.noChildContext){var Ze=typeof me=="function"&&!h.O(me);return new h.fa(be,this,null,function(De){Ve&&Ve(De),De[_e]=Ze?me():me},Ie)}return new h.fa(me,this,_e,function(De,Ke){De.$parentContext=Ke,De.$parent=Ke.$data,De.$parents=(Ke.$parents||[]).slice(0),De.$parents.unshift(De.$parent),Ve&&Ve(De)},Ie)},h.fa.prototype.extend=function(me,_e){return new h.fa(be,this,null,function(Ve){h.a.extend(Ve,typeof me=="function"?me(Ve):me)},_e)};var Ce=h.a.g.Z();G.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},G.prototype.sd=function(me){h.a.Pa(this.kb,me),!this.kb.length&&this.H&&this.Cc()},G.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,h.a.K.yb(this.node,b),h.i.ma(this.node,h.i.pa),this.Tc())},h.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(me,_e,Ve,Ie,Ze){var De=h.a.g.Ub(me,Ce,{});return De.Fa||(De.Fa=new h.T),Ze&&Ze.notifyImmediately&&De.Zb[_e]&&h.u.G(Ve,Ie,[me]),De.Fa.subscribe(Ve,Ie,_e)},ma:function(me,_e){var Ve=h.a.g.get(me,Ce);if(Ve&&(Ve.Zb[_e]=!0,Ve.Fa&&Ve.Fa.notifySubscribers(me,_e),_e==h.i.H)){if(Ve.N)Ve.N.Cc();else if(Ve.N===e&&Ve.Fa&&Ve.Fa.Wa(h.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(me,_e){var Ve=h.a.g.Ub(me,Ce,{});return Ve.N||(Ve.N=new G(me,Ve,_e[j])),_e[j]==Ve?_e:_e.extend(function(Ie){Ie[j]=Ve})}},h.Td=function(me){return(me=h.a.g.get(me,Ce))&&me.context},h.ib=function(me,_e,Ve){return me.nodeType===1&&h.h.Sc(me),K(me,_e,Q(Ve))},h.ld=function(me,_e,Ve){return Ve=Q(Ve),h.ib(me,k(_e,Ve,me),Ve)},h.Oa=function(me,_e){_e.nodeType!==1&&_e.nodeType!==8||O(Q(me),_e)},h.vc=function(me,_e,Ve){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(_e=n.body,!_e)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!_e||_e.nodeType!==1&&_e.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");H(Q(me,Ve),_e)},h.Dc=function(me){return!me||me.nodeType!==1&&me.nodeType!==8?e:h.Td(me)},h.Ec=function(me){return(me=h.Dc(me))?me.$data:e},h.b("bindingHandlers",h.c),h.b("bindingEvent",h.i),h.b("bindingEvent.subscribe",h.i.subscribe),h.b("bindingEvent.startPossiblyAsyncContentBinding",h.i.Cb),h.b("applyBindings",h.vc),h.b("applyBindingsToDescendants",h.Oa),h.b("applyBindingAccessorsToNode",h.ib),h.b("applyBindingsToNode",h.ld),h.b("contextFor",h.Dc),h.b("dataFor",h.Ec)}(),function(b){function G(B,O){var H=Object.prototype.hasOwnProperty.call(A,B)?A[B]:b,U;H?H.subscribe(O):(H=A[B]=new h.T,H.subscribe(O),X(B,function(K,Q){var ie=!(!Q||!Q.synchronous);k[B]={definition:K,Gd:ie},delete A[B],U||ie?H.notifySubscribers(K):h.na.zb(function(){H.notifySubscribers(K)})}),U=!0)}function X(B,O){W("getConfig",[B],function(H){H?W("loadComponent",[B,H],function(U){O(U,H)}):O(null,null)})}function W(B,O,H,U){U||(U=h.j.loaders.slice(0));var K=U.shift();if(K){var Q=K[B];if(Q){var ie=!1;if(Q.apply(K,O.concat(function(j){ie?H(null):j!==null?H(j):W(B,O,H,U)}))!==b&&(ie=!0,!K.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else W(B,O,H,U)}else H(null)}var A={},k={};h.j={get:function(B,O){var H=Object.prototype.hasOwnProperty.call(k,B)?k[B]:b;H?H.Gd?h.u.G(function(){O(H.definition)}):h.na.zb(function(){O(H.definition)}):G(B,O)},Bc:function(B){delete k[B]},oc:W},h.j.loaders=[],h.b("components",h.j),h.b("components.get",h.j.get),h.b("components.clearCachedDefinition",h.j.Bc)}(),function(){function b(H,U,K,Q){function ie(){--$===0&&Q(j)}var j={},$=2,ne=K.template;K=K.viewModel,ne?A(U,ne,function(be){h.j.oc("loadTemplate",[H,be],function(Ce){j.template=Ce,ie()})}):ie(),K?A(U,K,function(be){h.j.oc("loadViewModel",[H,be],function(Ce){j[O]=Ce,ie()})}):ie()}function G(H,U,K){if(typeof U=="function")K(function(ie){return new U(ie)});else if(typeof U[O]=="function")K(U[O]);else if("instance"in U){var Q=U.instance;K(function(){return Q})}else"viewModel"in U?G(H,U.viewModel,K):H("Unknown viewModel value: "+U)}function X(H){switch(h.a.R(H)){case"script":return h.a.ua(H.text);case"textarea":return h.a.ua(H.value);case"template":if(W(H.content))return h.a.Ca(H.content.childNodes)}return h.a.Ca(H.childNodes)}function W(H){return t.DocumentFragment?H instanceof DocumentFragment:H&&H.nodeType===11}function A(H,U,K){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(Q){Q&&typeof Q=="object"&&Q.Xd&&Q.default&&(Q=Q.default),K(Q)}):H("Uses require, but no AMD loader is present"):K(U)}function k(H){return function(U){throw Error("Component '"+H+"': "+U)}}var B={};h.j.register=function(H,U){if(!U)throw Error("Invalid configuration for "+H);if(h.j.tb(H))throw Error("Component "+H+" is already registered");B[H]=U},h.j.tb=function(H){return Object.prototype.hasOwnProperty.call(B,H)},h.j.unregister=function(H){delete B[H],h.j.Bc(H)},h.j.Fc={getConfig:function(H,U){U(h.j.tb(H)?B[H]:null)},loadComponent:function(H,U,K){var Q=k(H);A(Q,U,function(ie){b(H,Q,ie,K)})},loadTemplate:function(H,U,K){if(H=k(H),typeof U=="string")K(h.a.ua(U));else if(U instanceof Array)K(U);else if(W(U))K(h.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)K(X(U));else if(typeof U=="string"){var Q=n.getElementById(U);Q?K(X(Q)):H("Cannot find element with ID "+U)}else H("Unknown element type: "+U);else H("Unknown template value: "+U)},loadViewModel:function(H,U,K){G(k(H),U,K)}};var O="createViewModel";h.b("components.register",h.j.register),h.b("components.isRegistered",h.j.tb),h.b("components.unregister",h.j.unregister),h.b("components.defaultLoader",h.j.Fc),h.j.loaders.push(h.j.Fc),h.j.dd=B}(),function(){function b(X,W){var A=X.getAttribute("params");if(A){var A=G.parseBindingsString(A,W,X,{valueAccessors:!0,bindingParams:!0}),A=h.a.Ga(A,function(O){return h.o(O,null,{l:X})}),k=h.a.Ga(A,function(O){var H=O.v();return O.ja()?h.o({read:function(){return h.a.f(O())},write:h.Za(H)&&function(U){O()(U)},l:X}):H});return Object.prototype.hasOwnProperty.call(k,"$raw")||(k.$raw=A),k}return{$raw:{}}}h.j.getComponentNameForNode=function(X){var W=h.a.R(X);if(h.j.tb(W)&&(W.indexOf("-")!=-1||""+X=="[object HTMLUnknownElement]"||8>=h.a.W&&X.tagName===W))return W},h.j.tc=function(X,W,A,k){if(W.nodeType===1){var B=h.j.getComponentNameForNode(W);if(B){if(X=X||{},X.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var O={name:B,params:b(W,A)};X.component=k?function(){return O}:O}}return X};var G=new h.ga;9>h.a.W&&(h.j.register=function(X){return function(W){return X.apply(this,arguments)}}(h.j.register),n.createDocumentFragment=function(X){return function(){var W=X(),A=h.j.dd,k;for(k in A);return W}}(n.createDocumentFragment))}(),function(){function b(W,A,k){if(A=A.template,!A)throw Error("Component '"+W+"' has no template");W=h.a.Ca(A),h.h.va(k,W)}function G(W,A,k){var B=W.createViewModel;return B?B.call(W,A,k):A}var X=0;h.c.component={init:function(W,A,k,B,O){function H(){var j=U&&U.dispose;typeof j=="function"&&j.call(U),Q&&Q.s(),K=U=Q=null}var U,K,Q,ie=h.a.la(h.h.childNodes(W));return h.h.Ea(W),h.a.K.za(W,H),h.o(function(){var j=h.a.f(A()),$,ne;if(typeof j=="string"?$=j:($=h.a.f(j.name),ne=h.a.f(j.params)),!$)throw Error("No component name specified");var be=h.i.Cb(W,O),Ce=K=++X;h.j.get($,function(me){if(K===Ce){if(H(),!me)throw Error("Unknown component '"+$+"'");b($,me,W);var _e=G(me,ne,{element:W,templateNodes:ie});me=be.createChildContext(_e,{extend:function(Ve){Ve.$component=_e,Ve.$componentTemplateNodes=ie}}),_e&&_e.koDescendantsComplete&&(Q=h.i.subscribe(W,h.i.pa,_e.koDescendantsComplete,_e)),U=_e,h.Oa(me,W)}})},null,{l:W}),{controlsDescendantBindings:!0}}},h.h.ea.component=!0}();var F={class:"className",for:"htmlFor"};h.c.attr={update:function(b,G){var X=h.a.f(G())||{};h.a.P(X,function(W,A){A=h.a.f(A);var k=W.indexOf(":"),k="lookupNamespaceURI"in b&&0<k&&b.lookupNamespaceURI(W.substr(0,k)),B=A===!1||A===null||A===e;B?k?b.removeAttributeNS(k,W):b.removeAttribute(W):A=A.toString(),8>=h.a.W&&W in F?(W=F[W],B?b.removeAttribute(W):b[W]=A):B||(k?b.setAttributeNS(k,W,A):b.setAttribute(W,A)),W==="name"&&h.a.Yc(b,B?"":A)})}},function(){h.c.checked={after:["value","attr"],init:function(b,G,X){function W(){var j=b.checked,$=k();if(!h.S.Ya()&&(j||!O&&!h.S.qa())){var ne=h.u.G(G);if(U){var be=K?ne.v():ne,Ce=ie;ie=$,Ce!==$?j&&(h.a.Na(be,$,!0),h.a.Na(be,Ce,!1)):h.a.Na(be,$,j),K&&h.Za(ne)&&ne(be)}else B&&($===e?$=j:j||($=e)),h.m.eb(ne,X,"checked",$,!0)}}function A(){var j=h.a.f(G()),$=k();U?(b.checked=0<=h.a.A(j,$),ie=$):b.checked=B&&$===e?!!j:k()===j}var k=h.xb(function(){if(X.has("checkedValue"))return h.a.f(X.get("checkedValue"));if(Q)return X.has("value")?h.a.f(X.get("value")):b.value}),B=b.type=="checkbox",O=b.type=="radio";if(B||O){var H=G(),U=B&&h.a.f(H)instanceof Array,K=!(U&&H.push&&H.splice),Q=O||U,ie=U?k():e;O&&!b.name&&h.c.uniqueName.init(b,function(){return!0}),h.o(W,null,{l:b}),h.a.B(b,"click",W),h.o(A,null,{l:b}),H=e}}},h.m.wa.checked=!0,h.c.checkedValue={update:function(b,G){b.value=h.a.f(G())}}}(),h.c.class={update:function(b,G){var X=h.a.Db(h.a.f(G()));h.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=X,h.a.Eb(b,X,!0)}},h.c.css={update:function(b,G){var X=h.a.f(G());X!==null&&typeof X=="object"?h.a.P(X,function(W,A){A=h.a.f(A),h.a.Eb(b,W,A)}):h.c.class.update(b,G)}},h.c.enable={update:function(b,G){var X=h.a.f(G());X&&b.disabled?b.removeAttribute("disabled"):X||b.disabled||(b.disabled=!0)}},h.c.disable={update:function(b,G){h.c.enable.update(b,function(){return!h.a.f(G())})}},h.c.event={init:function(b,G,X,W,A){var k=G()||{};h.a.P(k,function(B){typeof B=="string"&&h.a.B(b,B,function(O){var H,U=G()[B];if(U){try{var K=h.a.la(arguments);W=A.$data,K.unshift(W),H=U.apply(W,K)}finally{H!==!0&&(O.preventDefault?O.preventDefault():O.returnValue=!1)}X.get(B+"Bubble")===!1&&(O.cancelBubble=!0,O.stopPropagation&&O.stopPropagation())}})})}},h.c.foreach={Rc:function(b){return function(){var G=b(),X=h.a.bc(G);return!X||typeof X.length=="number"?{foreach:G,templateEngine:h.ba.Ma}:(h.a.f(G),{foreach:X.data,as:X.as,noChildContext:X.noChildContext,includeDestroyed:X.includeDestroyed,afterAdd:X.afterAdd,beforeRemove:X.beforeRemove,afterRender:X.afterRender,beforeMove:X.beforeMove,afterMove:X.afterMove,templateEngine:h.ba.Ma})}},init:function(b,G){return h.c.template.init(b,h.c.foreach.Rc(G))},update:function(b,G,X,W,A){return h.c.template.update(b,h.c.foreach.Rc(G),X,W,A)}},h.m.Ra.foreach=!1,h.h.ea.foreach=!0,h.c.hasfocus={init:function(b,G,X){function W(B){b.__ko_hasfocusUpdating=!0;var O=b.ownerDocument;if("activeElement"in O){var H;try{H=O.activeElement}catch{H=O.body}B=H===b}O=G(),h.m.eb(O,X,"hasfocus",B,!0),b.__ko_hasfocusLastValue=B,b.__ko_hasfocusUpdating=!1}var A=W.bind(null,!0),k=W.bind(null,!1);h.a.B(b,"focus",A),h.a.B(b,"focusin",A),h.a.B(b,"blur",k),h.a.B(b,"focusout",k),b.__ko_hasfocusLastValue=!1},update:function(b,G){var X=!!h.a.f(G());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===X||(X?b.focus():b.blur(),!X&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),h.u.G(h.a.Fb,null,[b,X?"focusin":"focusout"]))}},h.m.wa.hasfocus=!0,h.c.hasFocus=h.c.hasfocus,h.m.wa.hasFocus="hasfocus",h.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,G){h.a.fc(b,G())}},function(){function b(G,X,W){h.c[G]={init:function(A,k,B,O,H){var U,K,Q={},ie,j,$;if(X){O=B.get("as");var ne=B.get("noChildContext");$=!(O&&ne),Q={as:O,noChildContext:ne,exportDependencies:$}}return j=(ie=B.get("completeOn")=="render")||B.has(h.i.pa),h.o(function(){var be=h.a.f(k()),Ce=!W!=!be,me=!K,_e;($||Ce!==U)&&(j&&(H=h.i.Cb(A,H)),Ce&&((!X||$)&&(Q.dataDependency=h.S.o()),_e=X?H.createChildContext(typeof be=="function"?be:k,Q):h.S.qa()?H.extend(null,Q):H),me&&h.S.qa()&&(K=h.a.Ca(h.h.childNodes(A),!0)),Ce?(me||h.h.va(A,h.a.Ca(K)),h.Oa(_e,A)):(h.h.Ea(A),ie||h.i.ma(A,h.i.H)),U=Ce)},null,{l:A}),{controlsDescendantBindings:!0}}},h.m.Ra[G]=!1,h.h.ea[G]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),h.c.let={init:function(b,G,X,W,A){return G=A.extend(G),h.Oa(G,b),{controlsDescendantBindings:!0}}},h.h.ea.let=!0;var N={};h.c.options={init:function(b){if(h.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,G,X){function W(){return h.a.jb(b.options,function(ne){return ne.selected})}function A(ne,be,Ce){var me=typeof be;return me=="function"?be(ne):me=="string"?ne[be]:Ce}function k(ne,be){if(j&&U)h.i.ma(b,h.i.H);else if(ie.length){var Ce=0<=h.a.A(ie,h.w.M(be[0]));h.a.Zc(be[0],Ce),j&&!Ce&&h.u.G(h.a.Fb,null,[b,"change"])}}var B=b.multiple,O=b.length!=0&&B?b.scrollTop:null,H=h.a.f(G()),U=X.get("valueAllowUnset")&&X.has("value"),K=X.get("optionsIncludeDestroyed");G={};var Q,ie=[];U||(B?ie=h.a.Mb(W(),h.w.M):0<=b.selectedIndex&&ie.push(h.w.M(b.options[b.selectedIndex]))),H&&(typeof H.length>"u"&&(H=[H]),Q=h.a.jb(H,function(ne){return K||ne===e||ne===null||!h.a.f(ne._destroy)}),X.has("optionsCaption")&&(H=h.a.f(X.get("optionsCaption")),H!==null&&H!==e&&Q.unshift(N)));var j=!1;if(G.beforeRemove=function(ne){b.removeChild(ne)},H=k,X.has("optionsAfterRender")&&typeof X.get("optionsAfterRender")=="function"&&(H=function(ne,be){k(0,be),h.u.G(X.get("optionsAfterRender"),null,[be[0],ne!==N?ne:e])}),h.a.ec(b,Q,function(ne,be,Ce){return Ce.length&&(ie=!U&&Ce[0].selected?[h.w.M(Ce[0])]:[],j=!0),be=b.ownerDocument.createElement("option"),ne===N?(h.a.Bb(be,X.get("optionsCaption")),h.w.cb(be,e)):(Ce=A(ne,X.get("optionsValue"),ne),h.w.cb(be,h.a.f(Ce)),ne=A(ne,X.get("optionsText"),Ce),h.a.Bb(be,ne)),[be]},G,H),!U){var $;B?$=ie.length&&W().length<ie.length:$=ie.length&&0<=b.selectedIndex?h.w.M(b.options[b.selectedIndex])!==ie[0]:ie.length||0<=b.selectedIndex,$&&h.u.G(h.a.Fb,null,[b,"change"])}(U||h.S.Ya())&&h.i.ma(b,h.i.H),h.a.wd(b),O&&20<Math.abs(O-b.scrollTop)&&(b.scrollTop=O)}},h.c.options.$b=h.a.g.Z(),h.c.selectedOptions={init:function(b,G,X){function W(){var B=G(),O=[];h.a.D(b.getElementsByTagName("option"),function(H){H.selected&&O.push(h.w.M(H))}),h.m.eb(B,X,"selectedOptions",O)}function A(){var B=h.a.f(G()),O=b.scrollTop;B&&typeof B.length=="number"&&h.a.D(b.getElementsByTagName("option"),function(H){var U=0<=h.a.A(B,h.w.M(H));H.selected!=U&&h.a.Zc(H,U)}),b.scrollTop=O}if(h.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var k;h.i.subscribe(b,h.i.H,function(){k?W():(h.a.B(b,"change",W),k=h.o(A,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},h.m.wa.selectedOptions=!0,h.c.style={update:function(b,G){var X=h.a.f(G()||{});h.a.P(X,function(W,A){if(A=h.a.f(A),(A===null||A===e||A===!1)&&(A=""),o)o(b).css(W,A);else if(/^--/.test(W))b.style.setProperty(W,A);else{W=W.replace(/-(\w)/g,function(B,O){return O.toUpperCase()});var k=b.style[W];b.style[W]=A,A===k||b.style[W]!=k||isNaN(A)||(b.style[W]=A+"px")}})}},h.c.submit={init:function(b,G,X,W,A){if(typeof G()!="function")throw Error("The value for a submit binding must be a function");h.a.B(b,"submit",function(k){var B,O=G();try{B=O.call(A.$data,b)}finally{B!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}})}},h.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,G){h.a.Bb(b,G())}},h.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(Q){if(Q)return parseFloat(Q[1])},G=t.navigator.userAgent,X,W,A,k,B;(X=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(B=b(G.match(/Edge\/([^ ]+)$/)))||b(G.match(/Chrome\/([^ ]+)/))||(W=b(G.match(/Version\/([^ ]+) Safari/)))||(A=b(G.match(/Firefox\/([^ ]+)/)))||(k=h.a.W||b(G.match(/MSIE ([^ ]+)/)))||(k=b(G.match(/rv:([^ )]+)/)))}if(8<=k&&10>k)var O=h.a.g.Z(),H=h.a.g.Z(),U=function(Q){var ie=this.activeElement;(ie=ie&&h.a.g.get(ie,H))&&ie(Q)},K=function(Q,ie){var j=Q.ownerDocument;h.a.g.get(j,O)||(h.a.g.set(j,O,!0),h.a.B(j,"selectionchange",U)),h.a.g.set(Q,H,ie)};h.c.textInput={init:function(Q,ie,j){function $(De,Ke){h.a.B(Q,De,Ke)}function ne(){var De=h.a.f(ie());(De===null||De===e)&&(De=""),Ve!==e&&De===Ve?h.a.setTimeout(ne,4):Q.value!==De&&(Ze=!0,Q.value=De,Ze=!1,me=Q.value)}function be(){_e||(Ve=Q.value,_e=h.a.setTimeout(Ce,4))}function Ce(){clearTimeout(_e),Ve=_e=e;var De=Q.value;me!==De&&(me=De,h.m.eb(ie(),j,"textInput",De))}var me=Q.value,_e,Ve,Ie=h.a.W==9?be:Ce,Ze=!1;k&&$("keypress",Ce),11>k&&$("propertychange",function(De){Ze||De.propertyName!=="value"||Ie(De)}),k==8&&($("keyup",Ce),$("keydown",Ce)),K&&(K(Q,Ie),$("dragend",be)),(!k||9<=k)&&$("input",Ie),5>W&&h.a.R(Q)==="textarea"?($("keydown",be),$("paste",be),$("cut",be)):11>X?$("keydown",be):4>A?($("DOMAutoComplete",Ce),$("dragdrop",Ce),$("drop",Ce)):B&&Q.type==="number"&&$("keydown",be),$("change",Ce),$("blur",Ce),h.o(ne,null,{l:Q})}},h.m.wa.textInput=!0,h.c.textinput={preprocess:function(Q,ie,j){j("textInput",Q)}}}(),h.c.uniqueName={init:function(b,G){if(G()){var X="ko_unique_"+ ++h.c.uniqueName.rd;h.a.Yc(b,X)}}},h.c.uniqueName.rd=0,h.c.using={init:function(b,G,X,W,A){var k;return X.has("as")&&(k={as:X.get("as"),noChildContext:X.get("noChildContext")}),G=A.createChildContext(G,k),h.Oa(G,b),{controlsDescendantBindings:!0}}},h.h.ea.using=!0,h.c.value={init:function(b,G,X){var W=h.a.R(b),A=W=="input";if(!A||b.type!="checkbox"&&b.type!="radio"){var k=[],B=X.get("valueUpdate"),O=!1,H=null;B&&(typeof B=="string"?k=[B]:k=h.a.wc(B),h.a.Pa(k,"change"));var U=function(){H=null,O=!1;var ie=G(),j=h.w.M(b);h.m.eb(ie,X,"value",j)};!h.a.W||!A||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||h.a.A(k,"propertychange")!=-1||(h.a.B(b,"propertychange",function(){O=!0}),h.a.B(b,"focus",function(){O=!1}),h.a.B(b,"blur",function(){O&&U()})),h.a.D(k,function(ie){var j=U;h.a.Ud(ie,"after")&&(j=function(){H=h.w.M(b),h.a.setTimeout(U,0)},ie=ie.substring(5)),h.a.B(b,ie,j)});var K;if(K=A&&b.type=="file"?function(){var ie=h.a.f(G());ie===null||ie===e||ie===""?b.value="":h.u.G(U)}:function(){var ie=h.a.f(G()),j=h.w.M(b);H!==null&&ie===H?h.a.setTimeout(K,0):(ie!==j||j===e)&&(W==="select"?(j=X.get("valueAllowUnset"),h.w.cb(b,ie,j),j||ie===h.w.M(b)||h.u.G(U)):h.w.cb(b,ie))},W==="select"){var Q;h.i.subscribe(b,h.i.H,function(){Q?X.get("valueAllowUnset")?K():U():(h.a.B(b,"change",U),Q=h.o(K,null,{l:b}))},null,{notifyImmediately:!0})}else h.a.B(b,"change",U),h.o(K,null,{l:b})}else h.ib(b,{checkedValue:G})},update:function(){}},h.m.wa.value=!0,h.c.visible={update:function(b,G){var X=h.a.f(G()),W=b.style.display!="none";X&&!W?b.style.display="":!X&&W&&(b.style.display="none")}},h.c.hidden={update:function(b,G){h.c.visible.update(b,function(){return!h.a.f(G())})}},function(b){h.c[b]={init:function(G,X,W,A,k){return h.c.event.init.call(this,G,function(){var B={};return B[b]=X(),B},W,A,k)}}}("click"),h.ca=function(){},h.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},h.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},h.ca.prototype.makeTemplateSource=function(b,G){if(typeof b=="string"){G=G||n;var X=G.getElementById(b);if(!X)throw Error("Cannot find template with ID "+b);return new h.C.F(X)}if(b.nodeType==1||b.nodeType==8)return new h.C.ia(b);throw Error("Unknown template type: "+b)},h.ca.prototype.renderTemplate=function(b,G,X,W){return b=this.makeTemplateSource(b,W),this.renderTemplateSource(b,G,X,W)},h.ca.prototype.isTemplateRewritten=function(b,G){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,G).data("isRewritten")},h.ca.prototype.rewriteTemplate=function(b,G,X){b=this.makeTemplateSource(b,X),G=G(b.text()),b.text(G),b.data("isRewritten",!0)},h.b("templateEngine",h.ca),h.kc=function(){function b(W,A,k,B){W=h.m.ac(W);for(var O=h.m.Ra,H=0;H<W.length;H++){var U=W[H].key;if(Object.prototype.hasOwnProperty.call(O,U)){var K=O[U];if(typeof K=="function"){if(U=K(W[H].value))throw Error(U)}else if(!K)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return k="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+h.m.vb(W,{valueAccessors:!0})+" } })()},'"+k.toLowerCase()+"')",B.createJavaScriptEvaluatorBlock(k)+A}var G=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,X=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(W,A,k){A.isTemplateRewritten(W,k)||A.rewriteTemplate(W,function(B){return h.kc.Ld(B,A)},k)},Ld:function(W,A){return W.replace(G,function(k,B,O,H,U){return b(U,B,O,A)}).replace(X,function(k,B){return b(B,"<!-- ko -->","#comment",A)})},md:function(W,A){return h.aa.Xb(function(k,B){var O=k.nextSibling;O&&O.nodeName.toLowerCase()===A&&h.ib(O,W,B)})}}}(),h.b("__tr_ambtns",h.kc.md),function(){h.C={},h.C.F=function(X){if(this.F=X){var W=h.a.R(X);this.ab=W==="script"?1:W==="textarea"?2:W=="template"&&X.content&&X.content.nodeType===11?3:4}},h.C.F.prototype.text=function(){var X=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[X];var W=arguments[0];X==="innerHTML"?h.a.fc(this.F,W):this.F[X]=W};var b=h.a.g.Z()+"_";h.C.F.prototype.data=function(X){if(arguments.length===1)return h.a.g.get(this.F,b+X);h.a.g.set(this.F,b+X,arguments[1])};var G=h.a.g.Z();h.C.F.prototype.nodes=function(){var X=this.F;if(arguments.length==0){var W=h.a.g.get(X,G)||{},A=W.lb||(this.ab===3?X.content:this.ab===4?X:e);if(!A||W.jd){var k=this.text();k&&k!==W.bb&&(A=h.a.Md(k,X.ownerDocument),h.a.g.set(X,G,{lb:A,bb:k,jd:!0}))}return A}W=arguments[0],this.ab!==e&&this.text(""),h.a.g.set(X,G,{lb:W})},h.C.ia=function(X){this.F=X},h.C.ia.prototype=new h.C.F,h.C.ia.prototype.constructor=h.C.ia,h.C.ia.prototype.text=function(){if(arguments.length==0){var X=h.a.g.get(this.F,G)||{};return X.bb===e&&X.lb&&(X.bb=X.lb.innerHTML),X.bb}h.a.g.set(this.F,G,{bb:arguments[0]})},h.b("templateSources",h.C),h.b("templateSources.domElement",h.C.F),h.b("templateSources.anonymousTemplate",h.C.ia)}(),function(){function b(H,U,K){var Q;for(U=h.h.nextSibling(U);H&&(Q=H)!==U;)H=h.h.nextSibling(Q),K(Q,H)}function G(H,U){if(H.length){var K=H[0],Q=H[H.length-1],ie=K.parentNode,j=h.ga.instance,$=j.preprocessNode;if($){if(b(K,Q,function(ne,be){var Ce=ne.previousSibling,me=$.call(j,ne);me&&(ne===K&&(K=me[0]||be),ne===Q&&(Q=me[me.length-1]||Ce))}),H.length=0,!K)return;K===Q?H.push(K):(H.push(K,Q),h.a.Ua(H,ie))}b(K,Q,function(ne){ne.nodeType!==1&&ne.nodeType!==8||h.vc(U,ne)}),b(K,Q,function(ne){ne.nodeType!==1&&ne.nodeType!==8||h.aa.cd(ne,[U])}),h.a.Ua(H,ie)}}function X(H){return H.nodeType?H:0<H.length?H[0]:null}function W(H,U,K,Q,ie){ie=ie||{};var j=(H&&X(H)||K||{}).ownerDocument,$=ie.templateEngine||k;if(h.kc.xd(K,$,j),K=$.renderTemplate(K,Q,ie,j),typeof K.length!="number"||0<K.length&&typeof K[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(j=!1,U){case"replaceChildren":h.h.va(H,K),j=!0;break;case"replaceNode":h.a.Xc(H,K),j=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return j&&(G(K,Q),ie.afterRender&&h.u.G(ie.afterRender,null,[K,Q[ie.as||"$data"]]),U=="replaceChildren"&&h.i.ma(H,h.i.H)),K}function A(H,U,K){return h.O(H)?H():typeof H=="function"?H(U,K):H}var k;h.gc=function(H){if(H!=e&&!(H instanceof h.ca))throw Error("templateEngine must inherit from ko.templateEngine");k=H},h.dc=function(H,U,K,Q,ie){if(K=K||{},(K.templateEngine||k)==e)throw Error("Set a template engine before calling renderTemplate");if(ie=ie||"replaceChildren",Q){var j=X(Q);return h.$(function(){var ne=U&&U instanceof h.fa?U:new h.fa(U,null,null,null,{exportDependencies:!0}),$=A(H,ne.$data,ne),ne=W(Q,ie,$,ne,K);ie=="replaceNode"&&(Q=ne,j=X(Q))},null,{Sa:function(){return!j||!h.a.Sb(j)},l:j&&ie=="replaceNode"?j.parentNode:j})}return h.aa.Xb(function($){h.dc(H,U,K,$,"replaceNode")})},h.Qd=function(H,U,K,Q,ie){function j(Ve,Ie){h.u.G(h.a.ec,null,[Q,Ve,ne,K,$,Ie]),h.i.ma(Q,h.i.H)}function $(Ve,Ie){G(Ie,be),K.afterRender&&K.afterRender(Ie,Ve),be=null}function ne(Ve,Ie){be=ie.createChildContext(Ve,{as:Ce,noChildContext:K.noChildContext,extend:function(De){De.$index=Ie,Ce&&(De[Ce+"Index"]=Ie)}});var Ze=A(H,Ve,be);return W(Q,"ignoreTargetNode",Ze,be,K)}var be,Ce=K.as,me=K.includeDestroyed===!1||h.options.foreachHidesDestroyed&&!K.includeDestroyed;if(me||K.beforeRemove||!h.Pc(U))return h.$(function(){var Ve=h.a.f(U)||[];typeof Ve.length>"u"&&(Ve=[Ve]),me&&(Ve=h.a.jb(Ve,function(Ie){return Ie===e||Ie===null||!h.a.f(Ie._destroy)})),j(Ve)},null,{l:Q});j(U.v());var _e=U.subscribe(function(Ve){j(U(),Ve)},null,"arrayChange");return _e.l(Q),_e};var B=h.a.g.Z(),O=h.a.g.Z();h.c.template={init:function(H,U){var K=h.a.f(U());if(typeof K=="string"||"name"in K)h.h.Ea(H);else if("nodes"in K){if(K=K.nodes||[],h.O(K))throw Error('The "nodes" option must be a plain, non-observable array.');var Q=K[0]&&K[0].parentNode;Q&&h.a.g.get(Q,O)||(Q=h.a.Yb(K),h.a.g.set(Q,O,!0)),new h.C.ia(H).nodes(Q)}else if(K=h.h.childNodes(H),0<K.length)Q=h.a.Yb(K),new h.C.ia(H).nodes(Q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(H,U,K,Q,ie){var j=U();U=h.a.f(j),K=!0,Q=null,typeof U=="string"?U={}:(j="name"in U?U.name:H,"if"in U&&(K=h.a.f(U.if)),K&&"ifnot"in U&&(K=!h.a.f(U.ifnot)),K&&!j&&(K=!1)),"foreach"in U?Q=h.Qd(j,K&&U.foreach||[],U,H,ie):K?(K=ie,"data"in U&&(K=ie.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),Q=h.dc(j,K,U,H)):h.h.Ea(H),ie=Q,(U=h.a.g.get(H,B))&&typeof U.s=="function"&&U.s(),h.a.g.set(H,B,!ie||ie.ja&&!ie.ja()?e:ie)}},h.m.Ra.template=function(H){return H=h.m.ac(H),H.length==1&&H[0].unknown||h.m.Id(H,"name")?null:"This template engine does not support anonymous templates nested within its templates"},h.h.ea.template=!0}(),h.b("setTemplateEngine",h.gc),h.b("renderTemplate",h.dc),h.a.Kc=function(b,G,X){if(b.length&&G.length){var W,A,k,B,O;for(W=A=0;(!X||W<X)&&(B=b[A]);++A){for(k=0;O=G[k];++k)if(B.value===O.value){B.moved=O.index,O.moved=B.index,G.splice(k,1),W=k=0;break}W+=k}}},h.a.Pb=function(){function b(G,X,W,A,k){var B=Math.min,O=Math.max,H=[],U,K=G.length,Q,ie=X.length,j=ie-K||1,$=K+ie+1,ne,be,Ce;for(U=0;U<=K;U++)for(be=ne,H.push(ne=[]),Ce=B(ie,U+j),Q=O(0,U-1);Q<=Ce;Q++)ne[Q]=Q?U?G[U-1]===X[Q-1]?be[Q-1]:B(be[Q]||$,ne[Q-1]||$)+1:Q+1:U+1;for(B=[],O=[],j=[],U=K,Q=ie;U||Q;)ie=H[U][Q]-1,Q&&ie===H[U][Q-1]?O.push(B[B.length]={status:W,value:X[--Q],index:Q}):U&&ie===H[U-1][Q]?j.push(B[B.length]={status:A,value:G[--U],index:U}):(--Q,--U,k.sparse||B.push({status:"retained",value:X[Q]}));return h.a.Kc(j,O,!k.dontLimitMoves&&10*K),B.reverse()}return function(G,X,W){return W=typeof W=="boolean"?{dontLimitMoves:W}:W||{},G=G||[],X=X||[],G.length<X.length?b(G,X,"added","deleted",W):b(X,G,"deleted","added",W)}}(),h.b("utils.compareArrays",h.a.Pb),function(){function b(W,A,k,B,O){var H=[],U=h.$(function(){var K=A(k,O,h.a.Ua(H,W))||[];0<H.length&&(h.a.Xc(H,K),B&&h.u.G(B,null,[k,K,O])),H.length=0,h.a.Nb(H,K)},null,{l:W,Sa:function(){return!h.a.kd(H)}});return{Y:H,$:U.ja()?U:e}}var G=h.a.g.Z(),X=h.a.g.Z();h.a.ec=function(W,A,k,B,O,H){function U(Lt){Ze={Aa:Lt,pb:h.ta(be++)},$.push(Ze),j||Ie.push(Ze)}function K(Lt){Ze=ie[Lt],be!==Ze.pb.v()&&Ve.push(Ze),Ze.pb(be++),h.a.Ua(Ze.Y,W),$.push(Ze)}function Q(Lt,Vi){if(Lt)for(var ln=0,ge=Vi.length;ln<ge;ln++)h.a.D(Vi[ln].Y,function(Le){Lt(Le,ln,Vi[ln].Aa)})}A=A||[],typeof A.length>"u"&&(A=[A]),B=B||{};var ie=h.a.g.get(W,G),j=!ie,$=[],ne=0,be=0,Ce=[],me=[],_e=[],Ve=[],Ie=[],Ze,De=0;if(j)h.a.D(A,U);else{if(!H||ie&&ie._countWaitingForRemove){var Ke=h.a.Mb(ie,function(Lt){return Lt.Aa});H=h.a.Pb(Ke,A,{dontLimitMoves:B.dontLimitMoves,sparse:!0})}for(var Ke=0,rt,Xt,Ht;rt=H[Ke];Ke++)switch(Xt=rt.moved,Ht=rt.index,rt.status){case"deleted":for(;ne<Ht;)K(ne++);Xt===e&&(Ze=ie[ne],Ze.$&&(Ze.$.s(),Ze.$=e),h.a.Ua(Ze.Y,W).length&&(B.beforeRemove&&($.push(Ze),De++,Ze.Aa===X?Ze=null:_e.push(Ze)),Ze&&Ce.push.apply(Ce,Ze.Y))),ne++;break;case"added":for(;be<Ht;)K(ne++);Xt!==e?(me.push($.length),K(Xt)):U(rt.value)}for(;be<A.length;)K(ne++);$._countWaitingForRemove=De}h.a.g.set(W,G,$),Q(B.beforeMove,Ve),h.a.D(Ce,B.beforeRemove?h.oa:h.removeNode);var qe,mn,Dt;try{Dt=W.ownerDocument.activeElement}catch{}if(me.length)for(;(Ke=me.shift())!=e;){for(Ze=$[Ke],qe=e;Ke;)if((mn=$[--Ke].Y)&&mn.length){qe=mn[mn.length-1];break}for(A=0;ne=Ze.Y[A];qe=ne,A++)h.h.Wb(W,ne,qe)}for(Ke=0;Ze=$[Ke];Ke++){for(Ze.Y||h.a.extend(Ze,b(W,k,Ze.Aa,O,Ze.pb)),A=0;ne=Ze.Y[A];qe=ne,A++)h.h.Wb(W,ne,qe);!Ze.Ed&&O&&(O(Ze.Aa,Ze.Y,Ze.pb),Ze.Ed=!0,qe=Ze.Y[Ze.Y.length-1])}for(Dt&&W.ownerDocument.activeElement!=Dt&&Dt.focus(),Q(B.beforeRemove,_e),Ke=0;Ke<_e.length;++Ke)_e[Ke].Aa=X;Q(B.afterMove,Ve),Q(B.afterAdd,Ie)}}(),h.b("utils.setDomNodeChildrenFromArrayMapping",h.a.ec),h.ba=function(){this.allowTemplateRewriting=!1},h.ba.prototype=new h.ca,h.ba.prototype.constructor=h.ba,h.ba.prototype.renderTemplateSource=function(b,G,X,W){return(G=!(9>h.a.W)&&b.nodes?b.nodes():null)?h.a.la(G.cloneNode(!0).childNodes):(b=b.text(),h.a.ua(b,W))},h.ba.Ma=new h.ba,h.gc(h.ba.Ma),h.b("nativeTemplateEngine",h.ba),function(){h.$a=function(){var G=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(X,W,A,k){if(k=k||n,A=A||{},2>G)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var B=X.data("precompiled");return B||(B=X.text()||"",B=o.template(null,"{{ko_with $item.koBindingContext}}"+B+"{{/ko_with}}"),X.data("precompiled",B)),X=[W.$data],W=o.extend({koBindingContext:W},A.templateOptions),W=o.tmpl(B,X,W),W.appendTo(k.createElement("div")),o.fragments={},W},this.createJavaScriptEvaluatorBlock=function(X){return"{{ko_code ((function() { return "+X+" })()) }}"},this.addTemplate=function(X,W){n.write("<script type='text/html' id='"+X+"'>"+W+"<\/script>")},0<G&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},h.$a.prototype=new h.ca,h.$a.prototype.constructor=h.$a;var b=new h.$a;0<b.Hd&&h.gc(b),h.b("jqueryTmplTemplateEngine",h.$a)}()})})()})()})();var f1t=ko;typeof window<"u"?(ko=window.ko,typeof lM<"u"?window.ko=lM:delete window.ko):(ko=global.ko,typeof lM<"u"?global.ko=lM:delete global.ko);var vS=f1t;var V2o=_(T(),1);/**
 * @license
 * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
 * Copyright (c) Steve Sanderson
 * MIT license
 */var Y6="__knockoutObservables",H6="__knockoutSubscribable";function LCe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=ZCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Y6||o===H6)&&!(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&&p1t(n,a)}}),e}function ZCe(e,t){var n=e[Y6];return!n&&t&&(n={},Object.defineProperty(e,Y6,{value:n})),n}function h1t(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),LCe.call(i,e,[t]),e}function p1t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=b1t(e,t,i))})}function b1t(e,t,n){var i=y1t(e,n);return i.subscribe(t)}function y1t(e,t){var n=t[H6];if(!n){n=new e.subscribable,Object.defineProperty(t,H6,{value:n});var i={};g1t(t,n,i),x1t(e,t,n,i)}return n}function g1t(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 x1t(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 RCe(e,t){if(!e)return null;var n=ZCe(e,!1);return n&&n[t]||null}function _1t(e,t){var n=RCe(e,t);n&&n.valueHasMutated()}function T1t(e){e.track=LCe,e.getObservable=RCe,e.valueHasMutated=_1t,e.defineProperty=h1t}var dM={attachToKo:T1t};var Z2o=_(T(),1),GCe="http://www.w3.org/2000/svg",ECe="cesium-svgPath-svg",S1t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(GCe,"svg:svg");i.setAttribute("class",ECe);let o=document.createElementNS(GCe,"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",`${ECe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},uM=S1t;dM.attachToKo(vS);uM.register(vS);var Se=vS;function mM(e){c(e)||(e=new _f),this._clock=e,this._eventHelper=new hr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(ee.now()),this.systemTime.equalityComparer=ee.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=ee.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=ee.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=ee.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Se.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Se.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Se.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Se.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Se.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Se.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(mM.prototype,{clock:{get:function(){return this._clock}}});mM.prototype.synchronize=function(){let e=this._clock;this.systemTime=ee.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};mM.prototype.isDestroyed=function(){return!1};mM.prototype.destroy=function(){this._eventHelper.removeAll(),he(this)};var fM=mM;var M2o=_(T(),1);function C1t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,L.throwInstantiationError()}var z6=C1t;var O2o=_(T(),1);function V1t(e,t){if(!c(e))throw new L("func is required.");t=t??!0;let n=new ye,i=new ye;function o(){if(!o.canExecute)throw new L("Cannot execute command, canExecute is false.");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,Se.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Rn=V1t;var Y2o=_(T(),1);var HL={};HL.createCheckbox=function(e,t,n){C.typeOf.string("labelText",e),C.typeOf.string("checkedBinding",t);let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return c(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};HL.createSection=function(e,t,n,i){C.defined("panel",e),C.typeOf.string("headerText",t),C.typeOf.string("sectionVisibleBinding",n),C.typeOf.string("toggleSectionVisibilityBinding",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};HL.createRangeInput=function(e,t,n,i,o,r){C.typeOf.string("rangeText",e),C.typeOf.string("sliderValueBinding",t),C.typeOf.number("min",n),C.typeOf.number("max",i),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 l=document.createElement("div");l.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(l),d};HL.createRangeInputWithDynamicMinMax=function(e,t,n,i){C.typeOf.string("rangeText",e),C.typeOf.string("sliderValueBinding",t),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};HL.createButton=function(e,t,n){C.typeOf.string("buttonText",e),C.typeOf.string("clickedBinding",t);let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return c(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var sd=HL;var K2o=_(T(),1);function L1t(e,t,n,i,o){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,o)}var Za=L1t;var q2o=_(T(),1);function XCe(e,t){if(!c(e))throw new L("command is required.");this._command=e,t=t??z.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Se.track(this,["toggled","tooltip"])}Object.defineProperties(XCe.prototype,{command:{get:function(){return this._command}}});var Qg=XCe;var nvo=_(T(),1);var FS="http://www.w3.org/2000/svg",wCe="http://www.w3.org/1999/xlink",VB,hM=Y.fromCssColorString("rgba(247,250,255,0.384)"),LB=Y.fromCssColorString("rgba(143,191,255,0.216)"),K6=Y.fromCssColorString("rgba(153,197,255,0.098)"),ZB=Y.fromCssColorString("rgba(255,255,255,0.086)"),Z1t=Y.fromCssColorString("rgba(255,255,255,0.267)"),R1t=Y.fromCssColorString("rgba(255,255,255,0)"),ICe=Y.fromCssColorString("rgba(66,67,68,0.3)"),WCe=Y.fromCssColorString("rgba(0,0,0,0.5)");function jg(e){return Y.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var pM={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 qf(e){let t=document.createElementNS(FS,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(qf(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(wCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function J6(e,t,n){let i=document.createElementNS(FS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(FS,"tspan");return o.textContent=n,i.appendChild(o),i}function G1t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var RB=new Y;function cs(e,t){let n=t.alpha,i=1-n;return RB.red=e.red*i+t.red*n,RB.green=e.green*i+t.green*n,RB.blue=e.blue*i+t.blue*n,RB.toCssColorString()}function Q6(e,t,n){let i=pM[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 qf(o)}function E1t(e,t,n){let i=pM[n],o=pM.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 qf(r)}function X1t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&VB!==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(),l,d;if(t.type==="touchstart"||t.type==="touchmove"?(l=t.touches[0].clientX,d=t.touches[0].clientY):(l=t.clientX,d=t.clientY),!i&&(l>a.right||l<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),f=l-o-a.left,p=d-r-a.top,y=Math.atan2(p,f)*180/Math.PI+90;y>180&&(y-=360);let h=n.shuttleRingAngle;i||l<u.right&&l>u.left&&d>u.top&&d<u.bottom?(VB=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=y):y<h?n.slower():y>h&&n.faster(),t.preventDefault()}else e===VB&&(VB=void 0),n.shuttleRingDragging=!1}function W0(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=[Za(t,"toggled",this.setToggled,this),Za(t,"tooltip",this.setTooltip,this),Za(t.command,"canExecute",this.setEnabled,this)]}W0.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();he(this)};W0.prototype.isDestroyed=function(){return!1};W0.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")}};W0.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")))};W0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function zL(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("viewModel is required.");e=Wn(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(FS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",wCe);let s=document.createElementNS(FS,"g");this._topG=s,this._realtimeSVG=new W0(E1t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new W0(Q6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new W0(Q6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new W0(Q6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(FS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let l=qf({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;let d=pM.animation_pathSwooshFX,u=pM.animation_pathPointer,f=qf({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=f,this._shuttleRingPointer=qf({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=qf({tagName:"g",transform:"translate(100,100)"});this._knobOuter=qf({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let y=61,h=qf({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:y});this._knobDate=J6(0,-24,""),this._knobTime=J6(0,-7,""),this._knobStatus=J6(0,-41,"");let g=qf({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:y}),x=document.createElementNS(FS,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(l),x.appendChild(f),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(h),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(g),r.appendChild(s),e.appendChild(r);let S=this;function V(v){X1t(S,v)}this._mouseCallback=V,l.addEventListener("mousedown",V,!0),l.addEventListener("touchstart",V,!0),f.addEventListener("mousedown",V,!0),f.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let Z=this._knobTime.childNodes[0],R=this._knobDate.childNodes[0],E=this._knobStatus.childNodes[0],I;this._subscriptions=[Za(t.pauseViewModel,"toggled",function(v){I!==v&&(I=v,I?S._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):S._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Za(t,"shuttleRingAngle",function(v){G1t(S._shuttleRingPointer,S._knobOuter,v)}),Za(t,"dateLabel",function(v){R.textContent!==v&&(R.textContent=v)}),Za(t,"timeLabel",function(v){Z.textContent!==v&&(Z.textContent=v)}),Za(t,"multiplierLabel",function(v){E.textContent!==v&&(E.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(zL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zL.prototype.isDestroyed=function(){return!1};zL.prototype.destroy=function(){c(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 he(this)};zL.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,l=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},${l})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t};zL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(c(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=jg(this._themeNormal),n=jg(this._themeHover),i=jg(this._themeSelect),o=jg(this._themeDisabled),r=jg(this._themeKnob),s=jg(this._themePointer),a=jg(this._themeSwoosh),l=jg(this._themeSwooshHover),d=qf({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(t,hM)},{tagName:"stop",offset:"12%","stop-color":cs(t,LB)},{tagName:"stop",offset:"46%","stop-color":cs(t,K6)},{tagName:"stop",offset:"81%","stop-color":cs(t,ZB)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(n,hM)},{tagName:"stop",offset:"12%","stop-color":cs(n,LB)},{tagName:"stop",offset:"46%","stop-color":cs(n,K6)},{tagName:"stop",offset:"81%","stop-color":cs(n,ZB)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(i,hM)},{tagName:"stop",offset:"12%","stop-color":cs(i,LB)},{tagName:"stop",offset:"46%","stop-color":cs(i,K6)},{tagName:"stop",offset:"81%","stop-color":cs(i,ZB)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":cs(o,Z1t)},{tagName:"stop",offset:"75%","stop-color":cs(o,R1t)}]},{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":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":cs(s,WCe)},{tagName:"stop",offset:"100%","stop-color":cs(s,WCe)}]},{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":cs(r,hM)},{tagName:"stop",offset:"60%","stop-color":cs(r,ICe)},{tagName:"stop",offset:"85%","stop-color":cs(r,LB)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":cs(r,ICe)},{tagName:"stop",offset:"60%","stop-color":cs(r,hM)},{tagName:"stop",offset:"85%","stop-color":cs(r,ZB)}]}]});c(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var bM=zL;var cvo=_(T(),1);var I1t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qg=15,KL=105;function PCe(e,t){return e-t}function j6(e,t){let n=Wo(t,e,PCe);return n<0?~n:n}function W1t(e,t){if(Math.abs(e)<=qg)return e/qg;let n=qg,i=KL,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 w1t(e,t,n){if(n.clockStep===fo.SYSTEM_CLOCK)return qg;if(Math.abs(e)<=1)return e*qg;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=qg,r=KL,s,a=0,l;return e>0?(s=Math.log(i),l=(s-a)/(r-o),(Math.log(e)-a)/l+o):(s=Math.log(-t[0]),l=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/l+o))}function Tm(e){if(!c(e))throw new L("clockViewModel is required.");let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Tm.defaultDateFormatter,this._timeFormatter=Tm.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Tm.defaultTicks),this.timeLabel=void 0,Se.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Se.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Se.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===fo.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,Se.defineProperty(this,"shuttleRingAngle",{get:function(){return w1t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,KL),-KL);let a=t._allShuttleRingTicks,l=t._clockViewModel;if(l.clockStep=fo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===KL){l.multiplier=s>0?a[a.length-1]:a[0];return}let d=W1t(s,a);if(t.snapToTicks)d=a[j6(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let f=u.toFixed(0).length-2,p=Math.pow(10,f);d=Math.round(d/p)*p|0}else u>qg?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}l.multiplier=d}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===zr.UNBOUNDED)return!0;let l=s.multiplier,d=s.currentTime,u=s.startTime,f=!1;if(a===zr.LOOP_STOP)f=ee.greaterThan(d,u)||d.equals(u)&&l>0;else{let p=s.stopTime;f=ee.greaterThan(d,u)&&ee.lessThan(d,p)||d.equals(u)&&l>0||d.equals(p)&&l<0}return f||(s.shouldAnimate=!1),f}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===zr.UNBOUNDED)return!0;let l=s.systemTime;return ee.greaterThanOrEquals(l,s.startTime)&&ee.lessThanOrEquals(l,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Qg(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Qg(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Qg(o,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==fo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Rn(function(){t._clockViewModel.clockStep=fo.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Qg(r,{toggled:Se.computed(function(){return e.clockStep===fo.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,d=j6(l,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,d=j6(l,a)+1;d<a.length&&(s.multiplier=a[d])})}Tm.defaultDateFormatter=function(e,t){let n=ee.toGregorianDate(e);return`${I1t[n.month-1]} ${n.day} ${n.year}`};Tm.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];Tm.defaultTimeFormatter=function(e,t){let n=ee.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`};Tm.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Tm.prototype.setShuttleRingTicks=function(e){if(!c(e))throw new L("positiveTicks is required.");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(PCe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(Tm.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){if(typeof e!="function")throw new L("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if(typeof e!="function")throw new L("timeFormatter must be a function");this._timeFormatter=e}}});Tm._maxShuttleRingAngle=KL;Tm._realtimeShuttleRingAngle=qg;var yM=Tm;var gvo=_(T(),1);var fvo=_(T(),1);function vCe(e){e=e??z.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??z.EMPTY_ARRAY,i=e.terrainProviderViewModels??z.EMPTY_ARRAY;if(!c(t))throw new L("globe is required");this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Se.getObservable(this,"imageryProviderViewModels"),r=Se.pureComputed(function(){let f=o(),p={},y;for(y=0;y<f.length;y++){let x=f[y],S=x.category;c(p[S])?p[S].push(x):p[S]=[x]}let h=Object.keys(p),g=[];for(y=0;y<h.length;y++){let x=h[y];g.push({name:x,providers:p[x]})}return g});this._imageryProviders=r;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let f=s(),p={},y;for(y=0;y<f.length;y++){let x=f[y],S=x.category;c(p[S])?p[S].push(x):p[S]=[x]}let h=Object.keys(p),g=[];for(y=0;y<h.length;y++){let x=h[y];g.push({name:x,providers:p[x]})}return g});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let f=this.selectedImagery,p=this.selectedTerrain,y=c(f)?f.name:void 0,h=c(p)?p.name:void 0;return c(y)&&c(h)?`${y}
${h}`:c(y)?y:h}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let f=this.selectedImagery;if(c(f))return f.iconUrl}),this.selectedImagery=void 0;let l=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(f){if(l()===f){this.dropDownVisible=!1;return}let p,y=this._currentImageryLayers,h=y.length,g=this._globe.imageryLayers,x=!1;for(p=0;p<h;p++){let S=g.length;for(let V=0;V<S;V++){let Z=g.get(V);if(Z===y[p]){g.remove(Z),x=!0;break}}}if(c(f)){let S=f.creationCommand();if(Array.isArray(S)){let V=S.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let Z=Ya.fromProviderAsync(S[p]);g.add(Z,0),this._currentImageryLayers.push(Z)}}else{this._currentImageryLayers=[];let V=Ya.fromProviderAsync(S);if(V.name=f.name,x)g.add(V,0);else{let Z=g.get(0);c(Z)&&g.remove(Z),g.add(V,0)}this._currentImageryLayers.push(V)}}l(f),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(f){if(d()===f){this.dropDownVisible=!1;return}let p;if(c(f)&&(p=f.creationCommand()),c(p)&&!c(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof ep),this._globe.terrainProvider=p;else if(c(p)){let y=!1,h=this._globe.terrainProviderChanged.addEventListener(()=>{y=!0,h()}),x=new sM(p).readyEvent.addEventListener(S=>{y||(this._globe.depthTestAgainstTerrain=!(S instanceof ep),this._globe.terrainProvider=S,x())})}d(f),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Rn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(vCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var gM=vCe;function GB(e,t){if(!c(e))throw new L("container is required.");e=Wn(e);let n=new gM(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 l=document.createElement("div");l.className="cesium-baseLayerPicker-category",a.appendChild(l);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),l.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),l.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-item",f.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(f);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),f.appendChild(p);let y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),f.appendChild(y);let h=document.createElement("div");h.className="cesium-baseLayerPicker-sectionTitle",h.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),h.innerHTML="Terrain",r.appendChild(h);let g=document.createElement("div");g.className="cesium-baseLayerPicker-section",g.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(g);let x=document.createElement("div");x.className="cesium-baseLayerPicker-category",g.appendChild(x);let S=document.createElement("div");S.className="cesium-baseLayerPicker-categoryTitle",S.setAttribute("data-bind","text: name"),x.appendChild(S);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),x.appendChild(V);let Z=document.createElement("div");Z.className="cesium-baseLayerPicker-item",Z.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(Z);let R=document.createElement("img");R.className="cesium-baseLayerPicker-itemIcon",R.setAttribute("data-bind","attr: { src: iconUrl }"),R.setAttribute("draggable","false"),Z.appendChild(R);let E=document.createElement("div");E.className="cesium-baseLayerPicker-itemLabel",E.setAttribute("data-bind","text: name"),Z.appendChild(E),Se.applyBindings(n,i),Se.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(GB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});GB.prototype.isDestroyed=function(){return!1};GB.prototype.destroy=function(){return Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._element),Se.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),he(this)};var xM=GB;var Rvo=_(T(),1);var Cvo=_(T(),1);function FCe(e){if(!c(e.name))throw new L("options.name is required.");if(!c(e.tooltip))throw new L("options.tooltip is required.");if(!c(e.iconUrl))throw new L("options.iconUrl is required.");if(typeof e.creationFunction!="function")throw new L("options.creationFunction is required.");let t=e.creationFunction;c(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(FCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ls=FCe;function P1t(){let e=[],t=devicePixelRatio>=2;return e.push(new ls({name:"Bing Maps Aerial",iconUrl:on("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return m0({style:u0.AERIAL})}})),e.push(new ls({name:"Bing Maps Aerial with Labels",iconUrl:on("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return m0({style:u0.AERIAL_WITH_LABELS})}})),e.push(new ls({name:"Bing Maps Roads",iconUrl:on("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return m0({style:u0.ROAD})}})),e.push(new ls({name:"ArcGIS World Imagery",iconUrl:on("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 l0.fromBasemapType(Mf.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ls({name:"ArcGIS World Hillshade",iconUrl:on("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 l0.fromBasemapType(Mf.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ls({name:"Esri World Ocean",iconUrl:on("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 l0.fromBasemapType(Mf.OCEANS,{enablePickFeatures:!1})}})),e.push(new ls({name:"Open\xADStreet\xADMap",iconUrl:on("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 I0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ls({name:"Stadia x Stamen Watercolor",iconUrl:on("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 I0({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 ls({name:"Stadia x Stamen Toner",iconUrl:on("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 I0({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 ls({name:"Stadia Alidade Smooth",iconUrl:on("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 I0({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 ls({name:"Stadia Alidade Smooth Dark",iconUrl:on("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 I0({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 ls({name:"Sentinel-2",iconUrl:on("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 d0.fromAssetId(3954)}})),e.push(new ls({name:"Blue Marble",iconUrl:on("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return d0.fromAssetId(3845)}})),e.push(new ls({name:"Earth at night",iconUrl:on("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 d0.fromAssetId(3812)}})),e.push(new ls({name:"Natural Earth\xA0II",iconUrl:on("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Rg.fromUrl(on("Assets/Textures/NaturalEarthII"))}})),e}var _M=P1t;var Ivo=_(T(),1);function v1t(){let e=[];return e.push(new ls({name:"WGS84 Ellipsoid",iconUrl:on("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new ep({ellipsoid:re.WGS84})}})),e.push(new ls({name:"Cesium World Terrain",iconUrl:on("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 TS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var TM=v1t;var Uvo=_(T(),1);var vvo=_(T(),1);function F1t(e){return function(t){let n=e._scene.pick(t.position);c(n)&&n.primitive instanceof bs&&(e.tileset=n.primitive),e.pickActive=!1}}function MCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);c(i)&&i.primitive instanceof bs&&(e.tileset=i.primitive)},Vn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Vn.MOUSE_MOVE),e.picking=e.picking)}var A1t={maximumFractionDigits:3};function SM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,A1t):Math.round(t).toLocaleString()}function CM(e,t){if(!c(e))return"";let n=t?e._statisticsPerPass[Fo.PICK]:e._statisticsPerPass[Fo.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>${SM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${SM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${SM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function NCe(){let e=Ri.statistics;return`
  <ul class="cesium-cesiumInspector-statistics">
    <li><strong>Geometry Memory (MB): </strong>${SM(e.geometryByteLength)}</li>
    <li><strong>Texture Memory (MB): </strong>${SM(e.texturesByteLength)}</li>
  </ul>
  `}var M1t=[{text:"Highlight",value:Wl.HIGHLIGHT},{text:"Replace",value:Wl.REPLACE},{text:"Mix",value:Wl.MIX}],ACe=new Y(1,1,0,.4),N1t=new Y,EB=new Y;function Ra(e,t){C.typeOf.object("scene",e),C.typeOf.object("performanceContainer",t);let n=this,i=e.canvas;this._eventHandler=new tu(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new p0({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,Se.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=Se.observable({}),this.properties=[],Se.defineProperty(this,"properties",function(){let U=[],K=n._properties();for(let Q in K)K.hasOwnProperty(Q)&&U.push(Q);return U});let o=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),c(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=Wl.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(K){let Q=e.pick(K.endPosition);if(Q instanceof Us?(n.feature=Q,n.tile=Q.content.tile):c(Q)&&c(Q.content)?(n.feature=void 0,n.tile=Q.content.tile):(n.feature=void 0,n.tile=void 0),!!c(n._tileset)){if(s&&c(Q)&&c(Q.content)){let ie;e.pickPositionSupported&&(ie=e.pickPosition(K.endPosition),c(ie)&&(n._tileset.debugPickPosition=ie)),n._tileset.debugPickedTile=Q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Vn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Vn.MOUSE_MOVE))}}),this.picking=!0;let l=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return l()},set:function(U){l(U),c(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let d=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return d()},set:function(U){d(U),c(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let u=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(U){u(U),c(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let f=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return f()},set:function(U){f(U),c(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),c(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let y=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return y()},set:function(U){y(U),c(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),c(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let h=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return h()},set:function(U){h(U),c(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let g=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return g()},set:function(U){g(U),c(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let x=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return x()},set:function(U){x(U),c(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return S()},set:function(U){S(U),c(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let V=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(U){U=Number(U),isNaN(U)||(V(U),c(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let Z=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return Z()},set:function(U){U=Number(U),isNaN(U)||(Z(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(Z(),1/6)},set:function(U){let K=Math.pow(U,6);Z(K),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=K)}});let R=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let E=F1t(this),I=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return I()},set:function(U){I(U),U?n._eventHandler.setInputAction(E,Vn.LEFT_CLICK):n._eventHandler.removeInputAction(Vn.LEFT_CLICK)}});let v=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(U){v(U),c(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let P=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(U){U=Number(U),isNaN(U)||(P(U),c(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let F=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return F()},set:function(U){U=Number(U),isNaN(U)||(F(U),c(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let N=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),c(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let b=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(U){b(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let G=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return G()},set:function(U){U=Number(U),isNaN(U)||(G(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let X=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return X()},set:function(U){U=Number(U),isNaN(U)||(X(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let W=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return W()},set:function(U){W(U),c(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let A=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),c(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let k=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),c(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let B=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return B()},set:function(U){U=Number(U),isNaN(U)||(B(U),c(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let O=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return O()},set:function(U){O(U),c(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let H=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return H()},set:function(U){H(U),c(n._tileset)&&(n._tileset.loadSiblings=U)}}),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()}),c(this._tileset)||MCe(this,!0)}Object.defineProperties(Ra.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 M1t}},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,c(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=CM(e,!1),this._pickStatisticsText=CM(e,!0),this._resourceCacheStatisticsText=NCe(),MCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;c(t)&&!t.content.isDestroyed()&&(!this.colorize&&c(this._style)?t.color=c(this._style.color)?this._style.color.evaluateColor(t,N1t):Y.WHITE:t.color=EB,this._scene.requestRender()),c(e)&&(Y.clone(e.color,EB),e.color=ACe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;c(t)&&!t.isDestroyed()&&!q6(t.content)&&(t.color=EB,this._scene.requestRender()),c(e)&&!q6(e.content)&&(Y.clone(e.color,EB),e.color=ACe,this._scene.requestRender()),this._tile=e}}});function q6(e){if(!c(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)if(!q6(t[i]))return!1;return!0}return!1}Ra.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Ra.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Ra.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Ra.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Ra.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Ra.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Ra.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Ra.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Ra.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Ra.prototype.trimTilesCache=function(){c(this._tileset)&&this._tileset.trimLoadedTiles()};Ra.prototype.compileStyle=function(){let e=this._tileset;if(!(!c(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new RS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Ra.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(`
`),l=a.length,d;if(t.shiftKey)for(d=0;d<l;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<l;++d)a[d]=`  ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Ra.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),c(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=CM(e,!1),this._pickStatisticsText=CM(e,!0),this._resourceCacheStatisticsText=NCe())};Ra.prototype.isDestroyed=function(){return!1};Ra.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),he(this)};Ra.getStatistics=CM;var VM=Ra;function XB(e,t){C.defined("container",e),C.typeOf.object("scene",t),e=Wn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new VM(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=sd.createSection,l=sd.createCheckbox,d=sd.createRangeInput,u=sd.createButton,f=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),y=a(s,"Update","updateVisible","toggleUpdate"),h=a(s,"Logging","loggingVisible","toggleLogging"),g=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),x=a(s,"Style","styleVisible","toggleStyle"),S=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let Z=document.createElement("label");Z.className="field-label",Z.appendChild(document.createTextNode("Properties: "));let R=document.createElement("div");R.setAttribute("data-bind","text: properties"),V.appendChild(Z),V.appendChild(R),f.appendChild(V),f.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),f.appendChild(u("Trim Tiles Cache","trimTilesCache")),f.appendChild(l("Enable Picking","picking")),p.appendChild(l("Colorize","colorize"));let E=p.appendChild(l("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",E.appendChild(I),p.appendChild(l("Bounding Volumes","showBoundingVolumes")),p.appendChild(l("Content Volumes","showContentBoundingVolumes")),p.appendChild(l("Request Volumes","showRequestVolumes")),p.appendChild(l("Point Cloud Shading","pointCloudShading"));let v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(d("Base Resolution","baseResolution",0,1,.01)),v.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(v);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),y.appendChild(l("Freeze Frame","freezeFrame")),y.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));let F=document.createElement("div");F.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),y.appendChild(F);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),y.appendChild(N),h.appendChild(l("Performance","performance")),h.appendChild(i),h.appendChild(l("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),h.appendChild(b),h.appendChild(l("Pick Statistics","showPickStatistics"));let G=document.createElement("div");G.className="cesium-3dTilesInspector-statistics",G.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),h.appendChild(G),h.appendChild(l("Resource Cache Statistics","showResourceCacheStatistics"));let X=document.createElement("div");X.className="cesium-3dTilesInspector-statistics",X.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),h.appendChild(X);let W=document.createElement("div");x.appendChild(W),W.appendChild(document.createTextNode("Color Blend Mode: "));let A=document.createElement("select");A.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),W.appendChild(A);let k=document.createElement("textarea");k.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),W.className="cesium-cesiumInspector-styleEditor",W.appendChild(k);let B=u("Compile (Ctrl+Enter)","compileStyle");W.appendChild(B);let O=document.createElement("div");O.className="cesium-cesiumInspector-error",O.setAttribute("data-bind","text: editorError"),W.appendChild(O),g.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),g.appendChild(l("Geometric Error","showGeometricError")),g.appendChild(l("Rendering Statistics","showRenderingStatistics")),g.appendChild(l("Memory Usage (MB)","showMemoryUsage")),g.appendChild(l("Url","showUrl")),S.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));let H=document.createElement("div");H.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),S.appendChild(H);let U=document.createElement("div");U.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(U);let K=document.createElement("div");K.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),S.appendChild(K),S.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),S.appendChild(l("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(o,n)}Object.defineProperties(XB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});XB.prototype.isDestroyed=function(){return!1};XB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),he(this)};var LM=XB;var qvo=_(T(),1);var Hvo=_(T(),1);function k1t(e){let t;if(c(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 l=Math.pow(2,a);o>=l&&(s.push(a+1),o-=l)}r=s.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function $6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var U1t=new bn,O1t=new m;function ZM(e,t){if(!c(e))throw new L("scene is required");if(!c(t))throw new L("performanceContainer is required");let n=this,i=e.canvas,o=new tu(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="",Se.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=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new p0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new Y9({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else c(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Se.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return c(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:c(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Se.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Se.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let d=n.depthFrustum+1;return n.depthFrustum=$6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let d=n.depthFrustum-1;return n.depthFrustum=$6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!c(s)?s=e.imageryLayers.addImageryProvider(new cM({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&c(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Se.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Se.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],c(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});c(u)&&(n.primitive=c(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Vn.LEFT_CLICK):o.removeInputAction(Vn.LEFT_CLICK)});function l(d){let u,f=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,U1t),y=r.pick(p,n._scene,O1t);if(c(y)){let h=f.cartesianToCartographic(y),g=r._surface.tileProvider._tilesToRenderByTextureCount;for(let x=0;!u&&x<g.length;++x){let S=g[x];if(c(S))for(let V=0;!u&&V<S.length;++V){let Z=S[V];de.contains(Z.rectangle,h)&&(u=Z)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(l,Vn.LEFT_CLICK):o.removeInputAction(Vn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(ZM.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 Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,c(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,c(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(c(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;c(n)&&c(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}}});ZM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=k1t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=$6(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}`};ZM.prototype.isDestroyed=function(){return!1};ZM.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(),he(this)};var RM=ZM;function IB(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let n=document.createElement("div"),i=new RM(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=sd.createSection,l=sd.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=l("Show Frustums","frustums"),f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStatistics",f.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(f),d.appendChild(u),d.appendChild(l("Show Frustum Planes","frustumPlanes")),d.appendChild(l("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let y=document.createElement("div");d.appendChild(y);let h=document.createElement("span");h.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),y.appendChild(h);let g=document.createElement("span");g.setAttribute("data-bind","text: depthFrustumText"),y.appendChild(g);let x=document.createElement("input");x.type="button",x.value="-",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: decrementDepthFrustum"),y.appendChild(x);let S=document.createElement("input");S.type="button",S.value="+",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: incrementDepthFrustum"),y.appendChild(S);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),Z=document.createElement("div");Z.className="cesium-cesiumInspector-pickSection",V.appendChild(Z);let R=document.createElement("input");R.type="button",R.value="Pick a primitive",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let E=document.createElement("div");E.className="cesium-cesiumInspector-center",E.appendChild(R),Z.appendChild(E),Z.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),Z.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),Z.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",I.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'),E=document.createElement("div"),E.appendChild(P),E.className="cesium-cesiumInspector-center",v.appendChild(E);let F=document.createElement("div");v.appendChild(F);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let G=document.createElement("input");G.type="button",G.value="NE",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectNE");let X=document.createElement("input");X.type="button",X.value="SW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSW");let W=document.createElement("input");W.type="button",W.value="SE",W.className="cesium-cesiumInspector-pickButton",W.setAttribute("data-bind","click: selectSE");let A=document.createElement("div");A.className="cesium-cesiumInspector-tileText",F.className="cesium-cesiumInspector-frustumStatistics",F.appendChild(A),F.setAttribute("data-bind","visible: hasPickedTile"),A.setAttribute("data-bind","html: tileText");let k=document.createElement("div");k.className="cesium-cesiumInspector-relativeText",k.textContent="Select relative:",F.appendChild(k);let B=document.createElement("table"),O=document.createElement("tr"),H=document.createElement("tr"),U=document.createElement("td");U.appendChild(N);let K=document.createElement("td");K.appendChild(b);let Q=document.createElement("td");Q.appendChild(G),O.appendChild(U),O.appendChild(K),O.appendChild(Q);let ie=document.createElement("td"),j=document.createElement("td");j.appendChild(X);let $=document.createElement("td");$.appendChild(W),H.appendChild(ie),H.appendChild(j),H.appendChild($),B.appendChild(O),B.appendChild(H),F.appendChild(B),v.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(l("Show only selected","filterTile","hasPickedTile")),I.appendChild(l("Wireframe","wireframe")),I.appendChild(l("Suspend LOD update","suspendUpdates")),I.appendChild(l("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(IB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});IB.prototype.isDestroyed=function(){return!1};IB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),he(this)};var GM=IB;var cFo=_(T(),1);var iFo=_(T(),1);function WB(e,t){c(t)||(t=document.body),t=Wn(t);let n=this,i=Se.observable(_r.fullscreen),o=Se.observable(_r.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Se.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Se.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&_r.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){_r.fullscreen?_r.exitFullscreen():_r.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Wn(e)??r.body,this._callback=function(){i(_r.fullscreen)},r.addEventListener(_r.changeEventName,this._callback)}Object.defineProperties(WB.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new L("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}});WB.prototype.isDestroyed=function(){return!1};WB.prototype.destroy=function(){document.removeEventListener(_r.changeEventName,this._callback),he(this)};var EM=WB;var D1t="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",B1t="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 wB(e,t){if(!c(e))throw new L("container is required.");e=Wn(e);let n=new EM(t,e);n._exitFullScreenPath=B1t,n._enterFullScreenPath=D1t;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),Se.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(wB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wB.prototype.isDestroyed=function(){return!1};wB.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var XM=wB;var gFo=_(T(),1);var fFo=_(T(),1);function kCe(e,t){if(!c(e))throw new L("scene is required.");this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(kCe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(c(e)&&e<0)throw new L("value must be positive.");this._duration=e}}});var IM=kCe;function PB(e,t,n){if(!c(e))throw new L("container is required.");e=Wn(e);let i=new IM(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),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(PB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});PB.prototype.isDestroyed=function(){return!1};PB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var WM=PB;var GFo=_(T(),1);var CFo=_(T(),1);var UCe=1e3;function Sm(e){if(!c(e)||!c(e.scene))throw new L("options.scene is required.");c(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new VS({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 ye,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=DCe,this._handleArrowUp=OCe;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let o=Se.getObservable(t,"_suggestions")().length>0,r=Se.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Rn(function(i){if(i=i??Bg.SEARCH,t._focusTextbox=!1,c(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)Q1t(t);else return K1t(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?OCe(t):r?DCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;HCe(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??Sm.flyToDestination,this._focusTextbox=!1,Se.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Se.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Sm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Se.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Se.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){if(typeof i!="string")throw new L("value must be a valid string.");this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){if(c(i)&&i<0)throw new L("value must be positive.");this._flightDuration=i}})}Object.defineProperties(Sm.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}}});Sm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function OCe(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],Sm._adjustSuggestionsScroll(e,n)}function DCe(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],Sm._adjustSuggestionsScroll(e,i)}function Y1t(e,t){let n=c(t)?t.availability:void 0;return c(n)?IT(t,[e]).then(function(i){return e=i[0],e.height+=UCe,e}):(e.height+=UCe,Promise.resolve(e))}function H1t(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof de?w.equalsEpsilon(t.south,t.north,w.EPSILON7)&&w.equalsEpsilon(t.east,t.west,w.EPSILON7)?t=de.center(t):a=WT(t,n):t=i.cartesianToCartographic(t),c(a)||(a=Y1t(t,r)),a.then(function(l){s=i.cartographicToCartesian(l)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function z1t(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 K1t(e,t,n){let i=e._searchText;if(YCe(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 z1t(t[o],i,n),c(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,tq(e);let s=r.value;if(r.state==="fulfilled"&&c(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=BCe(e,PL.getCreditsFromResult(s[0]));c(a)||eq(e,t[o].credit);return}e._searchText=`${i} (not found)`}function eq(e,t){c(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function BCe(e,t){return c(t)&&t.forEach(n=>eq(e,n)),t}function tq(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function J1t(e,t){let n=Wn(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 Q1t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function YCe(e){return/^\s*$/.test(e)}function HCe(e){Se.getObservable(e,"_suggestions").removeAll()}async function j1t(e){if(!e.autoComplete)return;let t=e._searchText;if(HCe(e),tq(e),!YCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Bg.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=PL.getCreditsFromResult(r);o=o&&!c(s),BCe(e,s)}),o&&eq(e,n.credit)}if(e._suggestions.length>=5)return}}Sm.flyToDestination=H1t;Sm._updateSearchSuggestions=j1t;Sm._adjustSuggestionsScroll=J1t;Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){return tq(this),he(this)};var wM=Sm;var q1t="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",$1t="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 vB(e){if(!c(e)||!c(e.container))throw new L("options.container is required.");if(!c(e.scene))throw new L("options.scene is required.");let t=Wn(e.container),n=new wM(e);n._startSearchPath=q1t,n._stopSearchPath=$1t;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 l=document.createElement("li");a.appendChild(l),l.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Se.applyBindings(n,i),Se.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},Ot.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(vB.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});vB.prototype.isDestroyed=function(){return!1};vB.prototype.destroy=function(){let e=this._container;return Ot.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(),Se.cleanNode(this._form),Se.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),he(this)};var PM=vB;var AFo=_(T(),1);var WFo=_(T(),1);function eVt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function KCe(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)KCe(e.sublayers[n],t)}function FB(e){return e.modelName==="FullModel"}function JCe(e){return e.modelName==="Overview"}function QCe(e){return JCe(e)||FB(e)}function zCe(e,t){if(QCe(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:Se.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function tVt(e,t){if(QCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");FB(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function nVt(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 iVt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Se.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Se.observable(!0),index:-1}],currentLayer:Se.observable(),expandClickHandler:eVt,setOptionDisable:function(i,o){Se.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){tVt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){KCe(n[i],this.viewModel);let o=zCe(n[i],this.viewModel);c(o)&&(JCe(o)||!c(this.viewModel.defaultLayer)&&FB(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=zCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=FB(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return nVt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var vM=iVt;function oVt(e,t){let n=document.getElementById(e);C.defined("container",n),C.defined("i3sProvider",t);let 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 vM(t);Se.track(o),Se.applyBindings(o,n),c(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var nq=oVt;var zFo=_(T(),1);var UFo=_(T(),1);var rVt="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",sVt="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 iq(){this._cameraClicked=new ye,this._closeClicked=new ye,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Se.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,Se.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?sVt:rVt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!c(this.description)||this.description.length===0}})}iq.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(iq.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var FM=iq;function AB(e){C.defined("container",e),e=Wn(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 FM;Se.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 l=r.contentDocument,d=l.createElement("link");d.href=on("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=l.createElement("div");u.className="cesium-infoBox-description",l.head.appendChild(d),l.body.appendChild(u),a._descriptionSubscription=Za(s,"description",function(f){r.style.height="5px",u.innerHTML=f;let p=null,y=u.firstElementChild;if(y!==null&&u.childNodes.length===1){let g=window.getComputedStyle(y);if(g!==null){let x=g["background-color"],S=Y.fromCssColorString(x);c(S)&&S.alpha!==0&&(p=g["background-color"])}}t.style["background-color"]=p;let h=u.getBoundingClientRect().height;r.style.height=`${h}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(AB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});AB.prototype.isDestroyed=function(){return!1};AB.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),c(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),he(this)};var AM=AB;var iAo=_(T(),1);var qFo=_(T(),1);function MB(e){if(!c(e))throw new L("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof sn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Se.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Se.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===se.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new hr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===se.SCENE2D||t._scene.camera.frustum instanceof sn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=c(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=se}Object.defineProperties(MB.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}}});MB.prototype.isDestroyed=function(){return!1};MB.prototype.destroy=function(){this._eventHelper.removeAll(),he(this)};var MM=MB;var aVt="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",cVt="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 NB(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let n=new MM(t);n._perspectivePath=aVt,n._orthographicPath=cVt;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),Se.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(NB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NB.prototype.isDestroyed=function(){return!1};NB.prototype.destroy=function(){return this._viewModel.destroy(),Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),he(this)};var NM=NB;var fAo=_(T(),1);var cAo=_(T(),1);function oq(e){if(!c(e)||!c(e.scene))throw new L("options.scene is required.");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,Se.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=K9.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(oq.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});oq.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),he(this)};var kM=oq;function kB(e){if(!c(e)||!c(e.container))throw new L("options.container is required.");if(!c(e.scene))throw new L("options.scene is required.");let t=Wn(e.container),n=new kM(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),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(kB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kB.prototype.isDestroyed=function(){return!1};kB.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var UM=kB;var SAo=_(T(),1);var yAo=_(T(),1);function jCe(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(jCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var OM=jCe;function UB(e){if(!c(e)||!c(e.container))throw new L("options.container is required.");let t=Wn(e.container),n=new OM,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 l=document.createElement("img");l.src=on("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",a.appendChild(l),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=on("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let f=document.createElement("div");f.className="cesium-click-navigation-help cesium-navigation-help-instructions",f.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),f.innerHTML=`            <table>                <tr>                    <td><img src="${on("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="${on("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="${on("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(f);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=`            <table>                <tr>                    <td><img src="${on("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="${on("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="${on("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="${on("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td>                    <td>                        <div class="cesium-navigation-help-tilt">Rotate view</div>                        <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div>                    </td>                </tr>            </table>`,s.appendChild(p),Se.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(y){o.contains(y.target)||(n.showInstructions=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(UB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});UB.prototype.isDestroyed=function(){return!1};UB.prototype.destroy=function(){return Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),he(this)};var DM=UB;var IAo=_(T(),1);var ZAo=_(T(),1);var lVt=new D,OB="-1000px";function BM(e,t,n){if(!c(e))throw new L("scene is required.");if(!c(t))throw new L("selectionIndicatorElement is required.");if(!c(n))throw new L("container is required.");this._scene=e,this._screenPositionX=OB,this._screenPositionY=OB,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Se.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Se.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&c(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Oi.worldToWindowCoordinates(e,i,o)}}BM.prototype.update=function(){if(this.showSelection&&c(this.position)){let e=this.computeScreenSpacePosition(this.position,lVt);if(!c(e))this._screenPositionX=OB,this._screenPositionY=OB;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`}}};BM.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Jr.EXPONENTIAL_OUT})};BM.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Jr.EXPONENTIAL_OUT})};Object.defineProperties(BM.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var YM=BM;function DB(e,t){if(!c(e))throw new L("container is required.");e=Wn(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 l=new YM(t,this._element,this._container);this._viewModel=l,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(DB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DB.prototype.isDestroyed=function(){return!1};DB.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),he(this)};var HM=DB;var UAo=_(T(),1);var FAo=_(T(),1);function BB(e,t){if(!c(e))throw new L("scene is required.");this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new hr,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",Se.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Se.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===se.SCENE2D?n.tooltip2D:o===se.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=se}Object.defineProperties(BB.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new L("duration value must be positive.");this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});BB.prototype.isDestroyed=function(){return!1};BB.prototype.destroy=function(){this._eventHelper.removeAll(),he(this)};var zM=BB;var dVt="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",uVt="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",mVt="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 YB(e,t,n){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let i=new zM(t,n);i._globePath=dVt,i._flatMapPath=uVt,i._columbusViewPath=mVt;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 l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)),       "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW,       "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(l),Se.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},Ot.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(YB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YB.prototype.isDestroyed=function(){return!1};YB.prototype.destroy=function(){return this._viewModel.destroy(),Ot.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),he(this)};var KM=YB;var qAo=_(T(),1);var BAo=_(T(),1);function AS(e,t,n){this._color=e,this._height=t,this._base=n??0}AS.prototype.getHeight=function(){return this._height};AS.prototype.getBase=function(){return this._base};AS.prototype.getStartTime=function(){return this._start};AS.prototype.getStopTime=function(){return this._stop};AS.prototype.setRange=function(e,t){this._start=e,this._stop=t};AS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=ee.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=ee.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 JM=AS;var zAo=_(T(),1);function qCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new Y(.5,.5,.5,1),this.backgroundColor=i||new Y(0,0,0,0)}qCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=ee.addSeconds(t.startJulian,t.duration,new ee);if(ee.lessThan(n,o)&&ee.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(ee.lessThanOrEquals(n,r)&&ee.greaterThanOrEquals(i,o)){let s,a,l;for(s=0;s<t.timeBarWidth;++s){let d=ee.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new ee);!c(a)&&ee.greaterThanOrEquals(d,n)?a=s:!c(l)&&ee.greaterThanOrEquals(d,i)&&(l=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),c(a)&&(c(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(l-a,1),this.height))}};var QM=qCe;var rq=1e12,Cm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},yl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},$g=[.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],fVt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gl(e,t){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("clock is required.");e=Wn(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=Cm.none,this._touchMode=yl.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=hVt(this),this._onMouseUp=pVt(this),this._onMouseMove=bVt(this),this._onMouseWheel=yVt(this),this._onTouchStart=gVt(this),this._onTouchMove=_Vt(this),this._onTouchEnd=xVt(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()}gl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};gl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};gl.prototype.isDestroyed=function(){return!1};gl.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),he(this)};gl.prototype.addHighlightRange=function(e,t,n){let i=new JM(e,t,n);return this._highlightRanges.push(i),this.resize(),i};gl.prototype.addTrack=function(e,t,n,i){let o=new QM(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};gl.prototype.zoomTo=function(e,t){if(!c(e))throw new L("startTime is required.");if(!c(t))throw new L("stopTime is required");if(ee.lessThanOrEquals(t,e))throw new L("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=ee.secondsDifference(t,e),this._clock&&this._clock.clockRange!==zr.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=ee.secondsDifference(o,i),s=ee.secondsDifference(i,this._startJulian),a=ee.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=ee.addSeconds(this._endJulian,s,new ee),this._startJulian=i,this._timeBarSecondsSpan=ee.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=ee.addSeconds(this._startJulian,a,new ee),this._endJulian=o,this._timeBarSecondsSpan=ee.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)};gl.prototype.zoomFrom=function(e){let t=ee.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(ee.addSeconds(this._startJulian,t-t*e,new ee),ee.addSeconds(this._endJulian,n*e-n,new ee))};function sq(e){return e<10?`0${e.toString()}`:e.toString()}gl.prototype.makeLabel=function(e){let t=ee.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`${fVt[t.month-1]} ${t.day} ${t.year} ${sq(t.hour)}:${sq(t.minute)}:${sq(t.second)}${i}`};gl.prototype.smallestTicInPixels=7;gl.prototype._makeTics=function(){let e=this._timeBarEle,t=ee.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,l=31536e6,d=1e-10,u=0,f=this._timeBarSecondsSpan;f<a?(f=a,this._timeBarSecondsSpan=a,this._endJulian=ee.addSeconds(this._startJulian,a,new ee)):f>l&&(f=l,this._timeBarSecondsSpan=l,this._endJulian=ee.addSeconds(this._startJulian,l,new ee));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let y=this._startJulian,h=Math.min(f/p*1e-5,.4),g,x=ee.toGregorianDate(y);f>31536e4?g=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/100)*100,0))):f>31536e3?g=ee.fromDate(new Date(Date.UTC(Math.floor(x.year/10)*10,0))):f>86400?g=ee.fromDate(new Date(Date.UTC(x.year,0))):g=ee.fromDate(new Date(Date.UTC(x.year,x.month,x.day)));let S=ee.secondsDifference(this._startJulian,ee.addSeconds(g,h,new ee)),V=S+f;this._epochJulian=g;function Z(U){return Math.floor(S/U)*U}function R(U,K){return Math.ceil(U/K+.5)*K}function E(U){return(U-S)/f}function I(U,K){return U-K*Math.round(U/K)}this._rulerEle.innerHTML=this.makeLabel(ee.addSeconds(this._endJulian,-a,new ee));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=u;u-=d;let F={startTime:S,startJulian:y,epochJulian:g,duration:f,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(U){s+=U.render(F)});let N=0,b=0,G=0,X=v/p;X>1&&(X=1),X*=this._timeBarSecondsSpan;let W=-1,A=-1,k=$g.length,B;for(B=0;B<k;++B){let U=$g[B];if(++W,N=U,U>X&&U>u)break;A<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(A=W)}if(W>0){for(;W>0;)if(--W,Math.abs(I(N,$g[W]))<1e-5){$g[W]>=u&&(b=$g[W]);break}if(A>=0)for(;A<W;){if(Math.abs(I(b,$g[A]))<1e-5&&$g[A]>=u){G=$g[A];break}++A}}u=P,u>d&&G<1e-5&&Math.abs(u-N)>d&&(G=u,u<=N+d&&(b=0));let O=-999999,H;if(p*(G/this._timeBarSecondsSpan)>=3)for(o=Z(G);o<=V;o=R(o,G))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=Z(b);o<=V;o=R(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,V+=N,o=Z(N);let U=ee.computeTaiMinusUtc(g);for(;o<=V;){let K=ee.addSeconds(y,o-S,new ee);if(N>2.1){let $=ee.computeTaiMinusUtc(K);Math.abs($-U)>.1&&(o+=$-U,K=ee.addSeconds(y,o-S,new ee))}let Q=Math.round(p*E(o)),ie=this.makeLabel(K);this._rulerEle.innerHTML=ie,H=this._rulerEle.offsetWidth,H<10&&(H=v);let j=Q-(H/2-1);j>O?(O=j+H+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${Q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${j.toString()}px;">${ie}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${Q.toString()}px;"></span>`,o=R(o,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),F.y=0,this._trackList.forEach(function(U){U.render(r._context,F),F.y+=U.height})};gl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(c(this._scrubElement)){let t=ee.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`)}c(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ee.addSeconds(this._startJulian,this._timelineDrag,new ee),ee.addSeconds(this._endJulian,this._timelineDrag,new ee)))};gl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=ee.addSeconds(this._startJulian,t,new ee),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 hVt(e){return function(t){e._mouseMode!==Cm.touchOnly&&(t.button===0?(e._mouseMode=Cm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Cm.zoom:e._mouseMode=Cm.slide)),t.preventDefault()}}function pVt(e){return function(t){e._mouseMode=Cm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function bVt(e){return function(t){let n;if(e._mouseMode===Cm.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===Cm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(ee.addSeconds(e._startJulian,i,new ee),ee.addSeconds(e._endJulian,i,new ee))}}else e._mouseMode===Cm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function yVt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;rq=Math.max(Math.min(Math.abs(n),rq),1),n/=rq,e.zoomFrom(Math.pow(1.05,-n))}}function gVt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Cm.touchOnly,n===1?(i=ee.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=yl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=yl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=yl.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=yl.ignore}}function xVt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===yl.singleTap?(e._touchMode=yl.scrub,e._onTouchMove(t)):e._touchMode===yl.scrub&&e._onTouchMove(t),e._mouseMode=Cm.touchOnly,n!==1?e._touchMode=n>0?yl.ignore:yl.none:e._touchMode===yl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _Vt(e){return function(t){let n,i,o,r,s,a,l=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===yl.singleTap&&(e._touchMode=yl.slideZoom),e._mouseMode=Cm.touchOnly,e._touchMode===yl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===yl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),c(r)&&(s>0&&e._touchState.spanX>0?(l=e._touchState.spanX/s,a=ee.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*l)/e._topDiv.clientWidth,new ee)):(n=e._touchState.centerX-r,a=ee.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new ee)),e.zoomTo(a,ee.addSeconds(a,e._timeBarSecondsSpan*l,new ee)),e._touchState.centerX=r,e._touchState.spanX=s))}}gl.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 jM=gl;var c9o=_(T(),1);var n9o=_(T(),1);function $Ce(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 l=t[a];l.match(o)[0].length>=s&&(l=l.slice(s)),i+=`${l}
`}return i}function Vm(e){C.typeOf.object("scene",e),this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let l=o.getPrimitiveFunction;l===!0&&(l=function(){t[r]=t._voxelPrimitive[r]}),c(l)&&t._getPrimitiveFunctions.push(l);let d=Se.observable();return Se.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),c(a)&&c(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=$Ce(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===La.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===La.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===La.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:-w.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:w.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:-w.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:w.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:-w.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:w.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:-w.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:w.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:-w.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:w.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:-w.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:w.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&&yp(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new m).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new m).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new m).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&yp(t)}})}var TVt=new m,SVt=new m,CVt=new Ea,VVt=new te;function yp(e){let t=m.fromElements(e.translationX,e.translationY,e.translationZ,TVt),n=m.fromElements(e.scaleX,e.scaleY,e.scaleZ,SVt),i=CVt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=te.fromHeadingPitchRoll(i,VVt),r=te.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Vm.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(c(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!c(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=$Ce(i),c(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,yp(t)}}});Vm.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Vm.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Vm.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Vm.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Vm.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Vm.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Vm.prototype.compileShader=function(){c(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new aS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Vm.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(`
`),l=a.length,d;if(t.shiftKey)for(d=0;d<l;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<l;++d)a[d]=`  ${a[d]}`,r+=2;let u=a.join(`
`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),he(this)};var qM=Vm;function HB(e,t){C.defined("container",e),C.typeOf.object("scene",t),e=Wn(e);let n=document.createElement("div"),i=new qM(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:l,createButton:d}=sd,u=s(r,"Display","displayVisible","toggleDisplay"),f=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),y=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(l("Screen Space Error","screenSpaceError",0,128)),u.appendChild(l("Step Size","stepSize",0,2));let h=10,g=10,x=w.PI;f.appendChild(l("Translation X","translationX",-h,+h)),f.appendChild(l("Translation Y","translationY",-h,+h)),f.appendChild(l("Translation Z","translationZ",-h,+h)),f.appendChild(l("Scale X","scaleX",0,+g)),f.appendChild(l("Scale Y","scaleY",0,+g)),f.appendChild(l("Scale Z","scaleZ",0,+g)),f.appendChild(l("Heading","angleX",-x,+x)),f.appendChild(l("Pitch","angleY",-x,+x)),f.appendChild(l("Roll","angleZ",-x,+x)),aq("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),aq("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),aq("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let S=document.createElement("div");y.appendChild(S);let V=document.createElement("textarea");V.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),S.className="cesium-cesiumInspector-styleEditor",S.appendChild(V);let Z=d("Compile (Ctrl+Enter)","compileShader");S.appendChild(Z);let R=document.createElement("label");R.style.display="block",R.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),S.appendChild(R),Se.applyBindings(i,n)}Object.defineProperties(HB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});HB.prototype.isDestroyed=function(){return!1};HB.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),he(this)};function aq(e,t,n,i,o,r,s,a,l,d,u,f,p,y){let h=sd.createRangeInputWithDynamicMinMax,g=y.appendChild(document.createElement("div"));g.setAttribute("data-bind",`if: ${p}`),g.appendChild(h(e,s)),g.appendChild(h(t,a)),g.appendChild(h(n,l)),g.appendChild(h(i,d)),g.appendChild(h(o,u)),g.appendChild(h(r,f))}var $M=HB;var S9o=_(T(),1);var y9o=_(T(),1);var o1e=_(i1e(),1);function RVt(e){let t=!1,n=window.screen;return c(n)&&(c(n.lockOrientation)?t=n.lockOrientation(e):c(n.mozLockOrientation)?t=n.mozLockOrientation(e):c(n.msLockOrientation)?t=n.msLockOrientation(e):c(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function r1e(){let e=window.screen;c(e)&&(c(e.unlockOrientation)?e.unlockOrientation():c(e.mozUnlockOrientation)?e.mozUnlockOrientation():c(e.msUnlockOrientation)?e.msUnlockOrientation():c(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function GVt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(r1e(),e._locked=!1),e._noSleep.disable(),_r.exitFullscreen(),n(!1)):(_r.fullscreen||_r.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=RVt("landscape")),t.useWebVR=!0,n(!0)))}function zB(e,t){if(!c(e))throw new L("scene is required.");let n=this,i=Se.observable(_r.enabled),o=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&_r.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new hr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof sn)}),this._locked=!1,this._noSleep=new o1e.default,this._command=Rn(function(){GVt(n,e,o,r)},Se.getObservable(this,"isVREnabled")),this._vrElement=Wn(t)??document.body,this._callback=function(){!_r.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(r1e(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(_r.changeEventName,this._callback)}Object.defineProperties(zB.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new L("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}});zB.prototype.isDestroyed=function(){return!1};zB.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(_r.changeEventName,this._callback),he(this)};var eN=zB;var EVt="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",XVt="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 KB(e,t,n){if(!c(e))throw new L("container is required.");if(!c(t))throw new L("scene is required.");e=Wn(e);let i=new eN(t,n);i._exitVRPath=XVt,i._enterVRPath=EVt;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),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(KB.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KB.prototype.isDestroyed=function(){return!1};KB.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),he(this)};var tN=KB;var O9o=_(T(),1);var s1e=new ue;function l1e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function IVt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);c(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 WVt(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(c(r)&&r!=="")return r}return"Unnamed Feature"}function a1e(e,t){let n=e.scene.pick(t.position);if(c(n)){let i=n.id??n.primitive.id;if(i instanceof $o)return i;if(n instanceof Us)return new $o({name:WVt(n),description:IVt(n),feature:n})}if(c(e.scene.globe))return vVt(e,t.position)}var wVt=new ee;function uq(e,t){if(c(t)){let n=t.clock;if(c(n)&&c(e)){let i=n.startTime,o=n.stopTime;ee.equals(i,o)&&(o=ee.addSeconds(i,w.EPSILON2,wVt)),e.updateFromClock(),e.zoomTo(i,o)}}}var PVt=new m;function vVt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!c(o))return;let r=new $o({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!c(s)||s.length===0){e.selectedEntity=c1e();return}let a=s[0],l=new $o({id:a.name,description:a.description});if(c(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,PVt);l.position=new Oc(d)}e.selectedEntity=l},function(){e.selectedEntity===r&&(e.selectedEntity=c1e())}),r}function c1e(){return new $o({id:"None",description:"No features found."})}function FVt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,l=e._timeline,d=e._fullscreenButton,u=e._infoBox,f=e._selectionIndicator,p=t?"hidden":"visible";if(c(n)&&(n.container.style.visibility=p),c(i)&&(i.container.style.visibility=p),c(o)&&(o.container.style.visibility=p),c(r)&&(r.container.style.visibility=p),c(s)&&(s.container.style.visibility=p),c(a)&&(a.container.style.visibility=p),c(l)&&(l.container.style.visibility=p),c(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),c(u)&&(u.container.style.visibility=p),c(f)&&(f.container.style.visibility=p),e._container){let y=t||!c(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${y}px`,e.forceResize()}}function qi(e,t){if(!c(e))throw new L("container is required.");if(e=Wn(e),t=t??z.EMPTY_OBJECT,t.globe===!1&&c(t.baseLayer)&&t.baseLayer!==!1)throw new L("Cannot use baseLayer when globe is disabled.");let n=(!c(t.globe)||t.globe!==!1)&&(!c(t.baseLayerPicker)||t.baseLayerPicker!==!1);if(!n&&c(t.selectedImageryProviderViewModel))throw new L("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.baseLayer instead or set options.baseLayerPicker to true.");if(!n&&c(t.selectedTerrainProviderViewModel))throw new L("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");let 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,l,d,u=!1;c(t.clockViewModel)?(d=t.clockViewModel,l=d.clock):(l=new _f,d=new fM(l),u=!0);let f=new G9(r,{baseLayer:n&&c(t.selectedImageryProviderViewModel)||c(t.baseLayer)||c(t.imageryProvider)?!1:void 0,clock:l,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:c(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=f.scene,y=new hr;y.add(l.onTick,qi.prototype._onTick,this);let h;if(!c(t.selectionIndicator)||t.selectionIndicator!==!1){let K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(K),h=new HM(K,p)}let g;if(!c(t.infoBox)||t.infoBox!==!1){let K=document.createElement("div");K.className="cesium-viewer-infoBoxContainer",o.appendChild(K),g=new AM(K);let Q=g.viewModel;y.add(Q.cameraClicked,qi.prototype._onInfoBoxCameraClicked,this),y.add(Q.closeClicked,qi.prototype._onInfoBoxClockClicked,this)}let x=document.createElement("div");x.className="cesium-viewer-toolbar",o.appendChild(x);let S;if(!c(t.geocoder)||t.geocoder!==!1){let K=document.createElement("div");K.className="cesium-viewer-geocoderContainer",x.appendChild(K);let Q;typeof t.geocoder=="string"?Q=[new VS({scene:p,geocodeProviderType:t.geocoder})]:c(t.geocoder)&&typeof t.geocoder!="boolean"&&(Q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new PM({container:K,geocoderServices:Q,scene:p}),y.add(S.viewModel.search.beforeExecute,qi.prototype._clearObjects,this)}let V;if((!c(t.homeButton)||t.homeButton!==!1)&&(V=new WM(x,p),c(S)&&y.add(V.viewModel.command.afterExecute,function(){let K=S.viewModel;K.searchText="",K.isSearchInProgress&&K.search()}),y.add(V.viewModel.command.beforeExecute,qi.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&a)throw new L("options.sceneModePicker is not available when options.scene3DOnly is set to true.");let Z;!a&&(!c(t.sceneModePicker)||t.sceneModePicker!==!1)&&(Z=new KM(x,p));let R;t.projectionPicker&&(R=new NM(x,p));let E,I;if(n){let K=t.imageryProviderViewModels??_M(),Q=t.terrainProviderViewModels??TM();E=new xM(x,{globe:p.globe,imageryProviderViewModels:K,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),I=x.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(c(t.baseLayer)&&t.baseLayer!==!1&&(n&&(E.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),c(t.terrainProvider)&&(n&&(E.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),c(t.terrain)){if(c(t.terrainProvider))throw new L("Specify either options.terrainProvider or options.terrain.");n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain)}let v;if(!c(t.navigationHelpButton)||t.navigationHelpButton!==!1){let K=!0;try{if(c(window.localStorage)){let Q=window.localStorage.getItem("cesium-hasSeenNavHelp");c(Q)&&Q?K=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new DM({container:x,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??K})}let P;if(!c(t.animation)||t.animation!==!1){let K=document.createElement("div");K.className="cesium-viewer-animationContainer",o.appendChild(K),P=new bM(K,new yM(d))}let F;if(!c(t.timeline)||t.timeline!==!1){let K=document.createElement("div");K.className="cesium-viewer-timelineContainer",o.appendChild(K),F=new jM(K,l),F.addEventListener("settime",l1e,!1),F.zoomTo(l.startTime,l.stopTime)}let N,b,G;(!c(t.fullscreenButton)||t.fullscreenButton!==!1)&&(G=document.createElement("div"),G.className="cesium-viewer-fullscreenContainer",o.appendChild(G),N=new XM(G,t.fullscreenElement),b=Za(N.viewModel,"isFullscreenEnabled",function(K){G.style.display=K?"block":"none",c(F)&&(F.container.style.right=`${G.clientWidth}px`,F.resize())}));let X,W,A;if(t.vrButton){let K=document.createElement("div");K.className="cesium-viewer-vrContainer",o.appendChild(K),X=new tN(K,p,t.fullScreenElement),W=Za(X.viewModel,"isVREnabled",function(Q){K.style.display=Q?"block":"none",c(N)&&(K.style.right=`${G.clientWidth}px`),c(F)&&(F.container.style.right=`${K.clientWidth}px`,F.resize())}),A=Za(X.viewModel,"isVRMode",function(Q){FVt(i,Q)})}this._baseLayerPickerDropDown=I,this._fullscreenSubscription=b,this._vrSubscription=W,this._vrModeSubscription=A,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=f,this._selectionIndicator=h,this._infoBox=g,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=x,this._homeButton=V,this._sceneModePicker=Z,this._projectionPicker=R,this._baseLayerPicker=E,this._navigationHelpButton=v,this._animation=P,this._timeline=F,this._fullscreenButton=N,this._vrButton=X,this._geocoder=S,this._eventHelper=y,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=c(g)||c(h),this._selectedEntity=void 0,this._selectedEntityChanged=new ye;let k=this._cesiumWidget.dataSources,B=this._cesiumWidget.dataSourceDisplay;y.add(k.dataSourceAdded,qi.prototype._onDataSourceAdded,this),y.add(k.dataSourceRemoved,qi.prototype._onDataSourceRemoved,this),y.add(p.postUpdate,qi.prototype.resize,this);let O=k.length;for(let K=0;K<O;K++)this._dataSourceAdded(k,k.get(K));this._dataSourceAdded(void 0,B.defaultDataSource),y.add(k.dataSourceAdded,qi.prototype._dataSourceAdded,this),y.add(k.dataSourceRemoved,qi.prototype._dataSourceRemoved,this);function H(K){let Q=a1e(i,K);c(Q)?J.getValueOrUndefined(Q.position,i.clock.currentTime)?i.trackedEntity=Q:i.zoomTo(Q):c(i.trackedEntity)&&(i.trackedEntity=void 0)}function U(K){i.selectedEntity=a1e(i,K)}f.screenSpaceEventHandler.setInputAction(U,Vn.LEFT_CLICK),f.screenSpaceEventHandler.setInputAction(H,Vn.LEFT_DOUBLE_CLICK),f._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(qi.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=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(e)?c(t)&&t.animateAppear():c(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,uq(this._timeline,e))}}});qi.prototype.extend=function(e,t){if(!c(e))throw new L("mixin is required.");e(this,t)};qi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=c(this._animation),r=c(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(c(a)&&(a.style.maxHeight=`${s}px`),c(this._geocoder)){let h=this._geocoder.searchSuggestionsContainer;h.style.maxHeight=`${s}px`}c(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let l=this._timeline,d,u=0,f=5,p=3,y=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let h=this._lastWidth;d=this._animation.container,n>900?(u=169,h<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(h<600||h>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(h>600||h===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),f=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let h=this._fullscreenButton,g=this._vrButton,x=l.container,S=x.style;p=x.clientHeight+3,S.left=`${u}px`;let V=0;c(h)&&(V+=h.container.clientWidth),c(g)&&(V+=g.container.clientWidth),S.right=`${V}px`,l.resize()}!r&&c(this._fullscreenButton)&&(y=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${f}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${y}px`,this._lastWidth=n,this._lastHeight=i};qi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};qi.prototype.render=function(){this._cesiumWidget.render()};qi.prototype.isDestroyed=function(){return!1};qi.prototype.destroy=function(){return c(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Vn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Vn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),c(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),c(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),c(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),c(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),c(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),c(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),c(this._timeline)&&(this._timeline.removeEventListener("settime",l1e,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),c(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),c(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),c(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),c(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(),he(this)};qi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(qi.prototype._onEntityCollectionChanged,this)};qi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(qi.prototype._onEntityCollectionChanged,this),c(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};qi.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};qi.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=c(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,s1e)!==ut.FAILED?n=s1e.center:c(o.position)&&(n=o.position.getValue(t,n)),i=c(n));let s=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(s)&&(s.position=m.clone(n,s.position),s.showSelection=r&&i,s.update());let a=c(this._infoBox)?this._infoBox.viewModel:void 0;c(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=""))};qi.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)}};qi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;c(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};qi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};qi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};qi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};qi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&uq(this.timeline,e)};qi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&uq(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,qi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};qi.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};qi.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};qi.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var mq=qi;var H9o=_(T(),1);function AVt(e){C.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new LM(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var fq=AVt;var Q9o=_(T(),1);function MVt(e){if(!c(e))throw new L("viewer is required.");let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new GM(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var hq=MVt;var $9o=_(T(),1);function NVt(e,t){if(!c(e))throw new L("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new L("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new L("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new L("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new L("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new L("flyToOnDrop is already defined by another mixin.");t=t??z.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new ye,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,l=t.proxy;s=Wn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){if(!c(u))throw new L("value is required.");d1e(s,d),s=u,pq(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?pq(s,d):d1e(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return l},set:function(u){l=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){MS(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let f=u.dataTransfer.files,p=f.length;for(let y=0;y<p;y++){let h=f[y],g=new FileReader;g.onload=kVt(e,h,l,a),g.onerror=UVt(e,h),g.readAsText(h)}}pq(s,d),e.destroy=A9(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function MS(e){e.stopPropagation(),e.preventDefault()}function d1e(e,t){let n=e;c(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",MS,!1),n.removeEventListener("dragover",MS,!1),n.removeEventListener("dragexit",MS,!1))}function pq(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",MS,!1),e.addEventListener("dragover",MS,!1),e.addEventListener("dragexit",MS,!1)}function kVt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=c2.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=gg.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=XT.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=xv.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}c(a)&&e.dataSources.add(a).then(function(l){e.flyToOnDrop&&e.flyTo(l)}).catch(function(l){e.dropError.raiseEvent(e,s,l)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function UVt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var bq=NVt;var iMo=_(T(),1);function OVt(e,t){if(!c(e))throw new L("viewer is required.");t=t??z.EMPTY_OBJECT;let n=new UM({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var yq=OVt;var aMo=_(T(),1);function DVt(e){C.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new $M(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var gq=DVt;globalThis.CESIUM_VERSION="1.129";var BVt="1.129";return y1e(YVt);})();
//# sourceMappingURL=Cesium.js.map
